X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=nucleus%2Flibs%2Fshowlist.php;h=31e36654af252b4dd597ecc6a1a0a0595803d936;hb=587960ec5d94e0b15b0697e68a0226e151785fd4;hp=394341300dd9f74ca2c4e4ddb4ae008b4f23fc4b;hpb=0c4068c563db13162327c79bcf941c5f3dab96a0;p=nucleus-jp%2Fnucleus-next.git
diff --git a/nucleus/libs/showlist.php b/nucleus/libs/showlist.php
index 3943413..31e3665 100644
--- a/nucleus/libs/showlist.php
+++ b/nucleus/libs/showlist.php
@@ -1,967 +1,2446 @@
-\n";
-
- // add extra row if needed
- if ( ifset($template['extra']) )
- {
- echo '\n";
- }
-
- break;
- case 'BODY':
- $current = $template['current'];
-
- echo '\n";
- break;
- case 'FOOT':
- echo '';
- break;
- }
- return;
-}
-
-function listplug_table($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo "\n\n";
- echo "
\n";
- echo "\n";
- echo "\n";
- // print head
- call_user_func("listplug_table_{$template['content']}" , $template, 'HEAD');
- echo "
\n";
- echo "\n";
- echo "\n";
- break;
- case 'BODY':
- // print tabletype specific thingies
- echo "\n";
- call_user_func("listplug_table_{$template['content']}" , $template, 'BODY');
- echo "
\n";
- break;
- case 'FOOT':
- call_user_func("listplug_table_{$template['content']}" , $template, 'FOOT');
- echo "\n";
- echo "
\n";
- echo "\n";
- break;
- }
- return;
-}
-
-function listplug_table_memberlist($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LIST_MEMBER_NAME . " | \n";
- echo '' . _LIST_MEMBER_RNAME . " | \n";
- echo '' . _LIST_MEMBER_URL . " | \n";
- echo '' . _LIST_MEMBER_ADMIN . " | \n";
- help('superadmin');
- echo "\n";
- echo '' . _LIST_MEMBER_LOGIN;
- help('canlogin');
- echo " | \n";
- echo '' . _LISTS_ACTIONS. " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- echo '';
- $id = listplug_nextBatchId();
- echo "mnumber}\" />\n";
- echo "\n";
- echo " | ";
- echo "" . ENTITY::hsc($current->mrealname) . " | \n";
- echo '' . ENTITY::hsc($current->murl) . " | \n";
- echo '' . ($current->madmin ? _YES : _NO) . " | \n";
- echo '' . ($current->mcanlogin ? _YES : _NO) . " | \n";
- echo '' . _LISTS_EDIT . " | \n";
- echo '' . _LISTS_DELETE . " | \n";
- break;
- }
- return;
-}
-
-function listplug_table_teamlist($template, $type)
-{
- global $manager;
- switch( $type )
- {
- case 'HEAD':
- echo "" . _LIST_MEMBER_NAME . " | \n";
- echo "" . _LIST_MEMBER_RNAME . " | \n";
- echo "" . _LIST_TEAM_ADMIN . " | \n";
- help('teamadmin');
- echo "\n";
- echo ""._LISTS_ACTIONS." | \n";
- break;
- case 'BODY':
- $current = $template['current'];
-
- echo '';
- $id = listplug_nextBatchId();
- echo "tmember}\" />\n";
- echo '\n";
- echo " | ";
- echo '', ENTITY::hsc($current->mrealname), " | \n";
- echo '', ($current->tadmin ? _YES : _NO) , " | \n";
- echo "tmember&blogid={$current->tblog}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . " | \n";
-
- $url = "index.php?action=teamchangeadmin&memberid={$current->tmember}&blogid={$current->tblog}";
- $url = $manager->addTicketToUrl($url);
- echo '' . _LIST_TEAM_CHADMIN . " | \n";
- break;
- }
- return;
-}
-
-function listplug_table_pluginlist($template, $type)
-{
- global $manager;
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_INFO . " | \n";
- echo '' . _LISTS_DESC . " | \n";
- echo '' . _LISTS_ACTIONS . " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
-
- $plug =& $manager->getPlugin($current->pfile);
- if ( $plug )
- {
- echo "\n";
- echo '' . ENTITY::hsc($plug->getName()) . "\n";
-
- echo "\n";
- if ( $plug->getAuthor() )
- {
- echo '- ' . _LIST_PLUGS_AUTHOR . "
\n";
- echo '- ' . ENTITY::hsc($plug->getAuthor()) , "
\n";
- }
-
- if ( $plug->getVersion() )
- {
- echo '- ' . _LIST_PLUGS_VER, "
\n";
- echo '- ' . ENTITY::hsc($plug->getVersion()) . "
\n";
- }
-
- if ( $plug->getURL() )
- {
- echo '- ' . _LIST_PLUGS_SITE . "
- \n";
- echo '
- ãªã³ã¯
' . "\n";
- }
- echo " \n";
- echo " | \n";
-
- echo "\n";
- echo "\n";
- echo '- ' . _LIST_PLUGS_DESC ."
\n";
- echo '- ' . ENTITY::hen($plug->getDescription()) ."
\n";
- if ( sizeof($plug->getEventList()) > 0 )
- {
- echo '- ' . _LIST_PLUGS_SUBS ."
\n";
- echo '- ' . ENTITY::hsc(implode(', ', $plug->getEventList())) ."
\n";
- }
-
- if ( sizeof($plug->getPluginDep()) > 0 )
- {
- echo '- ' . _LIST_PLUGS_DEP ."
\n";
- echo '- ' . ENTITY::hsc(implode(', ', $plug->getPluginDep())) ."
\n";
- }
-
- /* check dependency */
- $req = array();
- $res = sql_query('SELECT pfile FROM ' . sql_table('plugin'));
- while( $o = sql_fetch_object($res) )
- {
- $preq =& $manager->getPlugin($o->pfile);
- if ( $preq )
- {
- $depList = $preq->getPluginDep();
- foreach ( $depList as $depName )
- {
- if ( $current->pfile == $depName )
- {
- $req[] = $o->pfile;
- }
- }
- }
- }
-
- if ( count($req) > 0 )
- {
- echo '- ' . _LIST_PLUGS_DEPREQ . "
\n";
- echo '- ' . ENTITY::hsc(implode(', ', $req)) . "
\n";
- }
-
- /* check the database to see if it is up-to-date and notice the user if not */
- if ( !$plug->subscribtionListIsUptodate() )
- {
- echo '- ' . 'NOTICE:' . "
\n";
- echo '- ' . _LIST_PLUG_SUBS_NEEDUPDATE . "
\n";
- }
-
- echo " \n";
- echo " | \n";
- }
- else
- {
- echo '' . sprintf(_PLUGINFILE_COULDNT_BELOADED, ENTITY::hsc($current->pfile)) . " | \n";
- }
-
- echo "\n";
- echo "\n";
- echo " | \n";
- break;
- }
- return;
-}
-
-function listplug_table_plugoptionlist($template, $type)
-{
- global $manager;
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_INFO . " | \n";
- echo '' . _LISTS_VALUE . " | \n";
- break;
- case 'BODY':
- listplug_plugOptionRow($template['current']);
- break;
- case 'FOOT':
- echo "\n";
- echo '' . _PLUGS_SAVE . " | \n";
- echo "
\n";
- echo "\n";
- echo "" . _PLUGS_SAVE . " | \n";
- echo " | \n";
- echo "
\n";
- break;
- }
- return;
-}
-
-function listplug_plugOptionRow($current)
-{
- $varname = "plugoption[{$current['oid']}][{$current['contextid']}]";
-
- // retreive the optionmeta
- $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
-
- // only if it is not a hidden option write the controls to the page
- if ( in_array('access', $meta) && $meta['access'] == 'hidden' )
- {
- return;
- }
-
- if ( !$current['description'] )
- {
- echo '' , ENTITY::hsc($current['name']) . " | \n";
- }
- else
- {
- if ( !defined($current['description']) )
- {
- echo '' , ENTITY::hsc($current['description']) . " | \n";
- }
- else
- {
- echo '' , ENTITY::hsc(constant($current['description'])) . " | \n";
- }
- }
- echo "\n";
- switch($current['type'])
- {
- case 'yesno':
- ADMIN::input_yesno($varname, $current['value'], 0, 'yes', 'no');
- break;
- case 'password':
- echo '\n";
- break;
- case 'select':
- echo '\n";
-
- break;
- case 'textarea':
- //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
- if ( array_key_exists('access', $meta) && $meta['access'] == 'readonly' )
- {
- echo ' | \n";
-
- return;
-}
-
-function listplug_table_itemlist($template, $type)
-{
- $cssclass = '';
-
- switch( $type )
- {
- case 'HEAD':
- echo ""._LIST_ITEM_INFO." | \n";
- echo ""._LIST_ITEM_CONTENT." | \n";
- echo ""._LISTS_ACTIONS." | ";
- break;
- case 'BODY':
- $current = $template['current'];
- // string -> unix timestamp
- $current->itime = strtotime($current->itime);
-
- if ( $current->idraft == 1 )
- {
- $cssclass = " class='draft'";
- }
-
- // (can't use offset time since offsets might vary between blogs)
- if ( $current->itime > $template['now'] )
- {
- $cssclass = " class='future'";
- }
-
- echo "\n";
- echo "\n";
- echo '- ' . _LIST_ITEM_BLOG . "
\n";
- echo '- ' . ENTITY::hsc($current->bshortname) . "
\n";
- echo '- ' . _LIST_ITEM_CAT . "
\n";
- echo '- ' . ENTITY::hsc($current->cname) . "
\n";
- echo '- ' . _LIST_ITEM_AUTHOR . "
\n";
- echo '- ' . ENTITY::hsc($current->mname) . "
\n";
- echo '- ' . _LIST_ITEM_DATE . "
\n";
- echo '- ' . date("Y-m-d",$current->itime) . "
\n";
- echo '- ' . _LIST_ITEM_TIME . "
\n";
- echo '- ' . date("H:i",$current->itime) . "
\n";
- echo " \n";
- echo " | \n";
-
- $id = listplug_nextBatchId();
-
- echo "\n";
- echo "\n";
- echo "inumber}\" />\n";
- echo "\n";
- echo "\n";
-
- $current->ibody = strip_tags($current->ibody);
- $current->ibody = ENTITY::hsc(ENTITY::shorten($current->ibody, 300, '...'));
- echo "$current->ibody \n";
- echo " | \n";
-
- echo "\n";
- echo "\n";
- echo " | \n";
- break;
- }
- return;
-}
-
-// for batch operations: generates the index numbers for checkboxes
-function listplug_nextBatchId()
-{
- static $id = 0;
- return $id++;
-}
-
-function listplug_table_commentlist($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_INFO . " | \n";
- echo '' . _LIST_COMMENT . " | \n";
- echo '' . _LISTS_ACTIONS . " | ";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->ctime = strtotime($current->ctime); // string -> unix timestamp
-
- echo "\n";
- echo "\n";
- echo '- ' . date("Y-m-d@H:i",$current->ctime) . "
\n";
- if ( isset($current->mname) )
- {
- echo '- ' . ENTITY::hsc($current->mname) ,' ', _LIST_COMMENTS_MEMBER . "
\n";
- }
- else
- {
- echo '- ' . ENTITY::hsc($current->cuser) . "
\n";
- }
- if ( isset($current->cmail) && $current->cmail )
- {
- echo '- ' . ENTITY::hsc($current->cmail) . "
\n";
- }
- if ( isset($current->cemail) && $current->cemail )
- {
- echo '- ' . ENTITY::hsc($current->cemail) . "
\n";
- }
- echo " \n";
- echo " | \n";
-
- $id = listplug_nextBatchId();
-
- echo '';
- echo "cnumber}\" />\n";
- echo "';
- echo ' | ';
-
- echo '' . _LISTS_EDIT . " | \n";
- echo '' . _LISTS_DELETE . " | \n";
- if ( $template['canAddBan'] )
- {
- echo '' . _LIST_COMMENT_BANIP . " | \n";
- }
- break;
- }
- return;
-}
-
-function listplug_table_bloglist($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _NAME . " | \n";
- echo '' . _LISTS_ACTIONS . " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->bname = ENTITY::hsc($current->bname);
-
- echo "bnumber} shortname:{$current->bshortname}\">burl}\">{$current->bname} | \n";
- echo "bnumber}\" title=\"" . _BLOGLIST_TT_ADD ."\">" . _BLOGLIST_ADD . " | \n";
- echo "bnumber}\" title=\"". _BLOGLIST_TT_EDIT."\">". _BLOGLIST_EDIT." | \n";
- echo "bnumber}\" title=\"". _BLOGLIST_TT_COMMENTS."\">". _BLOGLIST_COMMENTS." | \n";
- echo "bnumber}\" title=\"". _BLOGLIST_TT_BMLET."\">". _BLOGLIST_BMLET . " | \n";
-
- if ( $current->tadmin == 1 )
- {
- echo "bnumber}\" title=\"" . _BLOGLIST_TT_SETTINGS . "\">" . _BLOGLIST_SETTINGS . " | \n";
- echo "bnumber}\" title=\"" . _BLOGLIST_TT_BANS . "\">" . _BLOGLIST_BANS . " | \n";
- }
-
- if ( $template['superadmin'] )
- {
- echo "bnumber}\" title=\"". _BLOGLIST_TT_DELETE."\">" ._BLOGLIST_DELETE. " | \n";
- }
- break;
- }
- return;
-}
-
-function listplug_table_shortblognames($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _EBLOG_SHORTNAME . " | \n";
- echo '' . _EBLOG_NAME. " | ";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->bshortname = ENTITY::hsc($current->bshortname);
- $current->bname = ENTITY::hsc($current->bname);
-
- echo "{$current->bshortname} | \n";
- echo "{$current->bname} | \n";
- break;
- }
- return;
-}
-
-function listplug_table_shortnames($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _NAME . " | \n";
- echo '' . _LISTS_DESC. " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->name = ENTITY::hsc($current->name);
- $current->description = ENTITY::hsc($current->description);
-
- echo "{$current->name} | \n";
- echo "{$current->description} | \n";
- break;
- }
- return;
-}
-
-
-function listplug_table_categorylist($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_NAME . " | ";
- echo '' . _LISTS_DESC." | \n";
- echo '' . _LISTS_ACTIONS . " | \n";
- break;
- case 'BODY':
- $id = listplug_nextBatchId();
-
- $current = $template['current'];
- $current->cname = ENTITY::hsc($current->cname);
- $current->cdesc = ENTITY::hsc($current->cdesc);
-
- echo "\n";
- echo "catid}\" />\n";
- echo "\n";
- echo ' | \n';
- echo "{$current->cdesc} | \n";
- echo "cblog}&catid={$current->catid}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_EDIT . " | \n";
- echo "cblog}&catid={$current->catid}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . " | \n";
- break;
- }
- return;
-}
-
-function listplug_table_templatelist($template, $type)
-{
- global $manager;
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_NAME . " | \n";
- echo '' . _LISTS_DESC . " | \n";
- echo '' . _LISTS_ACTIONS . " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->tdnumber = (integer) $current->tdnumber;
- $current->tdname = ENTITY::hsc($current->tdname);
- $current->tddesc = ENTITY::hsc($current->tddesc);
-
- $url = "index.php?action=templateclone&templateid={$current->tdnumber}";
- $url = ENTITY::hsc($manager->addTicketToUrl($url));
-
- echo "{$current->tdname} | \n";
- echo "{$current->tddesc} | \n";
- echo "\n";
- echo "tdnumber}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_EDIT . "\n";
- echo " | \n";
- echo "\n";
- echo "" . _LISTS_CLONE . "\n";
- echo " | \n";
- echo "\n";
- echo "tdnumber}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . "\n";
- echo " | \n";
- break;
- }
- return;
-}
-
-function listplug_table_skinlist($template, $type)
-{
- global $CONF, $DIR_SKINS, $manager;
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_NAME . " | \n";
- echo '' . _LISTS_DESC . " | \n";
- echo '' . _LISTS_ACTIONS . " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->sdnumber = (integer) $current->sdnumber;
- $current->sdname = ENTITY::hsc($current->sdname);
- $current->sdtype = ENTITY::hsc($current->sdtype);
-
- echo "\n";
-
- // use a special style for the default skin
- if ( $current->sdnumber == $CONF['BaseSkin'] )
- {
- echo '' . $current->sdname . "\n";
- }
- else
- {
- echo '' . $current->sdname . "\n";
- }
-
- echo "\n";
- echo '- ' . _LISTS_TYPE . "
\n";
- echo '- ' . $current->sdtype . "
\n";
-
- echo '- ' . _LIST_SKINS_INCMODE . "
\n";
-
- if ( $current->sdincmode == 'skindir' )
- {
- echo '- ' . _PARSER_INCMODE_SKINDIR . "
\n";
- }
- else
- {
- echo '- ' . _PARSER_INCMODE_NORMAL . "
\n";
- }
-
- if ( $current->sdincpref )
- {
- echo '- ' . _LIST_SKINS_INCPREFIX . "
\n";
- echo '- ' . ENTITY::hsc($current->sdincpref) . "
\n";
- }
- echo " \n";
-
- // add preview image when present
- if ( $current->sdincpref && @file_exists("{$DIR_SKINS}{$current->sdincpref}preview.png") )
- {
- echo "\n";
-
- $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
- $has_enlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');
- if ( $has_enlargement )
- {
- echo '\n";
- echo '\n";
- echo " \n";
- }
- else
- {
- echo ' \n";
- }
-
- if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
- {
- $url = $CONF['SkinsURL'] . ENTITY::hsc($current->sdincpref) . 'readme.html';
- $title = sprintf(_LIST_SKIN_README, $current->sdname);
- echo "" . _LIST_SKIN_README_TXT . "\n";
- }
-
- echo " \n";
- }
-
- echo " | \n";
-
- echo "\n";
- echo ' ' . ENTITY::hsc($current->sddesc) . " \n";
-
- /* show list of defined parts */
- $query = "SELECT stype FROM %s WHERE sdesc=%d ORDER BY stype";
- $query = sprintf($query, sql_table('skin'), $current->sdnumber);
- $r = sql_query($query);
-
- $types = array();
- while ( $o = sql_fetch_object($r) )
- {
- array_push($types, $o->stype);
- }
- if ( sizeof($types) > 0 )
- {
- $friendlyNames = SKIN::getFriendlyNames();
- for ( $i = 0; $i < sizeof($types); $i++ )
- {
- $type = $types[$i];
- if ( !in_array($type, array('index', 'item', 'archivelist', 'archive', 'search', 'error', 'member', 'imagepopup')) )
- {
- $article = 'skinpartspecial';
- }
- else
- {
- $article = "skinpart{$type}";
- }
- $types[$i] = "\n";
- $types[$i] .= helpHtml($article) . "\n";
- $types[$i] .= "sdnumber}&type={$type}\" tabindex=\"{$template['tabindex']}\">" . ENTITY::hsc($friendlyNames[$type]) . "\n";
- $types[$i] .= "\n";
- }
- echo _LIST_SKINS_DEFINED;
- echo '' . implode('', $types) . " \n";
- }
- echo " | ";
- echo "\n";
- echo "sdnumber}\n tabindex=\n{$template['tabindex']}>" . _LISTS_EDIT . "\n";
- echo " | \n";
-
- $url = "index.php?action=skinclone&skinid={$current->sdnumber}";
- $url = ENTITY::hsc($manager->addTicketToUrl($url));
- echo "\n";
- echo "" . _LISTS_CLONE . "\n";
- echo " | \n";
- echo "\n";
- echo "sdnumber}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . " | \n";
- break;
- }
- return;
-}
-
-function listplug_table_draftlist($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_BLOG . " | \n";
- echo '' . _LISTS_TITLE . " | \n";
- echo '' . _LISTS_ACTIONS . " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->bshortname = ENTITY::hsc($current->bshortname);
- $current->ititle = ENTITY::hsc(strip_tags($current->ititle));
-
- echo "{$current->bshortname} | \n";
- echo "{$current->ititle} | \n";
- echo "inumber}\">" . _LISTS_EDIT . " | \n";
- echo "inumber}\">" . _LISTS_DELETE . " | \n";
- break;
- }
- return;
-}
-
-function listplug_table_otherdraftlist($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_BLOG . " | \n";
- echo '' . _LISTS_TITLE . " | \n";
- echo '' . _LISTS_AUTHOR . " | \n";
- echo '' . _LISTS_ACTIONS . " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->bshortname = ENTITY::hsc($current->bshortname);
- $current->ititle = ENTITY::hsc(strip_tags($current->ititle));
- $current->mname = ENTITY::hsc($current->mname);
-
- echo "{$current->bshortname} | \n";
- echo "{$current->ititle} | \n";
- echo "{$current->mname} | \n";
- echo "inumber}\">" . _LISTS_EDIT . " | \n";
- echo "inumber}\">" . _LISTS_DELETE . " | \n";
- break;
- }
- return;
-}
-
-function listplug_table_actionlist($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LISTS_TIME . " | \n";
- echo '' . _LIST_ACTION_MSG . " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->timestamp = ENTITY::hsc($current->timestamp);
- $current->message = ENTITY::hsc($current->message);
-
- echo "{$current->timestamp} | \n";
- echo "{$current->message} | \n";
- break;
- }
- return;
-}
-
-function listplug_table_banlist($template, $type)
-{
- switch( $type )
- {
- case 'HEAD':
- echo '' . _LIST_BAN_IPRANGE . " | \n";
- echo '' . _LIST_BAN_REASON." | \n";
- echo '' . _LISTS_ACTIONS . " | \n";
- break;
- case 'BODY':
- $current = $template['current'];
- $current->blogid = (integer) $current->blogid;
- $current->iprange = ENTITY::hsc($current->iprange);
- $current->reason = ENTITY::hsc($current->reason);
-
- echo "{$current->iprange} | \n";
- echo "{$current->reason} | \n";
- echo "blogid}&iprange=\"ENTITY::hsc($current->iprange}\">" . _LISTS_DELETE . " | \n";
- break;
- }
- return;
-}
+closeCursor();
+ }
+
+ return $contents;
+}
+
+function listplug_select($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_HEAD']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_SELECT_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+
+ return Template::fill($template, $data);
+}
+
+function listplug_table($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_HEAD']) )
+ {
+ $template = "\n"
+ . "\n"
+ . "\n"
+ . "<%typehead%>\n"
+ . "
\n"
+ . "\n"
+ . "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_HEAD'];
+ }
+ $data = array(
+ 'summary' => $vars['content'],
+ 'typehead' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'HEAD', $template_name)
+ );
+ break;
+ case 'BODY':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BODY']) )
+ {
+ $template = "\n"
+ . "<%typebody%>\n"
+ . "
\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_BODY'];
+ }
+ // tabletype specific thingies
+ $data = array(
+ 'typebody' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'BODY', $template_name)
+ );
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_FOOT']) )
+ {
+ $template = "<%typefoot%>\n"
+ . "\n"
+ . "
\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_FOOT'];
+ }
+ // tabletype specific thingies
+ $data = array(
+ 'typefoot' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'FOOT', $template_name)
+ );
+ break;
+ }
+
+ return Template::fill($template, $data);
+}
+
+function listplug_table_memberlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD']) )
+ {
+ $template = "<%colmembername%> | \n"
+ . "<%colmemberrname%> | \n"
+ . "<%colmemberurl%> | \n"
+ . "<%colmemberadmin%><%helplink(superadmin)%> | \n"
+ . "<%colmemberlogin%><%helplink(canlogin)%> | \n"
+ . "<%colactions%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD'];
+ }
+ $data = array(
+ 'colmembername' => _LIST_MEMBER_NAME,
+ 'colmemberrname' => _LIST_MEMBER_RNAME,
+ 'colmemberurl' => _LIST_MEMBER_URL,
+ 'colmemberadmin' => _LIST_MEMBER_ADMIN,
+ 'colmemberlogin' => _LIST_MEMBER_LOGIN,
+ 'colactions' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY']) )
+ {
+ $template = "\n"
+ . "\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
+ . "\n | \n"
+ . "<%realname%> | \n"
+ . "\" tabindex=\"<%tabindex%>\"><%url%> | \n"
+ . "<%admin%> | \n"
+ . "<%login%> | \n"
+ . "\" tabindex=\"<%tabindex%>\"><%editbtn%> | \n"
+ . "\" tabindex=\"<%tabindex%>\"><%deletebtn%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY'];
+ }
+ $data = array(
+ 'id' => listplug_nextBatchId(),
+ 'memberid' => $current['mnumber'],
+ 'mailaddress' => Entity::hsc($current['memail']),
+ 'tabindex' => $vars['tabindex'],
+ 'name' => Entity::hsc($current['mname']),
+ 'realname' => Entity::hsc($current['mrealname']),
+ 'url' => Entity::hsc($current['murl']),
+ 'admin' => $current['madmin'] ? _YES : _NO,
+ 'login' => $current['mcanlogin'] ? _YES : _NO,
+ 'editbtn' => _LISTS_EDIT,
+ 'deletebtn' => _LISTS_DELETE,
+ );
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT']) )
+ {
+ $template = "";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_teamlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD']) )
+ {
+ $template = "<%colmembername%> | \n"
+ . "<%colmemberrname%> | \n"
+ . "<%colteamadmin%><%helplink(teamadmin)%> | \n"
+ . "<%colactions%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD'];
+ }
+ $data = array(
+ 'colmembername' => _LIST_MEMBER_NAME,
+ 'colmemberrname' => _LIST_MEMBER_RNAME,
+ 'colteamadmin' => _LIST_TEAM_ADMIN,
+ 'colactions' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY']) )
+ {
+ $template = "\n"
+ . "\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
+ . "\n | \n"
+ . "<%realname%> | \n"
+ . "<%admin%> | \n"
+ . "&blogid=<%blogid%>\" tabindex=\"<%tabindex%>\"><%deletebtn%> | \n"
+ . "\" tabindex=\"<%tabindex%>\"><%chadminbtn%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY'];
+ }
+ $url = 'index.php?action=teamchangeadmin&memberid=' . intval($current['tmember']) . '&blogid=' . intval($current['tblog']);
+ $url = $manager->addTicketToUrl($url);
+ $data = array(
+ 'id' => listplug_nextBatchId(),
+ 'memberid' => $current['tmember'],
+ 'mailaddress' => Entity::hsc($current['memail']),
+ 'tabindex' => $vars['tabindex'],
+ 'name' => Entity::hsc($current['mname']),
+ 'realname' => Entity::hsc($current['mrealname']),
+ 'admin' => ($current['tadmin'] ? _YES : _NO),
+ 'blogid' => $current['tblog'],
+ 'deletebtn' => '<%text(_LISTS_DELETE)%>',
+ 'chadminurl' => Entity::hsc($url),
+ 'chadminbtn' => '<%text(_LIST_TEAM_CHADMIN)%>'
+ );
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT']) )
+ {
+ $template = "";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_pluginlist($vars, $type, $template_name = '')
+{
+ static $plugins = array();
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD']) )
+ {
+ $template = "<%colinfo%> | \n"
+ . "<%coldesc%> | \n"
+ . "<%colactions%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD'];
+ }
+ $data = array(
+ 'colinfo' => _LISTS_INFO,
+ 'coldesc' => _LISTS_DESC,
+ 'colactions' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+
+ $plug =& $manager->getPlugin($current['pfile']);
+ if ( $plug )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) )
+ {
+ $template = "\n"
+ . "<%plugname%> \n"
+ . "<%autherlabel%> <%plugauther%> \n"
+ . "<%versionlabel%> <%plugversion%> \n"
+ . "<%pluggeturl%> \n"
+ . " | \n"
+ . "\n"
+ . "<%desclabel%> <%plugdesc%>\n"
+ . "<%eventlist%>\n"
+ . "<%needupdate%>\n"
+ . "<%dependlist%>\n"
+ . "<%depreqlist%>\n"
+ . " | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY'];
+ }
+ $data = array(
+ 'plugname' => Entity::hsc($plug->getName()),
+ 'autherlabel' => _LIST_PLUGS_AUTHOR,
+ 'plugauther' => Entity::hsc($plug->getAuthor()),
+ 'versionlabel' => _LIST_PLUGS_VER,
+ 'plugversion' => Entity::hsc($plug->getVersion()),
+ 'tabindex' => $vars['tabindex'],
+ 'desclabel' => _LIST_PLUGS_DESC,
+ 'plugdesc' => Entity::hen($plug->getDescription()),
+ );
+ if ( $plug->getURL() )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL']) )
+ {
+ $subTpl = "\" tabindex=\"<%tabindex%>\"><%plugsite%>";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL'];
+ }
+ $subData = array(
+ 'plugurl' => Entity::hsc($plug->getURL()),
+ 'tabindex' => $vars['tabindex'],
+ 'plugsite' => _LIST_PLUGS_SITE,
+ );
+ $data['pluggeturl'] = Template::fill($subTpl, $subData);
+ }
+ else
+ {
+ $data['pluggeturl'] = '';
+ }
+ if ( count($plug->getEventList()) > 0 )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST']) )
+ {
+ $subTpl = "
<%evntlstlbl%>
<%eventlist%>";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST'];
+ }
+ $subData = array(
+ 'evntlstlbl' => _LIST_PLUGS_SUBS,
+ 'eventlist' => Entity::hsc(implode(', ', $plug->getEventList())),
+ );
+ $data['eventlist'] = Template::fill($subTpl, $subData);
+ }
+ else
+ {
+ $data['eventlist'] = '';
+ }
+ if ( !$plug->subscribtionListIsUptodate() )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE']) )
+ {
+ $subTpl = "
<%updatealert%>";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE'];
+ }
+ $subData = array(
+ 'updatealert' => _LIST_PLUG_SUBS_NEEDUPDATE,
+ );
+ $data['needupdate'] = Template::fill($subTpl, $subData);
+ }
+ else
+ {
+ $data['needupdate'] = '';
+ }
+ if ( count($plug->getPluginDep() ) > 0)
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND']) )
+ {
+ $subTpl = "
<%deplistlbl%>
<%dependlist%>";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND'];
+ }
+ $subData = array(
+ 'deplistlbl' => _LIST_PLUGS_DEP,
+ 'dependlist' => Entity::hsc(implode(', ', $plug->getPluginDep())),
+ );
+ $data['dependlist'] = Template::fill($subTpl, $subData);
+ }
+ else
+ {
+ $data['dependlist'] = '';
+ }
+ /* check dependency */
+ if ( empty($plugins) )
+ {
+ $plugins = DB::getResult('SELECT pfile FROM ' . sql_table('plugin'));
+ }
+ $req = array();
+ foreach ( $plugins as $plugin )
+ {
+ $preq =& $manager->getPlugin($plugin['pfile']);
+ if ( $preq )
+ {
+ $depList = $preq->getPluginDep();
+ foreach ( $depList as $depName )
+ {
+ if ( $current['pfile'] == $depName )
+ {
+ $req[] = $plugin['pfile'];
+ }
+ }
+ }
+ }
+
+ if ( count($req) > 0 )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) )
+ {
+ $subTpl = "
<%deprlstlbl%>
<%depreqlist%>";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ'];
+ }
+ $subData = array(
+ 'deprlstlbl' => _LIST_PLUGS_DEPREQ,
+ 'depreqlist' => Entity::hsc(implode(', ', $req)),
+ );
+ $data['depreqlist'] = Template::fill($subTpl, $subData);
+ }
+ else
+ {
+ $data['depreqlist'] = '';
+ }
+ }
+ else
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE']) )
+ {
+ $template = "<%noplugalert%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE'];
+ }
+ $data = array(
+ 'noplugalert' => sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current['pfile'])),
+ );
+ }
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) )
+ {
+ $template .= "\n"
+ . "\" tabindex=\"<%tabindex%>\"><%actionuptxt%> \n"
+ . "\" tabindex=\"<%tabindex%>\"><%actiondowntxt%> \n"
+ . "\" tabindex=\"<%tabindex%>\"><%actuninsttxt%> "
+ . "<%plugadminurl%>\n"
+ . "<%plughelpurl%>\n"
+ . "<%plugoptsetting%>\n"
+ . " | \n";
+ }
+ else
+ {
+ $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN'];
+ }
+
+ $baseUrl = 'index.php?plugid=' . $current['pid'] . '&action=';
+ $upUrl = $manager->addTicketToUrl($baseUrl . 'pluginup');
+ $downUrl = $manager->addTicketToUrl($baseUrl . 'plugindown');
+
+ $data['actionuptxt'] = _LIST_PLUGS_UP;
+ $data['actionupurl'] = Entity::hsc($upUrl);
+ $data['actiondowntxt'] = _LIST_PLUGS_DOWN;
+ $data['actiondownurl'] = Entity::hsc($downUrl);
+ $data['actuninsttxt'] = _LIST_PLUGS_UNINSTALL;
+ $data['actuninsturl'] = 'index.php?action=plugindelete&plugid=' . $current['pid'];
+
+ if ( $plug && ($plug->hasAdminArea() > 0) )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN']) )
+ {
+ $subTpl = "\" tabindex=\"<%tabindex%>\"><%actadmintxt%>
\n";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN'];
+ }
+ $subData = array(
+ 'actadminurl' => Entity::hsc($plug->getAdminURL()),
+ 'tabindex' => $vars['tabindex'],
+ 'actadmintxt' => _LIST_PLUGS_ADMIN,
+ );
+ $data['plugadminurl'] = Template::fill($subTpl, $subData);
+ }
+ else
+ {
+ $data['plugadminurl'] = '';
+ }
+ if ( $plug && ($plug->supportsFeature('HelpPage') > 0) )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP']) )
+ {
+ $subTpl = "\" tabindex=\"<%tabindex%>\"><%acthelptxt%>
\n";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP'];
+ }
+ $subData = array(
+ 'acthelpurl' => 'index.php?action=pluginhelp&plugid=' . $current['pid'],
+ 'tabindex' => $vars['tabindex'],
+ 'acthelptxt' => _LIST_PLUGS_HELP,
+ );
+ $data['plughelpurl'] = Template::fill($subTpl, $subData);
+ }
+ else
+ {
+ $data['plughelpurl'] = '';
+ }
+ $optQuery = 'SELECT '
+ . ' COUNT(*) AS result '
+ . 'FROM '
+ . sql_table('plugin_option_desc') . ' '
+ . 'WHERE '
+ . ' ocontext = "global" '
+ . 'AND opid = %d';
+ $pOptions = DB::getValue(sprintf($optQuery, $current['pid']));
+ if ( $pOptions > 0 )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) )
+ {
+ $subTpl = "\" tabindex=\"<%tabindex%>\"><%actoptiontxt%>\n";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL'];
+ }
+ $subData = array(
+ 'actoptionurl' => 'index.php?action=pluginoptions&plugid=' . $current['pid'],
+ 'tabindex' => $vars['tabindex'],
+ 'actoptiontxt' => _LIST_PLUGS_OPTIONS,
+ );
+ $data['plugoptsetting'] = Template::fill($subTpl, $subData);
+ }
+ else
+ {
+ $data['plugoptsetting'] = '';
+ }
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT']) )
+ {
+ $template = "";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_plugoptionlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD']) )
+ {
+ $template = "<%colinfo%> | \n"
+ . "<%colvalue%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD'];
+ }
+ $data = array(
+ 'colinfo' => _LISTS_INFO,
+ 'colvalue' => _LISTS_VALUE,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ $template = listplug_plugOptionRow($current, $template_name);
+ $data = array();
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT']) )
+ {
+ $template = "\n"
+ . "<%savetext%> | \n"
+ . "
\n"
+ . "\n"
+ . "<%savetext%> | \n"
+ . "\" /> | \n"
+ . "
\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT'];
+ }
+ $data = array(
+ 'savetext' => _PLUGS_SAVE,
+ );
+ break;
+ }
+
+ return Template::fill($template, $data);
+}
+
+function listplug_plugOptionRow($current, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ $varname = "plugoption[{$current['oid']}][{$current['contextid']}]";
+
+ // retreive the optionmeta
+ $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
+
+ // only if it is not a hidden option write the controls to the page
+ if ( in_array('access', $meta) && $meta['access'] == 'hidden' )
+ {
+ return false;
+ }
+ else
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY']) )
+ {
+ $template = "<%description%> | \n"
+ . "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY'];
+ }
+
+ $data = array();
+
+ switch($current['type'])
+ {
+ case 'yesno':
+ $template .= listplug_input_yesno($varname, $current['value'], 0, 'yes', 'no', _YES, _NO, 0, $template_name, 1);
+ break;
+ case 'password':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) )
+ {
+ $template .= "\" value=\"<%value%>\" />\n";
+ }
+ else
+ {
+ $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD'];
+ }
+ $data = array(
+ 'varname' => Entity::hsc($varname),
+ 'value' => Entity::hsc($current['value']),
+ );
+ break;
+ case 'select':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP']) )
+ {
+ $template .= "\n";
+ }
+ else
+ {
+ $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC'];
+ }
+ $data['varname'] = Entity::hsc($varname);
+ break;
+ case 'textarea':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA']) )
+ {
+ $template .= "\n";
+ }
+ else
+ {
+ $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA'];
+ }
+ $data = array(
+ 'varname' => Entity::hsc($varname),
+ 'value' => Entity::hsc($current['value'])
+ );
+ if ( !array_key_exists('access', $current) || $current['access'] != 'readonly')
+ {
+ $data['readonly'] = '';
+ }
+ else
+ {
+ $data['readonly'] = ' readonly="readonly"';
+ }
+ break;
+ case 'text':
+ default:
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT']) )
+ {
+ $template .= "\" value=\"<%value%>\"<%datatype%><%readonly%> />\n";
+ }
+ else
+ {
+ $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT'];
+ }
+ $data = array(
+ 'varname' => Entity::hsc($varname),
+ 'value' => Entity::hsc($current['value'])
+ );
+ if ( !array_key_exists('datatype', $current) || $current['datatype'] != 'numerical')
+ {
+ $data['datatype'] = '';
+ }
+ else
+ {
+ $data['datatype'] = ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
+ }
+ if ( !array_key_exists('access', $current) || $current['access'] != 'readonly')
+ {
+ $data['readonly'] = '';
+ }
+ else
+ {
+ $data['readonly'] = ' readonly="readonly"';
+ }
+ }
+
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT']) )
+ {
+ $template .= "<%extra%> | \n";
+ }
+ else
+ {
+ $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT'];
+ }
+
+ if ( !array_key_exists('extra', $current) )
+ {
+ $data['extra'] = '';
+ }
+ else
+ {
+ $data['extra'] = Entity::hsc($current['extra']);
+ }
+
+ if ( !array_key_exists('description', $current) )
+ {
+ $data['description'] = Entity::hsc($current['name']);
+ }
+ else if ( !defined($current['description']) )
+ {
+ $data['description'] = Entity::hsc($current['description']);
+ }
+ else
+ {
+ $data['description'] = Entity::hsc(constant($current['description']));
+ }
+ }
+ return Template::fill($template, $data, 1);
+}
+
+/**
+ * listplug_templateEditRow()
+ *
+ * @param array $content content of target template
+ * @param string $desc description of target template
+ * @param string $name name of target template
+ * @param string $help help text
+ * @param integer $tabindex a number for tab index
+ * @param boolean $big large or small textarea
+ * @param array $template_name name of template for filling
+ * @return void
+ */
+function listplug_templateEditRow($content, $desc, $name, $help = '', $tabindex = 0, $big = 0, $template_name = '')
+{
+ global $manager;
+
+ static $count = 0;
+
+ $tmplt = array();
+ $base = array();
+
+ $templates = array();
+ if ( $template_name )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ $data = array(
+ 'description' => $desc,
+ 'help' => empty($help) ? '' : helpHtml('template' . $help),
+ 'count' => $count++,
+ 'name' => $name,
+ 'tabindex' => $tabindex,
+ 'rows' => $big ? 10 : 5,
+ );
+
+ $message = '';
+
+ /* row head */
+ if ( !array_key_exists('TEMPLATE_EDIT_ROW_HEAD', $templates) || empty($tmplt['TEMPLATE_EDIT_ROW_HEAD']) )
+ {
+ $template = ""
+ . "\n"
+ . "<%description%><%help%> | \n"
+ . "\">\n"
+ . "\n"
+ . " | \n";
+ }
+ else
+ {
+ $template = $tmplt['TEMPLATE_EDIT_ROW_TAIL'];
+ }
+ $message .= TEMPLATE::fill($template, $data);
+
+ return $message;
+}
+
+function listplug_table_itemlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $cssclass = '';
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) )
+ {
+ $template = "<%colinfo%> | \n"
+ . "<%colcontent%> | \n"
+ . "<%colaction%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD'];
+ }
+ $data = array(
+ 'colinfo' => _LIST_ITEM_INFO,
+ 'colcontent' => _LIST_ITEM_CONTENT,
+ 'colaction' => _LISTS_ACTIONS
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ // string -> unix timestamp
+ $current['itime'] = strtotime($current['itime']);
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) )
+ {
+ $template = ">\n"
+ . "<%bshortlabel%> <%bshortnameval%> \n"
+ . "<%categorylabel%> <%categorynameval%> \n"
+ . "<%authorlabel%> <%authornameval%> \n"
+ . "<%itemdatelabel%> <%itemdateval%> \n"
+ . "<%itemtimelabel%> <%itemtimeval%>\n"
+ . " | \n"
+ . ">\n"
+ . "\" name=\"batch[<%batchid%>]\" value=\"<%itemid%>\" />\n"
+ . " \n"
+ . "<%itembody%>\n"
+ . " | \n"
+ . ">\n"
+ . "\"><%editbtn%> \n"
+ . "\"><%movebtn%> \n"
+ . "\"><%delbtn%> \n"
+ . "<%camount%>\n"
+ . " | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY'];
+ }
+ $cssclass = '';
+
+ if ( $current['idraft'] == 1 )
+ {
+ $cssclass = ' class="draft"';
+ }
+
+ // (can't use offset time since offsets might vary between blogs)
+ if ( $current['itime'] > $vars['now'] )
+ {
+ $cssclass = ' class="future"';
+ }
+ $body = strip_tags($current['ibody']);
+ $data = array(
+ 'cssclass' => $cssclass,
+ 'bshortlabel' => _LIST_ITEM_BLOG,
+ 'bshortnameval' => Entity::hsc($current['bshortname']),
+ 'categorylabel' => _LIST_ITEM_CAT,
+ 'categorynameval' => Entity::hsc($current['cname']),
+ 'authorlabel' => _LIST_ITEM_AUTHOR,
+ 'authornameval' => Entity::hsc($current['mname']),
+ 'itemdatelabel' => _LIST_ITEM_DATE,
+ 'itemdateval' => date("Y-m-d",$current['itime']),
+ 'itemdatelabel' => _LIST_ITEM_TIME,
+ 'itemdateval' => date("H:i",$current['itime']),
+ 'batchid' => listplug_nextBatchId(),
+ 'itemid' => $current['inumber'],
+ 'itemtitle' => Entity::hsc(strip_tags($current['ititle'])),
+ 'itembody' => Entity::hsc(Entity::shorten($body, 300, '...')),
+ 'editbtn' => _LISTS_EDIT,
+ 'movebtn' => _LISTS_MOVE,
+ 'delbtn' => _LISTS_DELETE,
+ );
+ // evaluate amount of comments for the item
+ $comment = new Comments($current['inumber']);
+ $camount = $comment->amountComments();
+ if ( $camount > 0 )
+ {
+ $data['camount'] = "(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")
\n";
+ }
+ else
+ {
+ $data['camount'] = _LIST_ITEM_NOCONTENT . "
\n";
+ }
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+// for batch operations: generates the index numbers for checkboxes
+function listplug_nextBatchId()
+{
+ static $id = 0;
+ return $id++;
+}
+
+function listplug_table_commentlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD']) )
+ {
+ $template = "<%colinfo%> | \n"
+ . "<%colcontent%> | \n"
+ . "<%colaction%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD'];
+ }
+ $data = array(
+ 'colinfo' => _LISTS_INFO,
+ 'colcontent' => _LIST_COMMENT,
+ 'colaction' => _LISTS_ACTIONS
+ );
+ break;
+ case 'BODY':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) )
+ {
+ $template = "<%commentdate%> <%commentator%> <%commentsite%> <%commentmail%>
| \n"
+ . "\n"
+ . "\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />"
+ . "\n"
+ . " | \n"
+ . "\n"
+ . "\"><%editbtn%>\n"
+ . " | \n"
+ . "\n"
+ . "\"><%delbtn%>\n"
+ . " | \n"
+ . "<%addbanlist%>";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY'];
+ }
+ $current = $vars['current'];
+ $body = strip_tags($current['cbody']);
+ $data = array(
+ 'commentdate' => date("Y-m-d@H:i", strtotime($current['ctime'])),
+ 'batchid' => listplug_nextBatchId(),
+ 'commentid' => $current['cnumber'],
+ 'commentbody' => Entity::hsc(Entity::shorten($current['cbody'], 300, '...')),
+ 'editbtn' => _LISTS_EDIT,
+ 'delbtn' => _LISTS_DELETE,
+ );
+ if ( isset($current['mname']) )
+ {
+ $data['commentator'] = Entity::hsc($current['mname']) . ' ' . _LIST_COMMENTS_MEMBER;
+ }
+ else
+ {
+ $data['commentator'] = Entity::hsc($current['cuser']);
+ }
+ if ( isset($current['cmail']) && $current['cmail'] )
+ {
+ $data['commentsite'] = Entity::hsc($current['cmail']);
+ }
+ else
+ {
+ $data['commentsite'] = '';
+ }
+ if ( isset($current['cemail']) && $current['cemail'] )
+ {
+ $data['commentmail'] = Entity::hsc($current['cemail']);
+ }
+ else
+ {
+ $data['commentmail'] = '';
+ }
+ if ( $vars['canAddBan'] )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) )
+ {
+ $subTpl = ""
+ . "&ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%>"
+ . " | \n";
+ }
+ else
+ {
+ $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN'];
+ }
+ $subData = array(
+ 'itemid' => $current['citem'],
+ 'banip' => Entity::hsc($current['cip']),
+ 'banbtn' => _LIST_COMMENT_BANIP,
+ );
+ $data['addbanlist'] = Template::fill($subTpl, $subData);
+ }
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT']) )
+ {
+ $template = "";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_bloglist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD']) )
+ {
+ $template = "<%blognames%> | \n"
+ . "<%actionshead%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD'];
+ }
+ $data = array(
+ 'blognames' => _NAME,
+ 'actionshead' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY']) )
+ {
+ $template = " shortname:<%shortname%>\">\n"
+ . "\">\" /><%blogname%> | \n"
+ . "\" title=\"<%ttaddtext%>\"><%addtext%> | \n"
+ . "\" title=\"<%ttedittext%>\"><%edittext%> | \n"
+ . "\" title=\"<%ttcommenttext%>\"><%commenttext%> | \n"
+ . "\" title=\"<%ttbmlettext%>\"><%bmlettext%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY'];
+ }
+ $data = array(
+ 'blogid' => $current['bnumber'],
+ 'shortname' => Entity::hsc($current['bshortname']),
+ 'blogurl' => $current['burl'],
+ 'blogname' => Entity::hsc($current['bname']),
+ 'ttaddtext' => _BLOGLIST_TT_ADD,
+ 'addtext' => _BLOGLIST_ADD,
+ 'ttedittext' => _BLOGLIST_TT_EDIT,
+ 'edittext' => _BLOGLIST_EDIT,
+ 'ttcommenttext' => _BLOGLIST_TT_COMMENTS,
+ 'commenttext' => _BLOGLIST_COMMENTS,
+ 'ttbmlettext' => _BLOGLIST_TT_BMLET,
+ 'bmlettext' => _BLOGLIST_BMLET,
+ );
+ if ( $current['tadmin'] == 1 )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
+ {
+ $template .= "\" title=\"<%ttsettingtext%>\"><%settingtext%> | \n"
+ . "\" title=\"<%ttbanstext%>\"><%banstext%> | \n";
+ }
+ else
+ {
+ $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
+ }
+ $data['ttsettingtext'] = _BLOGLIST_TT_SETTINGS;
+ $data['settingtext'] = _BLOGLIST_SETTINGS;
+ $data['ttbanstext'] = _BLOGLIST_TT_BANS;
+ $data['banstext'] = _BLOGLIST_BANS;
+ }
+
+ if ( $vars['superadmin'] )
+ {
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_SADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
+ {
+ $template .= "\" title=\"<%ttdeletetext%>\"><%deletetext%> | \n";
+ }
+ else
+ {
+ $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_SADM'];
+ }
+ $data['ttdeletetext'] = _BLOGLIST_TT_DELETE;
+ $data['deletetext'] = _BLOGLIST_DELETE;
+ }
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_shortblognames($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD']) )
+ {
+ $template = "<%colshortname%> | \n"
+ . "<%colblogname%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD'];
+ }
+ $data = array(
+ 'colshortname' => _EBLOG_SHORTNAME,
+ 'colblogname' => _EBLOG_NAME,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']) )
+ {
+ $template = "<%bshortname%> | \n"
+ . "<%blogname%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY'];
+ }
+ $data = array(
+ 'bshortname' => Entity::hsc($current['bshortname']),
+ 'blogname' => Entity::hsc($current['bname']),
+ );
+ break;
+ case 'FOOT':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_shortnames($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD']) )
+ {
+ $template = "<%colname%> | \n"
+ . "<%coldesc%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD'];
+ }
+ $data = array(
+ 'colname' => _NAME,
+ 'coldesc' => _LISTS_DESC,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']) )
+ {
+ $template = "<%name%> | \n"
+ . "<%desc%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY'];
+ }
+ $data = array(
+ 'name' => Entity::hsc($current['name']),
+ 'desc' => Entity::hsc($current['description']),
+ );
+ break;
+ case 'FOOT':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_categorylist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD']) )
+ {
+ $template = "<%colname%> | \n"
+ . "<%coldesc%> | \n"
+ . "<%colact%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD'];
+ }
+ $data = array(
+ 'colname' => _LISTS_NAME,
+ 'coldesc' => _LISTS_DESC,
+ 'colact' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY']) )
+ {
+ $template = "\n"
+ . "\" name=\"batch[<%batchid%>]\" value=\"<%catid%>\" />\n"
+ . "\n"
+ . " | \n"
+ . "<%catdesc%> | \n"
+ . "&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%editbtn%> | \n"
+ . "&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%delbtn%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY'];
+ }
+
+ $data = array(
+ 'batchid' => listplug_nextBatchId(),
+ 'catid' => intval($current['catid']),
+ 'catname' => Entity::hsc($current['cname']),
+ 'catdesc' => Entity::hsc($current['cdesc']),
+ 'blogid' => intval($current['cblog']),
+ 'tabindex' => intval($vars['tabindex']),
+ 'editbtn' => _LISTS_EDIT,
+ 'delbtn' => _LISTS_DELETE,
+ );
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_templatelist($vars, $type, $template_name = '')
+{
+ global $manager, $CONF;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
+ {
+ $template = "<%colname%> | \n"
+ . "<%coldesc%> | \n"
+ . "<%colact%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
+ }
+ $data = array(
+ 'colname' => _LISTS_NAME,
+ 'coldesc' => _LISTS_DESC,
+ 'colact' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
+ {
+ $template = "<%templatename%> | \n"
+ . "<%templatedesc%> | \n"
+ . ""
+ . "\" tabindex=\"<%tabindex%>\"><%editbtn%>\n"
+ . " | \n"
+ . "\n"
+ . "\" tabindex=\"<%tabindex%>\"><%clonebtn%>\n"
+ . " | \n"
+ . "\n"
+ . "\" tabindex=\"<%tabindex%>\"><%delbtn%>\n"
+ . " | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
+ }
+
+ $data = array(
+ 'templatename' => Entity::hsc($current['tdname']),
+ 'templatedesc' => Entity::hsc($current['tddesc']),
+ 'templateid' => (integer) $current['tdnumber'],
+ 'tabindex' => (integer) $vars['tabindex'],
+
+ 'clonebtn' => _LISTS_CLONE,
+ 'cloneaction' => $vars['cloneaction'],
+ 'cloneurl' => "{$CONF['AdminURL']}index.php?action={$vars['cloneaction']}&templateid={$current['tdnumber']}",
+
+ 'delbtn' => _LISTS_DELETE,
+ 'deleteaction' => $vars['deleteaction'],
+ 'deleteurl' => "{$CONF['AdminURL']}index.php?action={$vars['deleteaction']}&templateid={$current['tdnumber']}",
+
+ 'editbtn' => _LISTS_EDIT,
+ 'editaction' => $vars['editaction'],
+ 'editurl' => "{$CONF['AdminURL']}index.php?action={$vars['editaction']}&templateid={$current['tdnumber']}"
+ );
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_skinlist($vars, $type, $template_name = '')
+{
+ global $CONF, $DIR_SKINS, $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
+ {
+ $template = "<%colname%> | \n"
+ . "<%coldesc%> | \n"
+ . "<%colact%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
+ }
+ $data = array(
+ 'colname' => _LISTS_NAME,
+ 'coldesc' => _LISTS_DESC,
+ 'colact' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
+ {
+ $template = "<%skinname%>
\n"
+ . "<%skintypelabel%> <%skintype%> \n"
+ . "<%incmodelabel%> <%incmode%> \n"
+ . "<%incpreflabel%> <%incpref%> \n"
+ . "<%skinthumb%>"
+ . "<%readme%> | \n"
+ . "<%skindesc%><%skinparts%> | \n"
+ . ""
+ . "\" tabindex=\"<%tabindex%>\"><%editbtn%>"
+ . " | \n"
+ . ""
+ . "\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
+ . " | \n"
+ . ""
+ . "\" tabindex=\"<%tabindex%>\"><%delbtn%>"
+ . " | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
+ }
+
+ $data = array(
+ 'tabindex' => $vars['tabindex']++,
+
+ 'skinid' => (integer) $current['sdnumber'],
+ 'skindesc' => Entity::hsc($current['sddesc']),
+
+ 'skintypelabel' => _LISTS_TYPE,
+ 'skintype' => Entity::hsc($current['sdtype']),
+
+ 'incmodelabel' => _LIST_SKINS_INCMODE,
+ 'incmode' => ($current['sdincmode'] == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
+
+ 'incpreflabel' => ($current['sdincpref']) ? _SKIN_INCLUDE_PREFIX : '',
+ 'incpref' => ($current['sdincpref']) ? Entity::hsc($current['sdincpref']) : '',
+
+ 'editbtn' => _LISTS_EDIT,
+ 'editaction' => $vars['editaction'],
+ 'editurl' => "{$CONF['AdminURL']}index.php?action={$vars['editaction']}&skinid={$current['sdnumber']}",
+
+ 'clonebtn' => _LISTS_CLONE,
+ 'cloneaction' => $vars['cloneaction'],
+ 'cloneurl' => "{$CONF['AdminURL']}index.php?action={$vars['cloneaction']}&skinid={$current['sdnumber']}",
+
+ 'delbtn' => _LISTS_DELETE,
+ 'deleteaction' => $vars['deleteaction'],
+ 'deleteurl' => "{$CONF['AdminURL']}index.php?action={$vars['deleteaction']}&skinid={$current['sdnumber']}"
+ );
+
+ if ( $current['sdnumber'] != $vars['default'] )
+ {
+ $data['skinname'] = Entity::hsc($current['sdname']);
+ }
+ else
+ {
+ $data['skinname'] = '' . Entity::hsc($current['sdname']) . '';
+ }
+
+ // add preview image when present
+ if ( $current['sdincpref'] && @file_exists("{$DIR_SKINS}{$current['sdincpref']}preview.png") )
+ {
+ $data['skinthumb'] = "\n";
+
+ $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current['sdname']);
+ $has_enlargement = @file_exists($DIR_SKINS . $current['sdincpref'] . 'preview-large.png');
+ if ( $has_enlargement )
+ {
+ $data['skinthumb'] .= '\n";
+ }
+ $data['skinthumb'] .= '\n";
+ if ( $has_enlargement )
+ {
+ $data['skinthumb'] .= "
\n";
+ }
+
+ if ( @file_exists("{$DIR_SKINS}{$current['sdincpref']}readme.html") )
+ {
+ $url = $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'readme.html';
+ $title = sprintf(_LIST_SKIN_README, $current['sdname']);
+ $data['readme'] = "" . _LIST_SKIN_README_TXT . "\n";
+ }
+ else
+ {
+ $data['readme'] ="";
+ }
+
+ $data['skinthumb'] .= "
\n";
+ }
+
+ $skin =& $manager->getSkin($current['sdnumber'], $vars['handler']);
+ $available_types = $skin->getAvailableTypes();
+
+ $data['skinparts'] = _LIST_SKINS_DEFINED
+ . "\n";
+ foreach ( $available_types as $type => $label )
+ {
+ if ( $label === FALSE )
+ {
+ $label = ucfirst($type);
+ $article = 'skinpartspecial';
+ }
+ else
+ {
+ $article = "skinpart{$type}";
+ }
+ $data['skinparts'] .= "- \n"
+ . helpHtml($article) . "\n"
+ . ""
+ . Entity::hsc($label)
+ . "\n"
+ . "
\n";
+ }
+ $data['skinparts'] .= "
\n";
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
+ {
+ $template = "";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_draftlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD']) )
+ {
+ $template = "<%colblog%> | \n"
+ . "<%coldesc%> | \n"
+ . "<%colact%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD'];
+ }
+ $data = array(
+ 'colblog' => _LISTS_BLOG,
+ 'coldesc' => _LISTS_TITLE,
+ 'colact' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY']) )
+ {
+ $template = "<%bshortname%> | \n"
+ . "<%ititle%> | \n"
+ . "\"><%editbtn%> | \n"
+ . "\"><%delbtn%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY'];
+ }
+ $data = array(
+ 'bshortname' => Entity::hsc($current['bshortname']),
+ 'ititle' => Entity::hsc(strip_tags($current['ititle'])),
+ 'itemid' => intval($current['inumber']),
+ 'editbtn' => _LISTS_EDIT,
+ 'delbtn' => _LISTS_DELETE,
+ );
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_otherdraftlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD']) )
+ {
+ $template = "<%colblog%> | \n"
+ . "<%coldesc%> | \n"
+ . "<%colautr%> | \n"
+ . "<%colact%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD'];
+ }
+ $data = array(
+ 'colblog' => _LISTS_BLOG,
+ 'coldesc' => _LISTS_TITLE,
+ 'colautr' => _LISTS_AUTHOR,
+ 'colact' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY']) )
+ {
+ $template = "<%bshortname%> | \n"
+ . "<%ititle%> | \n"
+ . "<%iauthor%> | \n"
+ . "\"><%editbtn%> | \n"
+ . "\"><%delbtn%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY'];
+ }
+ $data = array(
+ 'bshortname' => Entity::hsc($current['bshortname']),
+ 'ititle' => Entity::hsc(strip_tags($current['ititle'])),
+ 'iauthor' => Entity::hsc(strip_tags($current['mname'])),
+ 'itemid' => intval($current['inumber']),
+ 'editbtn' => _LISTS_EDIT,
+ 'delbtn' => _LISTS_DELETE,
+ );
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_actionlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD']) )
+ {
+ $template = "<%coltime%> | \n"
+ . "<%colmesg%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD'];
+ }
+ $data = array(
+ 'coltime' => _LISTS_TIME,
+ 'colmesg' => _LIST_ACTION_MSG,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']) )
+ {
+ $template = "<%timestamp%> | \n"
+ . "<%message%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY'];
+ }
+ $data = array(
+ 'timestamp' => Entity::hsc($current['timestamp']),
+ 'message' => Entity::hsc($current['message']),
+ );
+ break;
+ case 'FOOT':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+function listplug_table_banlist($vars, $type, $template_name = '')
+{
+ global $manager;
+
+ $templates = array();
+ if ( !empty($template_name) )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD']) )
+ {
+ $template = "<%iprange%> | \n"
+ . "<%reason%> | \n"
+ . "<%colact%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD'];
+ }
+ $data = array(
+ 'iprange' => _LIST_BAN_IPRANGE,
+ 'reason' => _LIST_BAN_REASON,
+ 'colact' => _LISTS_ACTIONS,
+ );
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']) )
+ {
+ $template = "<%iprange%> | \n"
+ . "<%reason%> | \n"
+ . "&iprange=<%iprange%>\"><%delbtn%> | \n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY'];
+ }
+ $data = array(
+ 'iprange' => Entity::hsc($current['iprange']),
+ 'reason' => Entity::hsc($current['reason']),
+ 'blogid' => intval($current['blogid']),
+ 'delbtn' => _LISTS_DELETE,
+ );
+ break;
+ case 'FOOT':
+ $current = $vars['current'];
+ if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT'];
+ }
+ $data = array();
+ break;
+ }
+ return Template::fill($template, $data);
+}
+
+/**
+ * listplug_list_normalskinlist()
+ *
+ * @param array $vars array for variables
+ * @param string $type HEAD/BODY/FOOT
+ * @param string $template_name name of template
+ * @return string marked-up string
+ */
+function listplug_list_normalskinlist($vars, $type, $template_name = '')
+{
+ global $manager, $CONF;
+
+ /* available variables as a default */
+ $data = array(
+ 'skinid' => (integer) $vars['skinid'],
+ 'skinname' => Entity::hsc($vars['skinname']),
+ );
+
+ $templates = array();
+ if ( $template_name )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch ( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('NORMALSKINLIST_HEAD', $templates) || empty($templates['NORMALSKINLIST_HEAD']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['NORMALSKINLIST_HEAD'];
+ }
+
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('NORMALSKINLIST_BODY', $templates) || empty($templates['NORMALSKINLIST_BODY']) )
+ {
+ $template = "- "
+ . "\" tabindex=\"<%tabindex%>\"><%skintypename%>"
+ . " <%help%>"
+ . "
\n";
+ }
+ else
+ {
+ $template = $templates['NORMALSKINLIST_BODY'];
+ }
+
+ $data['tabindex'] = $vars['tabindex']++;
+ $data['skintype'] = $current['skintype'];
+ $data['skintypename'] = $current['skintypename'];
+ $data['editaction'] = $vars['editaction'];
+ $data['editurl'] = "{$CONF['AdminURL']}?action={$vars['editaction']}&skinid={$vars['skinid']}&type={$current['skintype']}";
+ /* TODO: removeaction? */
+ /* TODO: customHelpHtml("skinpart{$skintype}-{$template_name}") */
+ $data['help'] = '';
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('NORMALSKINLIST_FOOT', $templates) || empty($templates['NORMALSKINLIST_FOOT']) )
+ {
+ $template = "
\n";
+ }
+ else
+ {
+ $template = $templates['NORMALSKINLIST_FOOT'];
+ }
+
+ break;
+ }
+
+ return Template::fill($template, $data);
+}
+
+/**
+ * listplug_list_specialskinlist()
+ *
+ * @param array $vars array for variables
+ * @param string $type HEAD/BODY/FOOT
+ * @param string $template_name name of template
+ * @return string marked-up string
+ */
+function listplug_list_specialskinlist($vars, $type, $template_name = '')
+{
+ global $manager, $CONF;
+
+ /* available variables as a default */
+ $data = array(
+ 'skinid' => (integer) $vars['skinid'],
+ 'skinname' => Entity::hsc($vars['skinname']),
+ );
+
+ /* retrieve templates */
+ $templates = array();
+ if ( $template_name )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ switch ( $type )
+ {
+ case 'HEAD':
+ if ( !array_key_exists('SPECIALSKINLIST_HEAD', $templates) || empty($templates['SPECIALSKINLIST_HEAD']) )
+ {
+ $template = "\n";
+ }
+ else
+ {
+ $template = $templates['SPECIALSKINLIST_HEAD'];
+ }
+ break;
+ case 'BODY':
+ $current = $vars['current'];
+ if ( !array_key_exists('SPECIALSKINLIST_BODY', $templates) || empty($templates['SPECIALSKINLIST_BODY']) )
+ {
+ $template = "- "
+ . "\" tabindex=\"<%tabindex%>\">"
+ . "<%skintype%>"
+ . ""
+ . " ("
+ . "\" tabindex=\"<%tabindex%>\" >"
+ . "<%text(_LISTS_DELETE)%>"
+ . ""
+ . ")"
+ . "
\n";
+ }
+ else
+ {
+ $template = $templates['SPECIALSKINLIST_BODY'];
+ }
+
+ $data['tabindex'] = (integer) $vars['tabindex']++;
+ $data['skintype'] = Entity::hsc($current['skintype']);
+ $data['skintypename'] = Entity::hsc($current['skintypename']);
+ $data['editaction'] = $vars['editaction'];
+ $data['editurl'] = "{$CONF['AdminURL']}?action={$vars['editaction']}&skinid={$vars['skinid']}&type={$current['skintype']}";
+ $data['removeaction'] = $vars['editaction'];
+ $data['removeurl'] = "{$CONF['AdminURL']}?action={$vars['removeaction']}&skinid={$vars['skinid']}&type={$current['skintype']}";
+
+ break;
+ case 'FOOT':
+ if ( !array_key_exists('SPECIALSKINLIST_FOOT', $templates) || empty($templates['SPECIALSKINLIST_FOOT']) )
+ {
+ $template = "
\n";
+ }
+ else
+ {
+ $template = $templates['SPECIALSKINLIST_FOOT'];
+ }
+ break;
+ }
+
+ return Template::fill($template, $data);
+}
+
+/**
+ * listplug_input_yesno()
+ *
+ * @param string $name name of input element with radio type attribute
+ * @param string $checkedval value which should be checked
+ * @param integer $tabindex tabindex number
+ * @param string $value1 value of radio 1
+ * @param string $value2 value of radio 2
+ * @param string $yesval label for yes
+ * @param string $noval label for no
+ * @param boolean $isAdmin super admin or not
+ * @param string $template_name name of template
+ * @param boolean $showlist used in showlist or not
+ * @return string marked-up string
+ */
+function listplug_input_yesno($name, $checkedval, $tabindex = 0,
+ $value1 = 1, $value2 = 0, $yesval = _YES, $noval = _NO,
+ $isAdmin = 0, $template_name = '', $showlist = FALSE)
+{
+ global $manager;
+
+ $templates = array();
+ if ( $template_name )
+ {
+ $templates =& $manager->getTemplate($template_name);
+ }
+
+ if ( $name == 'admin' )
+ {
+ if ( !array_key_exists('INPUTYESNO_TEMPLATE_ADMIN', $templates) || empty($templates['INPUTYESNO_TEMPLATE_ADMIN']) )
+ {
+ $template = "\" name=\"<%name%>\" value=\"<%yesval%>\" <%yescheckedval%> onclick=\"selectCanLogin(true);\" />\n"
+ . "\n"
+ . "\" name=\"<%name%>\" value=\"<%noval%>\" <%nocheckedval%> <%disabled%> onclick=\"selectCanLogin(false);\" />\n"
+ . "\n";
+ }
+ else
+ {
+ $template = $templates['INPUTYESNO_TEMPLATE_ADMIN'];
+ }
+ }
+ else
+ {
+ if ( array_key_exists('INPUTYESNO_TEMPLATE_NORMAL', $templates) && !empty($templates['INPUTYESNO_TEMPLATE_NORMAL']) )
+ {
+ $template = $templates['INPUTYESNO_TEMPLATE_NORMAL'];
+ }
+ else if ( $showlist && array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO', $templates) && !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO']) )
+ {
+ $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO'];
+ }
+ else
+ {
+ $template = "\" name=\"<%name%>\" value=\"<%yesval%>\" <%yescheckedval%> />\n"
+ . "\n"
+ . "\" name=\"<%name%>\" value=\"<%noval%>\" <%nocheckedval%> <%disabled%> />\n"
+ . "\n";
+ }
+ }
+
+ $id = preg_replace('#[|]#', '-', $name);
+ $id1 = $id . $value1;
+ $id2 = $id . $value2;
+ $dat = array(
+ 'name' => Entity::hsc($name),
+ 'yesval' => Entity::hsc($value1),
+ 'noval' => Entity::hsc($value2),
+ 'yesid' => Entity::hsc($id1),
+ 'noid' => Entity::hsc($id2),
+ 'yesvaltext' => $yesval,
+ 'novaltext' => $noval,
+ 'yescheckedval' => ($checkedval == $value1) ? 'checked="checked" tabindex="' . $tabindex . '"': '',
+ 'nocheckedval' => ($checkedval != $value1) ? 'checked="checked" tabindex="' . $tabindex . '"': '',
+ 'disabled' => ($isAdmin && $name == 'canlogin') ? ' disabled="disabled"' : '',
+ );
+
+ return Template::fill($template, $dat);
+}
+
+/**
+ * listplug_batchlist()
+ *
+ * @param string $attr item/member/team/category/comment
+ * @param resource $query SQL resorce
+ * @param string $type type for showlist()
+ * @param array $vars array for variables
+ */
+function listplug_batchlist($attr, $query, $type, $vars, $template_name)
+{
+ global $manager;
+
+ /* HEAD */
+ $content = "\n";
+
+ return $content;
+}
+
+/**
+ * listplug_navlist()
+ *
+ * @param string $attr item/member/team/category/comment
+ * @param resource $query SQL resorce
+ * @param string $type type for showlist()
+ * @param array $vars array for variables
+ * @param string $template_name name of template
+ * @return string contents
+ */
+function listplug_navlist($attribute, $query, $type, $vars, $template_name)
+{
+ global $CONF;
+
+ $prev = $vars['start'] - $vars['amount'];
+ if ( $prev < $vars['minamount'] )
+ {
+ $prev = $vars['minamount'];
+ }
+
+ $next = $vars['start'] + $vars['amount'];
+
+ $navi = "\n";
+ $navi .= "\n";
+
+ /* HEAD */
+ $template = $navi;
+
+ /* BODY */
+ $template .= listplug_batchlist($attribute, $query, $type, $vars, $template_name);
+
+ /* FOOT */
+ $template .= $navi;
+
+ return $template;
+}