X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=nucleus%2Flibs%2Fshowlist.php;h=31e36654af252b4dd597ecc6a1a0a0595803d936;hb=587960ec5d94e0b15b0697e68a0226e151785fd4;hp=98f239255aa17396fc396b8a0c9bc796a6f9b58d;hpb=9924a1e3759b055d246c2bee04f7a0f7883cd6e4;p=nucleus-jp%2Fnucleus-next.git diff --git a/nucleus/libs/showlist.php b/nucleus/libs/showlist.php index 98f2392..31e3665 100644 --- a/nucleus/libs/showlist.php +++ b/nucleus/libs/showlist.php @@ -19,61 +19,50 @@ // can take either an array of objects, or an SQL query -function showlist($query, $type, $vars, $templateName = '') +function showlist($query, $type, $vars, $template_name = '') { - if ( is_array($query) ) + $contents = ''; + + /* count */ + if ( is_string($query) ) { - if ( sizeof($query) == 0 ) - { - return 0; - } - - call_user_func("listplug_{$type}", $vars, 'HEAD', $templateName); - - foreach ( $query as $currentObj ) - { - $vars['current'] = $currentObj; - call_user_func("listplug_{$type}", $vars, 'BODY', $templateName); - } - - call_user_func("listplug_{$type}", $vars, 'FOOT', $templateName); - - return sizeof($query); + $resource = DB::getResult($query); } else { - $res = DB::getResult($query); - - // don't do anything if there are no results - $numrows = $res->rowCount(); - if ( $numrows == 0 ) - { - return 0; - } - call_user_func("listplug_{$type}", $vars, 'HEAD', $templateName); - - while( $vars['current'] = $res->fetchObject() ) - { - call_user_func("listplug_{$type}", $vars, 'BODY', $templateName); - } - - call_user_func("listplug_{$type}", $vars, 'FOOT', $templateName); - - $res->closeCursor(); - - // return amount of results - return $numrows; + $resource = $query; } + + /* HEAD */ + $contents .= call_user_func("listplug_{$type}", $vars, 'HEAD', $template_name); + + /* BODY */ + foreach ( $resource as $row ) + { + $vars['current'] = $row; + $contents .= call_user_func("listplug_{$type}", $vars, 'BODY', $template_name); + } + + /* FOOT */ + $contents .= call_user_func("listplug_{$type}", $vars, 'FOOT', $template_name); + + /* close SQL resource */ + if ( is_string($query) ) + { + $resource->closeCursor(); + } + + return $contents; } -function listplug_select($vars, $type, $templateName = '') +function listplug_select($vars, $type, $template_name = '') { - global $DIR_LIBS, $manager; + global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -81,7 +70,7 @@ function listplug_select($vars, $type, $templateName = '') case 'HEAD': if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_HEAD']) ) { - $template = "<%tabindex%><%javascript%>>\n" + $template = "\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($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -990,7 +1030,7 @@ function listplug_table_itemlist($vars, $type, $templateName = '') case 'BODY': $current = $vars['current']; // string -> unix timestamp - $current->itime = strtotime($current->itime); + $current['itime'] = strtotime($current['itime']); if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) ) { $template = ">\n" @@ -1000,14 +1040,16 @@ function listplug_table_itemlist($vars, $type, $templateName = '') . "<%itemdatelabel%> <%itemdateval%>
\n" . "<%itemtimelabel%> <%itemtimeval%>\n" . "\n" - . "\" name=\"batch[<%batchid%>]\" value=\"<%itemid%>\" />\n" + . ">\n" + . "\" name=\"batch[<%batchid%>]\" value=\"<%itemid%>\" />\n" . "
\n" . "<%itembody%>\n" - . "" + . "\n" + . ">\n" . "\"><%editbtn%>
\n" - . "<%camount%>\n" . "\"><%movebtn%>
\n" . "\"><%delbtn%>
\n" + . "<%camount%>\n" . "\n"; } else @@ -1015,48 +1057,48 @@ function listplug_table_itemlist($vars, $type, $templateName = '') $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']; } $cssclass = ''; - - if ( $current->idraft == 1 ) + + if ( $current['idraft'] == 1 ) { $cssclass = ' class="draft"'; } // (can't use offset time since offsets might vary between blogs) - if ( $current->itime > $vars['now'] ) + if ( $current['itime'] > $vars['now'] ) { $cssclass = ' class="future"'; } - $body = strip_tags($current->ibody); + $body = strip_tags($current['ibody']); $data = array( 'cssclass' => $cssclass, 'bshortlabel' => _LIST_ITEM_BLOG, - 'bshortnameval' => Entity::hsc($current->bshortname), + 'bshortnameval' => Entity::hsc($current['bshortname']), 'categorylabel' => _LIST_ITEM_CAT, - 'categorynameval' => Entity::hsc($current->cname), + 'categorynameval' => Entity::hsc($current['cname']), 'authorlabel' => _LIST_ITEM_AUTHOR, - 'authornameval' => Entity::hsc($current->mname), + 'authornameval' => Entity::hsc($current['mname']), 'itemdatelabel' => _LIST_ITEM_DATE, - 'itemdateval' => date("Y-m-d",$current->itime), + 'itemdateval' => date("Y-m-d",$current['itime']), 'itemdatelabel' => _LIST_ITEM_TIME, - 'itemdateval' => date("H:i",$current->itime), + 'itemdateval' => date("H:i",$current['itime']), 'batchid' => listplug_nextBatchId(), - 'itemid' => $current->inumber, - 'itemtitle' => Entity::hsc(strip_tags($current->ititle)), + '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); + $comment = new Comments($current['inumber']); $camount = $comment->amountComments(); if ( $camount > 0 ) { - $data['camount'] = "inumber}\">(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")
\n"; + $data['camount'] = "(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")
\n"; } else { - $data['camount'] = _LIST_ITEM_NOCONTENT . "\n"; + $data['camount'] = _LIST_ITEM_NOCONTENT . "
\n"; } break; case 'FOOT': @@ -1081,14 +1123,14 @@ function listplug_nextBatchId() return $id++; } -function listplug_table_commentlist($vars, $type, $templateName = '') +function listplug_table_commentlist($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1114,12 +1156,16 @@ function listplug_table_commentlist($vars, $type, $templateName = '') if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) ) { $template = "<%commentdate%>
<%commentator%>
<%commentsite%>
<%commentmail%>
\n" - . "\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />" - . "\n" - . "" - . "\"><%editbtn%>\n" - . "" - . "\"><%delbtn%>\n" + . "\n" + . "\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />" + . "\n" + . "\n" + . "\n" + . "\"><%editbtn%>\n" + . "\n" + . "\n" + . "\"><%delbtn%>\n" + . "\n" . "<%addbanlist%>"; } else @@ -1127,34 +1173,34 @@ function listplug_table_commentlist($vars, $type, $templateName = '') $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']; } $current = $vars['current']; - $body = strip_tags($current->cbody); + $body = strip_tags($current['cbody']); $data = array( - 'commentdate' => date("Y-m-d@H:i", strtotime($current->ctime)), + 'commentdate' => date("Y-m-d@H:i", strtotime($current['ctime'])), 'batchid' => listplug_nextBatchId(), - 'commentid' => $current->cnumber, - 'commentbody' => Entity::hsc(Entity::shorten($current->cbody, 300, '...')), + 'commentid' => $current['cnumber'], + 'commentbody' => Entity::hsc(Entity::shorten($current['cbody'], 300, '...')), 'editbtn' => _LISTS_EDIT, 'delbtn' => _LISTS_DELETE, ); - if ( isset($current->mname) ) + if ( isset($current['mname']) ) { - $data['commentator'] = Entity::hsc($current->mname) . ' ' . _LIST_COMMENTS_MEMBER; + $data['commentator'] = Entity::hsc($current['mname']) . ' ' . _LIST_COMMENTS_MEMBER; } else { - $data['commentator'] = Entity::hsc($current->cuser); + $data['commentator'] = Entity::hsc($current['cuser']); } - if ( isset($current->cmail) && $current->cmail ) + if ( isset($current['cmail']) && $current['cmail'] ) { - $data['commentsite'] = Entity::hsc($current->cmail); + $data['commentsite'] = Entity::hsc($current['cmail']); } else { $data['commentsite'] = ''; } - if ( isset($current->cemail) && $current->cemail ) + if ( isset($current['cemail']) && $current['cemail'] ) { - $data['commentmail'] = Entity::hsc($current->cemail); + $data['commentmail'] = Entity::hsc($current['cemail']); } else { @@ -1164,15 +1210,17 @@ function listplug_table_commentlist($vars, $type, $templateName = '') { if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) ) { - $subTpl = "&ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%>\n"; + $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), + 'itemid' => $current['citem'], + 'banip' => Entity::hsc($current['cip']), 'banbtn' => _LIST_COMMENT_BANIP, ); $data['addbanlist'] = Template::fill($subTpl, $subData); @@ -1193,14 +1241,14 @@ function listplug_table_commentlist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_bloglist($vars, $type, $templateName = '') +function listplug_table_bloglist($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1236,10 +1284,10 @@ function listplug_table_bloglist($vars, $type, $templateName = '') $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), + '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, @@ -1249,12 +1297,12 @@ function listplug_table_bloglist($vars, $type, $templateName = '') 'ttbmlettext' => _BLOGLIST_TT_BMLET, 'bmlettext' => _BLOGLIST_BMLET, ); - if ( $current->tadmin == 1 ) + 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"; + . "\" title=\"<%ttbanstext%>\"><%banstext%>\n"; } else { @@ -1281,7 +1329,6 @@ function listplug_table_bloglist($vars, $type, $templateName = '') } break; case 'FOOT': - $current = $vars['current']; if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) ) { $template = "\n"; @@ -1296,14 +1343,14 @@ function listplug_table_bloglist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_shortblognames($vars, $type, $templateName = '') +function listplug_table_shortblognames($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1335,8 +1382,8 @@ function listplug_table_shortblognames($vars, $type, $templateName = '') $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']; } $data = array( - 'bshortname' => Entity::hsc($current->bshortname), - 'blogname' => Entity::hsc($current->bname), + 'bshortname' => Entity::hsc($current['bshortname']), + 'blogname' => Entity::hsc($current['bname']), ); break; case 'FOOT': @@ -1355,14 +1402,14 @@ function listplug_table_shortblognames($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_shortnames($vars, $type, $templateName = '') +function listplug_table_shortnames($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1394,8 +1441,8 @@ function listplug_table_shortnames($vars, $type, $templateName = '') $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']; } $data = array( - 'name' => Entity::hsc($current->name), - 'desc' => Entity::hsc($current->description), + 'name' => Entity::hsc($current['name']), + 'desc' => Entity::hsc($current['description']), ); break; case 'FOOT': @@ -1414,14 +1461,14 @@ function listplug_table_shortnames($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_categorylist($vars, $type, $templateName = '') +function listplug_table_categorylist($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1462,10 +1509,10 @@ function listplug_table_categorylist($vars, $type, $templateName = '') $data = array( 'batchid' => listplug_nextBatchId(), - 'catid' => intval($current->catid), - 'catname' => Entity::hsc($current->cname), - 'catdesc' => Entity::hsc($current->cdesc), - 'blogid' => intval($current->cblog), + '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, @@ -1486,14 +1533,14 @@ function listplug_table_categorylist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_templatelist($vars, $type, $templateName = '') +function listplug_table_templatelist($vars, $type, $template_name = '') { global $manager, $CONF; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1536,22 +1583,23 @@ function listplug_table_templatelist($vars, $type, $templateName = '') $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']; } - $deleteurl = $CONF['AdminURL'] . "index.php?action=templatedelete&templateid={$current->tdnumber}"; - $editurl = $CONF['AdminURL'] . "index.php?action=templateedit&templateid={$current->tdnumber}"; - $cloneurl = $CONF['AdminURL'] . "index.php?action=templateclone&templateid={$current->tdnumber}"; - $url = "index.php?action=templateclone&templateid={$current->tdnumber}"; $data = array( - 'templatename' => Entity::hsc($current->tdname), - 'templatedesc' => Entity::hsc($current->tddesc), - 'templateid' => (integer) $current->tdnumber, + 'templatename' => Entity::hsc($current['tdname']), + 'templatedesc' => Entity::hsc($current['tddesc']), + 'templateid' => (integer) $current['tdnumber'], 'tabindex' => (integer) $vars['tabindex'], - 'deleteurl' => Entity::hsc($manager->addTicketToUrl($deleteurl)), - 'editurl' => Entity::hsc($manager->addTicketToUrl($editurl)), - 'cloneurl' => Entity::hsc($manager->addTicketToUrl($cloneurl)), - 'editbtn' => _LISTS_EDIT, + 'clonebtn' => _LISTS_CLONE, + 'cloneaction' => $vars['cloneaction'], + 'cloneurl' => "{$CONF['AdminURL']}index.php?action={$vars['cloneaction']}&templateid={$current['tdnumber']}", + 'delbtn' => _LISTS_DELETE, - 'adminflg' => '', + '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': @@ -1569,14 +1617,14 @@ function listplug_table_templatelist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_skinlist($vars, $type, $templateName = '') +function listplug_table_skinlist($vars, $type, $template_name = '') { global $CONF, $DIR_SKINS, $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1610,68 +1658,78 @@ function listplug_table_skinlist($vars, $type, $templateName = '') . "<%readme%>\n" . "<%skindesc%><%skinparts%>\n" . "" - . "\" tabindex=\"<%tabindex%>\"><%editbtn%>" - . "\n" + . "\" tabindex=\"<%tabindex%>\"><%editbtn%>" + . "\n" . "" - . "\" tabindex=\"<%tabindex%>\"><%clonebtn%>" - . "\n" + . "\" tabindex=\"<%tabindex%>\"><%clonebtn%>" + . "\n" . "" - . "\" tabindex=\"<%tabindex%>\"><%delbtn%>" - . "\n"; + . "\" tabindex=\"<%tabindex%>\"><%delbtn%>" + . "\n"; } else { $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']; } - $url = $manager->addTicketToUrl('index.php?action=skinclone&skinid=' . intval($current->sdnumber)); $data = array( + 'tabindex' => $vars['tabindex']++, + + 'skinid' => (integer) $current['sdnumber'], + 'skindesc' => Entity::hsc($current['sddesc']), + 'skintypelabel' => _LISTS_TYPE, - 'skintype' => Entity::hsc($current->sdtype), + 'skintype' => Entity::hsc($current['sdtype']), + 'incmodelabel' => _LIST_SKINS_INCMODE, - 'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL, - 'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '', - 'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '', - 'skindesc' => Entity::hsc($current->sddesc), - 'skinid' => (integer) $current->sdnumber, - 'tabindex' => $vars['tabindex'], - 'cloneurl' => Entity::hsc($url), + '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']}" ); - // use a special style for the default skin - if ( $current->sdnumber != $CONF['BaseSkin'] ) + if ( $current['sdnumber'] != $vars['default'] ) { - $data['skinname'] = Entity::hsc($current->sdname); + $data['skinname'] = Entity::hsc($current['sdname']); } else { - $data['skinname'] = '' . Entity::hsc($current->sdname) . ''; + $data['skinname'] = '' . Entity::hsc($current['sdname']) . ''; } // add preview image when present - if ( $current->sdincpref && @file_exists("{$DIR_SKINS}{$current->sdincpref}preview.png") ) + 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'); + $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"; } - $data['skinthumb'] .= '' . $alternatve_text . \n"; + $data['skinthumb'] .= '' . $alternatve_text . \n"; if ( $has_enlargement ) { $data['skinthumb'] .= "
\n"; } - if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") ) + 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); + $url = $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'readme.html'; + $title = sprintf(_LIST_SKIN_README, $current['sdname']); $data['readme'] = "" . _LIST_SKIN_README_TXT . "\n"; } else @@ -1682,16 +1740,16 @@ function listplug_table_skinlist($vars, $type, $templateName = '') $data['skinthumb'] .= "

\n"; } - $skin = new Skin($current->sdnumber); - $available_skin_types = $skin->getAvailableTypes(); + $skin =& $manager->getSkin($current['sdnumber'], $vars['handler']); + $available_types = $skin->getAvailableTypes(); - $data['skinparts'] = _LIST_SKINS_DEFINED; - $data['skinparts'] .= "
    \n"; - foreach ( $available_skin_types as $type => $friendlyName ) + $data['skinparts'] = _LIST_SKINS_DEFINED + . "
      \n"; + foreach ( $available_types as $type => $label ) { - if ( $friendlyName === FALSE ) + if ( $label === FALSE ) { - $friendlyName = ucfirst($type); + $label = ucfirst($type); $article = 'skinpartspecial'; } else @@ -1700,8 +1758,8 @@ function listplug_table_skinlist($vars, $type, $templateName = '') } $data['skinparts'] .= "
    • \n" . helpHtml($article) . "\n" - . "sdnumber}&type={$type}\" tabindex=\"{$vars['tabindex']}\">" - . Entity::hsc($friendlyName) + . "" + . Entity::hsc($label) . "\n" . "
    • \n"; } @@ -1722,14 +1780,14 @@ function listplug_table_skinlist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_draftlist($vars, $type, $templateName = '') +function listplug_table_draftlist($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) { @@ -1764,9 +1822,9 @@ function listplug_table_draftlist($vars, $type, $templateName = '') $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), + 'bshortname' => Entity::hsc($current['bshortname']), + 'ititle' => Entity::hsc(strip_tags($current['ititle'])), + 'itemid' => intval($current['inumber']), 'editbtn' => _LISTS_EDIT, 'delbtn' => _LISTS_DELETE, ); @@ -1786,14 +1844,14 @@ function listplug_table_draftlist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_otherdraftlist($vars, $type, $templateName = '') +function listplug_table_otherdraftlist($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1832,10 +1890,10 @@ function listplug_table_otherdraftlist($vars, $type, $templateName = '') $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), + '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, ); @@ -1855,14 +1913,14 @@ function listplug_table_otherdraftlist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_actionlist($vars, $type, $templateName = '') +function listplug_table_actionlist($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1894,8 +1952,8 @@ function listplug_table_actionlist($vars, $type, $templateName = '') $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']; } $data = array( - 'timestamp' => Entity::hsc($current->timestamp), - 'message' => Entity::hsc($current->message), + 'timestamp' => Entity::hsc($current['timestamp']), + 'message' => Entity::hsc($current['message']), ); break; case 'FOOT': @@ -1914,14 +1972,14 @@ function listplug_table_actionlist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_banlist($vars, $type, $templateName = '') +function listplug_table_banlist($vars, $type, $template_name = '') { global $manager; $templates = array(); - if ( !empty($templateName) ) + if ( !empty($template_name) ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } switch( $type ) @@ -1956,9 +2014,9 @@ function listplug_table_banlist($vars, $type, $templateName = '') $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']; } $data = array( - 'iprange' => Entity::hsc($current->iprange), - 'reason' => Entity::hsc($current->reason), - 'blogid' => intval($current->blogid), + 'iprange' => Entity::hsc($current['iprange']), + 'reason' => Entity::hsc($current['reason']), + 'blogid' => intval($current['blogid']), 'delbtn' => _LISTS_DELETE, ); break; @@ -1978,238 +2036,411 @@ function listplug_table_banlist($vars, $type, $templateName = '') return Template::fill($template, $data); } -function listplug_table_adminskinlist($vars, $type, $templateName = '') +/** + * 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 $CONF, $DIR_SKINS, $DIR_NUCLEUS, $manager; + global $manager, $CONF; - $adminSkinURL = $CONF['SkinsURL'] . 'admin/'; - $adminSkinDir = $DIR_SKINS . 'admin/'; + /* available variables as a default */ + $data = array( + 'skinid' => (integer) $vars['skinid'], + 'skinname' => Entity::hsc($vars['skinname']), + ); $templates = array(); - if ( !empty($templateName) ) + if ( $template_name ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } - switch( $type ) + + switch ( $type ) { case 'HEAD': - if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) ) + if ( !array_key_exists('NORMALSKINLIST_HEAD', $templates) || empty($templates['NORMALSKINLIST_HEAD']) ) { - $template = "<%colname%>\n" - . "<%coldesc%>\n" - . "<%colact%>\n"; + $template = "
        \n"; } else { - $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']; + $template = $templates['NORMALSKINLIST_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']; - } - - $url = $manager->addTicketToUrl('index.php?action=adminskinclone&skinid=' . intval($current->sdnumber)); - $data = array( - '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) ? _LIST_SKINS_INCMODE : '', - 'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '', - 'skindesc' => Entity::hsc($current->sddesc), - 'skinid' => (integer) $current->sdnumber, - 'tabindex' => $vars['tabindex'], - 'cloneurl' => Entity::hsc($url), - 'editbtn' => _LISTS_EDIT, - 'clonebtn' => _LISTS_CLONE, - 'delbtn' => _LISTS_DELETE, - ); - - // use a special style for the default skin - if ( $current->sdnumber != $CONF['AdminSkin'] ) + if ( !array_key_exists('NORMALSKINLIST_BODY', $templates) || empty($templates['NORMALSKINLIST_BODY']) ) { - $data['skinname'] = Entity::hsc($current->sdname); + $template = "
      • " + . "\" tabindex=\"<%tabindex%>\"><%skintypename%>" + . " <%help%>" + . "
      • \n"; } else { - $data['skinname'] = '' . Entity::hsc($current->sdname) . ''; + $template = $templates['NORMALSKINLIST_BODY']; } - // add preview image when present - if ( $current->sdincpref && @file_exists("{$adminSkinDir}{$current->sdincpref}preview.png") ) - { - $data['skinthumb'] = "

        \n"; - - $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname); - $has_enlargement = @file_exists($adminSkinDir . $current->sdincpref . 'preview-large.png'); - if ( $has_enlargement ) - { - $data['skinthumb'] .= '\n"; - } - $data['skinthumb'] .= '' . $alternatve_text . \n"; - if ( $has_enlargement ) - { - $data['skinthumb'] .= "
        \n"; - } - - if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") ) - { - $url = $adminSkinURL . 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 = new Skin($current->sdnumber, 'AdminActions'); - $available_skin_types = $skin->getAvailableTypes(); - - $data['skinparts'] = _LIST_SKINS_DEFINED; - $data['skinparts'] .= "\n"; + $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('SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) ) + if ( !array_key_exists('NORMALSKINLIST_FOOT', $templates) || empty($templates['NORMALSKINLIST_FOOT']) ) { - $template = ""; + $template = "
      \n"; } else { - $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']; + $template = $templates['NORMALSKINLIST_FOOT']; } - $data = array(); + break; } + return Template::fill($template, $data); } -function listplug_table_admintemplatelist($vars, $type, $templateName = '') +/** + * 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 ( !empty($templateName) ) + if ( $template_name ) { - $templates =& $manager->getTemplate($templateName); + $templates =& $manager->getTemplate($template_name); } - switch( $type ) + switch ( $type ) { case 'HEAD': - if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) ) + if ( !array_key_exists('SPECIALSKINLIST_HEAD', $templates) || empty($templates['SPECIALSKINLIST_HEAD']) ) { - $template = "<%colname%>\n" - . "<%coldesc%>\n" - . "<%colact%>\n"; + $template = "
        \n"; } else { - $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']; + $template = $templates['SPECIALSKINLIST_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']) ) + if ( !array_key_exists('SPECIALSKINLIST_BODY', $templates) || empty($templates['SPECIALSKINLIST_BODY']) ) { - $template = "<%templatename%>\n" - . "<%templatedesc%>\n" - . "" - . "\" tabindex=\"<%tabindex%>\"><%editbtn%>\n" - . "\n" - . "\n" - . "\" tabindex=\"<%tabindex%>\"><%clonebtn%>\n" - . "\n" - . "\n" - . "\" tabindex=\"<%tabindex%>\"><%delbtn%>\n" - . "\n"; + $template = "
      • " + . "\" tabindex=\"<%tabindex%>\">" + . "<%skintype%>" + . "" + . " (" + . "\" tabindex=\"<%tabindex%>\" >" + . "<%text(_LISTS_DELETE)%>" + . "" + . ")" + . "
      • \n"; } else { - $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']; + $template = $templates['SPECIALSKINLIST_BODY']; } - $deleteurl = $CONF['AdminURL'] . "index.php?action=admintemplatedelete&templateid={$current->tdnumber}"; - $editurl = $CONF['AdminURL'] . "index.php?action=admintemplateedit&templateid={$current->tdnumber}"; - $cloneurl = $CONF['AdminURL'] . "index.php?action=admintemplateclone&templateid={$current->tdnumber}"; - $data = array( - 'templatename' => Entity::hsc($current->tdname), - 'templatedesc' => Entity::hsc($current->tddesc), - 'templateid' => (integer) $current->tdnumber, - 'tabindex' => (integer) $vars['tabindex'], - 'deleteurl' => Entity::hsc($manager->addTicketToUrl($deleteurl)), - 'editurl' => Entity::hsc($manager->addTicketToUrl($editurl)), - 'cloneurl' => Entity::hsc($manager->addTicketToUrl($cloneurl)), - 'editbtn' => _LISTS_EDIT, - 'clonebtn' => _LISTS_CLONE, - 'delbtn' => _LISTS_DELETE, - 'adminflg' => 'admin', - ); + + $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('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) ) + if ( !array_key_exists('SPECIALSKINLIST_FOOT', $templates) || empty($templates['SPECIALSKINLIST_FOOT']) ) { - $template = "\n"; + $template = "
      \n"; } else { - $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']; + $template = $templates['SPECIALSKINLIST_FOOT']; } - $data = array(); 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"; + + /* BODY */ + $content .= showlist($query, $type, $vars, $template_name); + + /* FOOT */ + switch ( $attr ) + { + case 'item': + $options = array( + 'delete' => _BATCH_ITEM_DELETE, + 'move' => _BATCH_ITEM_MOVE + ); + break; + case 'member': + $options = array( + 'delete' => _BATCH_MEMBER_DELETE, + 'setadmin' => _BATCH_MEMBER_SET_ADM, + 'unsetadmin' => _BATCH_MEMBER_UNSET_ADM + ); + break; + case 'team': + $options = array( + 'delete' => _BATCH_TEAM_DELETE, + 'setadmin' => _BATCH_TEAM_SET_ADM, + 'unsetadmin' => _BATCH_TEAM_UNSET_ADM, + ); + break; + case 'category': + $options = array( + 'delete' => _BATCH_CAT_DELETE, + 'move' => _BATCH_CAT_MOVE, + ); + break; + case 'comment': + $options = array( + 'delete' => _BATCH_COMMENT_DELETE, + ); + break; + default: + $options = array(); + break; + } + + $content .= "

      \n" + . _BATCH_WITH_SEL + . "\n"; + + if ( $attr == 'team' ) + { + $content .= ''; + } + else if ( $attr == 'comment' ) + { + $content .= ''; + } + + $content .= '' + . "(" + . "" . _BATCH_SELECTALL . "" + . " - " + . "" . _BATCH_DESELECTALL . "" + . ")\n" + . "\n" + . '' . "\n" + . "

      \n" + . "
      \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" + . "\n"; + $navi .= "\n"; + $navi .= "\n"; + $navi .= "\n"; + $navi .= "\n"; + $navi .= "\n" + . "
      \n" + . "
      \n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "
      \n" + . "
      \n" + . "
      \n" + . "\n" + . _LISTS_PERPAGE + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "
      \n" + . "
      \n" + . "
      \n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "
      \n" + . "
      \n" + . "
      \n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "
      \n" + . "
      \n"; + + /* HEAD */ + $template = $navi; + + /* BODY */ + $template .= listplug_batchlist($attribute, $query, $type, $vars, $template_name); + + /* FOOT */ + $template .= $navi; + + return $template; +}