3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2009 The Nucleus Group
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * (see nucleus/documentation/index.html#license for more info)
13 * Functions to create lists of things inside the admin are
15 * @license http://nucleuscms.org/license.txt GNU General Public License
16 * @copyright Copyright (C) 2002-2009 The Nucleus Group
18 * @version $Id: showlist.php 1785 2012-04-22 11:25:14Z sakamocchi $
20 * @version $Id: showlist.php 1886 2012-06-17 08:27:27Z sakamocchi $
21 >>>>>>> skinnable-master
25 // can take either an array of objects, or an SQL query
27 function showlist($query, $type, $template)
29 if ( is_array($query) )
31 if ( sizeof($query) == 0 )
36 call_user_func("listplug_{$type}", $template, 'HEAD');
38 foreach ( $query as $currentObj )
40 $template['current'] = $currentObj;
41 call_user_func("listplug_{$type}", $template, 'BODY');
44 call_user_func("listplug_{$type}", $template, 'FOOT');
46 return sizeof($query);
50 $res = DB::getResult($query);
52 // don't do anything if there are no results
53 $numrows = $res->rowCount();
58 call_user_func("listplug_{$type}", $template, 'HEAD');
60 foreach ( $res as $row )
62 $template['current'] = $row;
63 call_user_func("listplug_{$type}", $template, 'BODY');
66 call_user_func("listplug_{$type}", $template, 'FOOT');
70 // return amount of results
75 function listplug_select($template, $type)
80 echo "<select name=\"{$template['name']}\" tabindex=\"{$template['tabindex']}\"";
81 if ( array_key_exists('javascript', $template) && !empty($template['javascript']) )
83 echo " {$template['javascript']}";
87 // add extra row if needed
88 if ( array_key_exists('extra', $template) && !empty($template['extra']) )
90 echo "<option value=\"{$template['extraval']}\">{$template['extra']}</option>\n";
95 $current = $template['current'];
97 echo '<option value="' . Entity::hsc($current['value']) . '"';
98 if ( array_key_exists('selected', $template) && $template['selected'] == $current['value'] )
100 echo ' selected="selected" ';
102 if ( isset($template['shorten']) && $template['shorten'] > 0 )
104 echo ' title="'. Entity::hsc($current['text']).'"';
105 $current['text'] = Entity::hsc(Entity::shorten($current['text'], $template['shorten'], $template['shortenel']));
107 echo '>' . Entity::hsc($current['text']) . "</option>\n";
116 function listplug_table($template, $type)
122 echo "<table frame=\"box\" rules=\"all\" summary=\"{$template['content']}\">\n";
126 call_user_func("listplug_table_{$template['content']}" , $template, 'HEAD');
132 // print tabletype specific thingies
134 call_user_func("listplug_table_{$template['content']}" , $template, 'BODY');
138 call_user_func("listplug_table_{$template['content']}" , $template, 'FOOT');
147 function listplug_table_memberlist($template, $type)
152 echo '<th>' . _LIST_MEMBER_NAME . "</th>\n";
153 echo '<th>' . _LIST_MEMBER_RNAME . "</th>\n";
154 echo '<th>' . _LIST_MEMBER_URL . "</th>\n";
155 echo '<th>' . _LIST_MEMBER_ADMIN;
158 echo '<th>' . _LIST_MEMBER_LOGIN;
161 echo '<th colspan="2">' . _LISTS_ACTIONS. "</th>\n";
164 $current = $template['current'];
166 $id = listplug_nextBatchId();
167 echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}]\" value=\"{$current['mnumber']}\" />\n";
168 echo "<label for=\"batch{$id}\">\n";
169 echo '<a href="mailto:' . Entity::hsc($current['memail']) . '" tabindex="' . $template['tabindex'] . '">' . Entity::hsc($current['mname']), "</a>\n";
172 echo "<td>" . Entity::hsc($current['mrealname']) . "</td>\n";
173 echo '<td><a href="' . Entity::hsc($current['murl']) . '" tabindex="' . $template['tabindex'] . '">' . Entity::hsc($current['murl']) . "</a></td>\n";
174 echo '<td>' . ($current['madmin'] ? _YES : _NO) . "</td>\n";
175 echo '<td>' . ($current['mcanlogin'] ? _YES : _NO) . "</td>\n";
176 echo '<td><a href="index.php?action=memberedit&memberid=' . $current['mnumber'] . '" tabindex="' . $template['tabindex'] . '">' . _LISTS_EDIT . "</a></td>\n";
177 echo '<td><a href="index.php?action=memberdelete&memberid=' . $current['mnumber'] . '" tabindex="' . $template['tabindex'].'">' . _LISTS_DELETE . "</a></td>\n";
183 function listplug_table_teamlist($template, $type)
189 echo "<th>" . _LIST_MEMBER_NAME . "</th>\n";
190 echo "<th>" . _LIST_MEMBER_RNAME . "</th>\n";
191 echo "<th>" . _LIST_TEAM_ADMIN;
194 echo "<th colspan=\"2\">"._LISTS_ACTIONS."</th>\n";
197 $current = $template['current'];
200 $id = listplug_nextBatchId();
201 echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}]\" value=\"{$current['tmember']}\" />\n";
202 echo '<label for="batch',$id,'">';
203 echo '<a href="mailto:' . Entity::hsc($current['memail']) . '" tabindex="' . $template['tabindex'] . '">' . Entity::hsc($current['mname']), "</a>\n";
206 echo '<td>', Entity::hsc($current['mrealname']), "</td>\n";
207 echo '<td>', ($current['tadmin'] ? _YES : _NO) , "</td>\n";
208 echo '<td><a href="index.php?action=teamdelete&memberid=' . $current['tmember'] . '&blogid=' . $current['tblog'] . '" tabindex="' . $template['tabindex'] . '">' . _LISTS_DELETE . "</a></td>\n";
210 $url = "index.php?action=teamchangeadmin&memberid={$current['tmember']}&blogid={$current['tblog']}";
211 $url = $manager->addTicketToUrl($url);
212 echo '<td><a href="' . Entity::hsc($url) . '" tabindex="' . $template['tabindex'] . '">' . _LIST_TEAM_CHADMIN . "</a></td>\n";
218 function listplug_table_pluginlist($template, $type)
224 echo '<th>' . _LISTS_INFO . "</th>\n";
225 echo '<th>' . _LISTS_DESC . "</th>\n";
226 echo '<th>' . _LISTS_ACTIONS . "</th>\n";
229 $current = $template['current'];
231 function showlist($query, $type, $vars, $template_name = '')
236 if ( is_string($query) )
238 $resource = DB::getResult($query);
246 $contents .= call_user_func("listplug_{$type}", $vars, 'HEAD', $template_name);
249 foreach ( $resource as $row )
251 $vars['current'] = $row;
252 $contents .= call_user_func("listplug_{$type}", $vars, 'BODY', $template_name);
256 $contents .= call_user_func("listplug_{$type}", $vars, 'FOOT', $template_name);
258 /* close SQL resource */
259 if ( is_string($query) )
261 $resource->closeCursor();
267 function listplug_select($vars, $type, $template_name = '')
271 $templates = array();
272 if ( !empty($template_name) )
274 $templates =& $manager->getTemplate($template_name);
280 if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_HEAD']) )
282 $template = "<select name=\"<%name%>\" tabindex=\"<%tabindex%>\" <%javascript%>>\n"
283 . "<%extraoption%>\n";
287 $template = $templates['SHOWLIST_LISTPLUG_SELECT_HEAD'];
290 'name' => $vars['name'],
291 'tabindex' => $vars['tabindex'],
292 'javascript' => !array_key_exists('javascript', $vars) ? '' : $vars['javascript'],
293 'extraoption' => !array_key_exists('extra', $vars) ? '' : "<option value=\"\">{$vars['extra']}</option>"
297 $current = $vars['current'];
298 if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_BODY']) )
300 $template = "<option value=\"<%value%>\" <%selected%> title=\"<%title%>\"><%option%></option>\n";
304 $template = $templates['SHOWLIST_LISTPLUG_SELECT_BODY'];
307 'value' => Entity::hsc($current['value']),
308 'selected' => ($vars['selected'] == $current['value']) ? 'selected="selected"' : '',
310 if ( array_key_exists('shorten', $vars) && $vars['shorten'] > 0 )
312 $data['title'] = Entity::hsc($current['text']);
313 $data['option'] = Entity::hsc(Entity::shorten($current['text'], $vars['shorten'], $vars['shortenel']));
319 $data['option'] = Entity::hsc($current['text']);
322 if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_FOOT']) )
324 $template = "</select>\n";
328 $template = $templates['SHOWLIST_LISTPLUG_SELECT_FOOT'];
334 return Template::fill($template, $data);
337 function listplug_table($vars, $type, $template_name = '')
341 $templates = array();
342 if ( !empty($template_name) )
344 $templates =& $manager->getTemplate($template_name);
350 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_HEAD']) )
352 $template = "<table frame=\"box\" rules=\"all\" summary=\"{$vars['content']}\">\n"
362 $template = $templates['SHOWLIST_LISTPLUG_TABLE_HEAD'];
365 'summary' => $vars['content'],
366 'typehead' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'HEAD', $template_name)
370 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BODY']) )
372 $template = "<tr onmouseover=\"focusRow(this);\" onmouseout=\"blurRow(this);\">\n"
378 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BODY'];
380 // tabletype specific thingies
382 'typebody' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'BODY', $template_name)
386 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_FOOT']) )
388 $template = "<%typefoot%>\n"
394 $template = $templates['SHOWLIST_LISTPLUG_TABLE_FOOT'];
396 // tabletype specific thingies
398 'typefoot' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'FOOT', $template_name)
403 return Template::fill($template, $data);
406 function listplug_table_memberlist($vars, $type, $template_name = '')
410 $templates = array();
411 if ( !empty($template_name) )
413 $templates =& $manager->getTemplate($template_name);
419 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD']) )
421 $template = "<th><%colmembername%></th>\n"
422 . "<th><%colmemberrname%></th>\n"
423 . "<th><%colmemberurl%></th>\n"
424 . "<th><%colmemberadmin%><%helplink(superadmin)%></th>\n"
425 . "<th><%colmemberlogin%><%helplink(canlogin)%></th>\n"
426 . "<th colspan=\"2\"><%colactions%></th>\n";
430 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD'];
433 'colmembername' => _LIST_MEMBER_NAME,
434 'colmemberrname' => _LIST_MEMBER_RNAME,
435 'colmemberurl' => _LIST_MEMBER_URL,
436 'colmemberadmin' => _LIST_MEMBER_ADMIN,
437 'colmemberlogin' => _LIST_MEMBER_LOGIN,
438 'colactions' => _LISTS_ACTIONS,
442 $current = $vars['current'];
443 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY']) )
446 . "<input type=\"checkbox\" id=\"batch<%id%>\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
447 . "<label for=\"batch<%id%>\">\n"
448 . "<a href=\"mailto:<%mailaddress%>\" tabindex=\"<%tabindex%>\"><%name%></a>\n"
449 . "</label>\n</td>\n"
450 . "<td><%realname%></td>\n"
451 . "<td><a href=\"<%url%>\" tabindex=\"<%tabindex%>\"><%url%></a></td>\n"
452 . "<td><%admin%></td>\n"
453 . "<td><%login%></td>\n"
454 . "<td><a href=\"index.php?action=memberedit&memberid=<%memberid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a></td>\n"
455 . "<td><a href=\"index.php?action=memberdelete&memberid=<%memberid%>\" tabindex=\"<%tabindex%>\"><%deletebtn%></a></td>\n";
459 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY'];
462 'id' => listplug_nextBatchId(),
463 'memberid' => $current['mnumber'],
464 'mailaddress' => Entity::hsc($current['memail']),
465 'tabindex' => $vars['tabindex'],
466 'name' => Entity::hsc($current['mname']),
467 'realname' => Entity::hsc($current['mrealname']),
468 'url' => Entity::hsc($current['murl']),
469 'admin' => $current['madmin'] ? _YES : _NO,
470 'login' => $current['mcanlogin'] ? _YES : _NO,
471 'editbtn' => _LISTS_EDIT,
472 'deletebtn' => _LISTS_DELETE,
476 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT']) )
482 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT'];
487 return Template::fill($template, $data);
490 function listplug_table_teamlist($vars, $type, $template_name = '')
494 $templates = array();
495 if ( !empty($template_name) )
497 $templates =& $manager->getTemplate($template_name);
503 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD']) )
505 $template = "<th><%colmembername%></th>\n"
506 . "<th><%colmemberrname%></th>\n"
507 . "<th><%colteamadmin%><%helplink(teamadmin)%></th>\n"
508 . "<th colspan=\"2\"><%colactions%></th>\n";
512 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD'];
515 'colmembername' => _LIST_MEMBER_NAME,
516 'colmemberrname' => _LIST_MEMBER_RNAME,
517 'colteamadmin' => _LIST_TEAM_ADMIN,
518 'colactions' => _LISTS_ACTIONS,
522 $current = $vars['current'];
523 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY']) )
526 . "<input type=\"checkbox\" id=\"batch<%id%>\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
527 . "<label for=\"batch<%id%>\">\n"
528 . "<a href=\"mailto:<%mailaddress%>\" tabindex=\"<%tabindex%>\"><%name%></a>\n"
529 . "</label>\n</td>\n"
530 . "<td><%realname%></td>\n"
531 . "<td><%admin%></td>\n"
532 . "<td><a href=\"index.php?action=teamdelete&memberid=<%memberid%>&blogid=<%blogid%>\" tabindex=\"<%tabindex%>\"><%deletebtn%></a></td>\n"
533 . "<td><a href=\"<%chadminurl%>\" tabindex=\"<%tabindex%>\"><%chadminbtn%></a></td>\n";
537 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY'];
539 $url = 'index.php?action=teamchangeadmin&memberid=' . intval($current['tmember']) . '&blogid=' . intval($current['tblog']);
540 $url = $manager->addTicketToUrl($url);
542 'id' => listplug_nextBatchId(),
543 'memberid' => $current['tmember'],
544 'mailaddress' => Entity::hsc($current['memail']),
545 'tabindex' => $vars['tabindex'],
546 'name' => Entity::hsc($current['mname']),
547 'realname' => Entity::hsc($current['mrealname']),
548 'admin' => ($current['tadmin'] ? _YES : _NO),
549 'blogid' => $current['tblog'],
550 'deletebtn' => '<%text(_LISTS_DELETE)%>',
551 'chadminurl' => Entity::hsc($url),
552 'chadminbtn' => '<%text(_LIST_TEAM_CHADMIN)%>'
556 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT']) )
562 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT'];
567 return Template::fill($template, $data);
570 function listplug_table_pluginlist($vars, $type, $template_name = '')
572 static $plugins = array();
575 $templates = array();
576 if ( !empty($template_name) )
578 $templates =& $manager->getTemplate($template_name);
584 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD']) )
586 $template = "<th><%colinfo%></th>\n"
587 . "<th><%coldesc%></th>\n"
588 . "<th colspan=\"2\"><%colactions%></th>\n";
592 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD'];
595 'colinfo' => _LISTS_INFO,
596 'coldesc' => _LISTS_DESC,
597 'colactions' => _LISTS_ACTIONS,
601 $current = $vars['current'];
602 >>>>>>> skinnable-master
604 $plug =& $manager->getPlugin($current['pfile']);
609 echo '<h3>' . Entity::hsc($plug->getName()) . "</h3>\n";
612 if ( $plug->getAuthor() )
614 echo '<dt>' . _LIST_PLUGS_AUTHOR . "</dt>\n";
615 echo '<dd>' . Entity::hsc($plug->getAuthor()) , "</dd>\n";
618 if ( $plug->getVersion() )
620 echo '<dt>' . _LIST_PLUGS_VER, "</dt>\n";
621 echo '<dd>' . Entity::hsc($plug->getVersion()) . "</dd>\n";
624 if ( $plug->getURL() )
626 echo '<dt>' . _LIST_PLUGS_SITE . "<dt>\n";
627 echo '<dd><a href="' . Entity::hsc($plug->getURL()) . '" tabindex="' . $template['tabindex'] . '">リンク</a></dd>' . "\n";
634 echo '<dt>' . _LIST_PLUGS_DESC ."</dt>\n";
635 echo '<dd>' . Entity::hen($plug->getDescription()) ."</dd>\n";
636 if ( sizeof($plug->getEventList()) > 0 )
638 echo '<dt>' . _LIST_PLUGS_SUBS ."</dt>\n";
639 echo '<dd>' . Entity::hsc(implode(', ', $plug->getEventList())) ."</dd>\n";
642 if ( sizeof($plug->getPluginDep()) > 0 )
644 echo '<dt>' . _LIST_PLUGS_DEP ."</dt>\n";
645 echo '<dd>' . Entity::hsc(implode(', ', $plug->getPluginDep())) ."</dd>\n";
648 /* check dependency */
650 $res = DB::getResult('SELECT pfile FROM ' . sql_table('plugin'));
651 foreach ( $res as $row )
653 $preq =& $manager->getPlugin($row['pfile']);
655 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) )
658 . "<strong><%plugname%></strong><br />\n"
659 . "<%autherlabel%> <%plugauther%><br />\n"
660 . "<%versionlabel%> <%plugversion%><br />\n"
661 . "<%pluggeturl%><br />\n"
664 . "<%desclabel%><br /><%plugdesc%>\n"
673 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY'];
676 'plugname' => Entity::hsc($plug->getName()),
677 'autherlabel' => _LIST_PLUGS_AUTHOR,
678 'plugauther' => Entity::hsc($plug->getAuthor()),
679 'versionlabel' => _LIST_PLUGS_VER,
680 'plugversion' => Entity::hsc($plug->getVersion()),
681 'tabindex' => $vars['tabindex'],
682 'desclabel' => _LIST_PLUGS_DESC,
683 'plugdesc' => Entity::hen($plug->getDescription()),
685 if ( $plug->getURL() )
687 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL']) )
689 $subTpl = "<a href=\"<%plugurl%>\" tabindex=\"<%tabindex%>\"><%plugsite%></a>";
693 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL'];
696 'plugurl' => Entity::hsc($plug->getURL()),
697 'tabindex' => $vars['tabindex'],
698 'plugsite' => _LIST_PLUGS_SITE,
700 $data['pluggeturl'] = Template::fill($subTpl, $subData);
704 $data['pluggeturl'] = '';
706 if ( count($plug->getEventList()) > 0 )
708 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST']) )
710 $subTpl = "<br /><br /><%evntlstlbl%><br /><%eventlist%>";
714 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST'];
717 'evntlstlbl' => _LIST_PLUGS_SUBS,
718 'eventlist' => Entity::hsc(implode(', ', $plug->getEventList())),
720 $data['eventlist'] = Template::fill($subTpl, $subData);
724 $data['eventlist'] = '';
726 if ( !$plug->subscribtionListIsUptodate() )
728 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE']) )
730 $subTpl = "<br /><br /><strong><%updatealert%></strong>";
734 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE'];
737 'updatealert' => _LIST_PLUG_SUBS_NEEDUPDATE,
739 $data['needupdate'] = Template::fill($subTpl, $subData);
743 $data['needupdate'] = '';
745 if ( count($plug->getPluginDep() ) > 0)
747 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND']) )
749 $subTpl = "<br /><br /><%deplistlbl%><br /><%dependlist%>";
753 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND'];
756 'deplistlbl' => _LIST_PLUGS_DEP,
757 'dependlist' => Entity::hsc(implode(', ', $plug->getPluginDep())),
759 $data['dependlist'] = Template::fill($subTpl, $subData);
763 $data['dependlist'] = '';
765 /* check dependency */
766 if ( empty($plugins) )
768 $plugins = DB::getResult('SELECT pfile FROM ' . sql_table('plugin'));
771 foreach ( $plugins as $plugin )
773 $preq =& $manager->getPlugin($plugin['pfile']);
774 >>>>>>> skinnable-master
777 $depList = $preq->getPluginDep();
778 foreach ( $depList as $depName )
780 if ( $current['pfile'] == $depName )
783 $req[] = $row['pfile'];
785 $req[] = $plugin['pfile'];
786 >>>>>>> skinnable-master
792 if ( count($req) > 0 )
795 echo '<dt>' . _LIST_PLUGS_DEPREQ . "</dt>\n";
796 echo '<dd>' . Entity::hsc(implode(', ', $req)) . "</dd>\n";
799 /* check the database to see if it is up-to-date and notice the user if not */
800 if ( !$plug->subscribtionListIsUptodate() )
802 echo '<dt>' . 'NOTICE:' . "</dt>\n";
803 echo '<dd>' . _LIST_PLUG_SUBS_NEEDUPDATE . "</dd>\n";
811 echo '<td colspan="2">' . sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current['pfile'])) . "</td>\n";
816 $current['pid'] = (integer) $current['pid'];
818 $url = Entity::hsc($manager->addTicketToUrl("index.php?plugid={$current['pid']}&action=pluginup"));
819 echo "<li><a href=\"{$url}\" tabindex=\"{$template['tabindex']}\">" , _LIST_PLUGS_UP , "</a></li>\n";
821 $url = Entity::hsc($manager->addTicketToUrl("index.php?plugid={$current['pid']}&action=plugindown"));
822 echo "<li><a href=\"{$url}\" tabindex=\"{$template['tabindex']}\">" . _LIST_PLUGS_DOWN , "</a></li>\n";
823 echo "<li><a href=\"index.php?action=plugindelete&plugid={$current['pid']}\" tabindex=\"{$template['tabindex']}\">" . _LIST_PLUGS_UNINSTALL , "</a></li>\n";
825 if ( $plug && ($plug->hasAdminArea() > 0) )
827 echo '<li><a href="' , Entity::hsc($plug->getAdminURL()) , '" tabindex="' , $template['tabindex'] , '">' , _LIST_PLUGS_ADMIN , "</a></li>\n";
830 if ( $plug && ($plug->supportsFeature('HelpPage') > 0) )
832 echo "<li><a href=\"index.php?action=pluginhelp&plugid={$current['pid']}\" tabindex=\"{$template['tabindex']}\">" . _LIST_PLUGS_HELP , "</a></li>\n";
835 $query = "SELECT COUNT(*) AS result FROM %s WHERE ocontext='global' and opid=%s;";
836 $query = sprintf($query, sql_table('plugin_option_desc'), (integer) $current['pid']);
837 if ( DB::getValue($query) > 0 )
839 echo "<li><a href=\"index.php?action=pluginoptions&plugid={$current['pid']}\" tabindex=\"{$template['tabindex']}\">" . _LIST_PLUGS_OPTIONS . "</a></li>\n";
848 function listplug_table_plugoptionlist($template, $type)
854 echo '<th>' . _LISTS_INFO . "</th>\n";
855 echo '<th>' . _LISTS_VALUE . "</th>\n";
858 listplug_plugOptionRow($template['current']);
862 echo '<th colspan="2">' . _PLUGS_SAVE . "</th>\n";
865 echo "<td>" . _PLUGS_SAVE . "</td>\n";
866 echo "<td><input type=\"submit\" value=\"". _PLUGS_SAVE . "\" /></td>\n";
873 function listplug_plugOptionRow($current)
876 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) )
878 $subTpl = "<br /><br /><%deprlstlbl%><br /><%depreqlist%>";
882 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ'];
885 'deprlstlbl' => _LIST_PLUGS_DEPREQ,
886 'depreqlist' => Entity::hsc(implode(', ', $req)),
888 $data['depreqlist'] = Template::fill($subTpl, $subData);
892 $data['depreqlist'] = '';
897 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE']) )
899 $template = "<td colspan=\"2\"><%noplugalert%></td>\n";
903 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE'];
906 'noplugalert' => sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current['pfile'])),
909 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) )
911 $template .= "<td>\n"
912 . "<a href=\"<%actionupurl%>\" tabindex=\"<%tabindex%>\"><%actionuptxt%></a><br />\n"
913 . "<a href=\"<%actiondownurl%>\" tabindex=\"<%tabindex%>\"><%actiondowntxt%></a><br />\n"
914 . "<a href=\"<%actuninsturl%>\" tabindex=\"<%tabindex%>\"><%actuninsttxt%></a><br />"
915 . "<%plugadminurl%>\n"
916 . "<%plughelpurl%>\n"
917 . "<%plugoptsetting%>\n"
922 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN'];
925 $baseUrl = 'index.php?plugid=' . $current['pid'] . '&action=';
926 $upUrl = $manager->addTicketToUrl($baseUrl . 'pluginup');
927 $downUrl = $manager->addTicketToUrl($baseUrl . 'plugindown');
929 $data['actionuptxt'] = _LIST_PLUGS_UP;
930 $data['actionupurl'] = Entity::hsc($upUrl);
931 $data['actiondowntxt'] = _LIST_PLUGS_DOWN;
932 $data['actiondownurl'] = Entity::hsc($downUrl);
933 $data['actuninsttxt'] = _LIST_PLUGS_UNINSTALL;
934 $data['actuninsturl'] = 'index.php?action=plugindelete&plugid=' . $current['pid'];
936 if ( $plug && ($plug->hasAdminArea() > 0) )
938 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN']) )
940 $subTpl = "<a href=\"<%actadminurl%>\" tabindex=\"<%tabindex%>\"><%actadmintxt%></a><br />\n";
944 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN'];
947 'actadminurl' => Entity::hsc($plug->getAdminURL()),
948 'tabindex' => $vars['tabindex'],
949 'actadmintxt' => _LIST_PLUGS_ADMIN,
951 $data['plugadminurl'] = Template::fill($subTpl, $subData);
955 $data['plugadminurl'] = '';
957 if ( $plug && ($plug->supportsFeature('HelpPage') > 0) )
959 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP']) )
961 $subTpl = "<a href=\"<%acthelpurl%>\" tabindex=\"<%tabindex%>\"><%acthelptxt%></a><br />\n";
965 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP'];
968 'acthelpurl' => 'index.php?action=pluginhelp&plugid=' . $current['pid'],
969 'tabindex' => $vars['tabindex'],
970 'acthelptxt' => _LIST_PLUGS_HELP,
972 $data['plughelpurl'] = Template::fill($subTpl, $subData);
976 $data['plughelpurl'] = '';
978 $optQuery = 'SELECT '
979 . ' COUNT(*) AS result '
981 . sql_table('plugin_option_desc') . ' '
983 . ' ocontext = "global" '
985 $pOptions = DB::getValue(sprintf($optQuery, $current['pid']));
988 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) )
990 $subTpl = "<a href=\"<%actoptionurl%>\" tabindex=\"<%tabindex%>\"><%actoptiontxt%></a>\n";
994 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL'];
997 'actoptionurl' => 'index.php?action=pluginoptions&plugid=' . $current['pid'],
998 'tabindex' => $vars['tabindex'],
999 'actoptiontxt' => _LIST_PLUGS_OPTIONS,
1001 $data['plugoptsetting'] = Template::fill($subTpl, $subData);
1005 $data['plugoptsetting'] = '';
1009 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT']) )
1015 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT'];
1020 return Template::fill($template, $data);
1023 function listplug_table_plugoptionlist($vars, $type, $template_name = '')
1027 $templates = array();
1028 if ( !empty($template_name) )
1030 $templates =& $manager->getTemplate($template_name);
1036 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD']) )
1038 $template = "<th><%colinfo%></th>\n"
1039 . "<th><%colvalue%></th>\n";
1043 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD'];
1046 'colinfo' => _LISTS_INFO,
1047 'colvalue' => _LISTS_VALUE,
1051 $current = $vars['current'];
1052 $template = listplug_plugOptionRow($current, $template_name);
1056 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT']) )
1058 $template = "<tr>\n"
1059 . "<th colspan=\"2\"><%savetext%></th>\n"
1062 . "<td><%savetext%></td>\n"
1063 . "<td><input type=\"submit\" value=\"<%savetext%>\" /></td>\n"
1068 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT'];
1071 'savetext' => _PLUGS_SAVE,
1076 return Template::fill($template, $data);
1079 function listplug_plugOptionRow($current, $template_name = '')
1083 $templates = array();
1084 if ( !empty($template_name) )
1086 $templates =& $manager->getTemplate($template_name);
1089 >>>>>>> skinnable-master
1090 $varname = "plugoption[{$current['oid']}][{$current['contextid']}]";
1092 // retreive the optionmeta
1093 $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
1095 // only if it is not a hidden option write the controls to the page
1096 if ( in_array('access', $meta) && $meta['access'] == 'hidden' )
1102 if ( !$current['description'] )
1104 echo '<td>' , Entity::hsc($current['name']) . "</td>\n";
1108 if ( !defined($current['description']) )
1110 echo '<td>' , Entity::hsc($current['description']) . "</td>\n";
1114 echo '<td>' , Entity::hsc(constant($current['description'])) . "</td>\n";
1118 switch($current['type'])
1121 Admin::input_yesno($varname, $current['value'], 0, 'yes', 'no');
1124 echo '<input type="password" size="40" maxlength="128" name="',Entity::hsc($varname),'" value="',Entity::hsc($current['value']),"\" />\n";
1127 echo '<select name="'.Entity::hsc($varname)."\">\n";
1128 $options = NucleusPlugin::getOptionSelectValues($current['typeinfo']);
1129 $options = preg_split('/\|/', $options);
1131 for ( $i=0; $i<(count($options)-1); $i+=2 )
1133 if ($options[$i+1] == $current['value'])
1135 echo '<option value="' . Entity::hsc($options[$i+1]) . '" selected="selected">';
1139 echo '<option value="' . Entity::hsc($options[$i+1]) . '">';
1141 if ( defined($options[$i]) )
1143 echo Entity::hsc(constant($options[$i]));
1147 echo Entity::hsc($options[$i]);
1155 //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
1156 if ( array_key_exists('access', $meta) && $meta['access'] == 'readonly' )
1158 echo '<textarea class="pluginoption" cols="30" rows="5" name="' . Entity::hsc($varname) . "\" readonly=\"readonly\">\n";
1162 echo '<textarea class="pluginoption" cols="30" rows="5" name="' . Entity::hsc($varname) . "\">\n";
1164 echo Entity::hsc($current['value']) . "\n";
1165 echo "</textarea>\n";
1169 //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
1170 echo '<input type="text" size="40" maxlength="128" name="',Entity::hsc($varname),'" value="',Entity::hsc($current['value']),'"';
1171 if ( array_key_exists('datatype', $meta) && $meta['datatype'] == 'numerical' )
1173 echo ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
1175 if ( array_key_exists('access', $current) && $meta['access'] == 'readonly')
1177 echo ' readonly="readonly"';
1181 if ( array_key_exists('extra', $current) )
1183 echo $current['extra'];
1190 function listplug_table_itemlist($template, $type)
1198 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY']) )
1200 $template = "<td><%description%></td>\n"
1205 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY'];
1210 switch($current['type'])
1213 $template .= listplug_input_yesno($varname, $current['value'], 0, 'yes', 'no', _YES, _NO, 0, $template_name, 1);
1216 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) )
1218 $template .= "<input type=\"password\" size=\"40\" maxlength=\"128\" name=\"<%varname%>\" value=\"<%value%>\" />\n";
1222 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD'];
1225 'varname' => Entity::hsc($varname),
1226 'value' => Entity::hsc($current['value']),
1230 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP']) )
1232 $template .= "<select name=\"<%varname%>\">\n";
1236 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP'];
1238 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO']) )
1240 $subTpl = "<option value=\"<%value%>\"<%selected%>><%optname%></option>\n";
1244 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO'];
1246 $options = NucleusPlugin::getOptionSelectValues($current['typeinfo']);
1247 $options = preg_split('#\|#', $options);
1249 for ( $i=0; $i<(count($options)-1); $i+=2 )
1251 $name = $options[$i];
1252 $value = $options[$i+1];
1253 if ( defined($name) )
1255 $name = constant($name);
1259 'optname' => Entity::hsc($name),
1260 'value' => Entity::hsc($value)
1262 if ($value != $current['value'])
1264 $subData['selected'] = '';
1268 $subData['selected'] = ' selected="selected"';
1270 $template .= Template::fill($subTpl, $subData);
1272 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC']) )
1274 $template .= "</select>\n";
1278 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC'];
1280 $data['varname'] = Entity::hsc($varname);
1283 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA']) )
1285 $template .= "<textarea class=\"pluginoption\" cols=\"30\" rows=\"5\" name=\"<%varname%>\"<%readonly%>><%value%></textarea>\n";
1289 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA'];
1292 'varname' => Entity::hsc($varname),
1293 'value' => Entity::hsc($current['value'])
1295 if ( !array_key_exists('access', $current) || $current['access'] != 'readonly')
1297 $data['readonly'] = '';
1301 $data['readonly'] = ' readonly="readonly"';
1306 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT']) )
1308 $template .= "<input type=\"text\" size=\"40\" maxlength=\"128\" name=\"<%varname%>\" value=\"<%value%>\"<%datatype%><%readonly%> />\n";
1312 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT'];
1315 'varname' => Entity::hsc($varname),
1316 'value' => Entity::hsc($current['value'])
1318 if ( !array_key_exists('datatype', $current) || $current['datatype'] != 'numerical')
1320 $data['datatype'] = '';
1324 $data['datatype'] = ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
1326 if ( !array_key_exists('access', $current) || $current['access'] != 'readonly')
1328 $data['readonly'] = '';
1332 $data['readonly'] = ' readonly="readonly"';
1336 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT']) )
1338 $template .= "<%extra%></td>\n";
1342 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT'];
1345 if ( !array_key_exists('extra', $current) )
1347 $data['extra'] = '';
1351 $data['extra'] = Entity::hsc($current['extra']);
1354 if ( !array_key_exists('description', $current) )
1356 $data['description'] = Entity::hsc($current['name']);
1358 else if ( !defined($current['description']) )
1360 $data['description'] = Entity::hsc($current['description']);
1364 $data['description'] = Entity::hsc(constant($current['description']));
1367 return Template::fill($template, $data, 1);
1371 * listplug_templateEditRow()
1373 * @param array $content content of target template
1374 * @param string $desc description of target template
1375 * @param string $name name of target template
1376 * @param string $help help text
1377 * @param integer $tabindex a number for tab index
1378 * @param boolean $big large or small textarea
1379 * @param array $template_name name of template for filling
1382 function listplug_templateEditRow($content, $desc, $name, $help = '', $tabindex = 0, $big = 0, $template_name = '')
1391 $templates = array();
1392 if ( $template_name )
1394 $templates =& $manager->getTemplate($template_name);
1398 'description' => $desc,
1399 'help' => empty($help) ? '' : helpHtml('template' . $help),
1400 'count' => $count++,
1402 'tabindex' => $tabindex,
1403 'rows' => $big ? 10 : 5,
1409 if ( !array_key_exists('TEMPLATE_EDIT_ROW_HEAD', $templates) || empty($tmplt['TEMPLATE_EDIT_ROW_HEAD']) )
1411 $template = "<tr>\n"
1412 . "<td><%description%><%help%></td>\n"
1413 . "<td id=\"td<%count%>\">\n"
1414 . "<textarea class=\"templateedit\" name=\"<%name%>\" tabindex=\"<%tabindex%>\" cols=\"50\" rows=\"<%rows%>\" id=\"textarea<%count%>\">";
1418 $template = $tmplt['TEMPLATE_EDIT_ROW_HEAD'];
1420 $message .= TEMPLATE::fill($template, $data);
1423 $message .= ENTITY::hsc($content);
1426 if ( !array_key_exists('TEMPLATE_EDIT_ROW_TAIL', $templates) || empty($tmplt['TEMPLATE_EDIT_ROW_TAIL']) )
1428 $template = "</textarea>\n"
1434 $template = $tmplt['TEMPLATE_EDIT_ROW_TAIL'];
1436 $message .= TEMPLATE::fill($template, $data);
1441 function listplug_table_itemlist($vars, $type, $template_name = '')
1447 $templates = array();
1448 if ( !empty($template_name) )
1450 $templates =& $manager->getTemplate($template_name);
1452 >>>>>>> skinnable-master
1458 echo "<th>"._LIST_ITEM_INFO."</th>\n";
1459 echo "<th>"._LIST_ITEM_CONTENT."</th>\n";
1460 echo "<th colspan='1'>"._LISTS_ACTIONS."</th>";
1463 $current = $template['current'];
1464 // string -> unix timestamp
1465 $current['itime'] = strtotime($current['itime']);
1467 if ( $current['idraft'] == 1 )
1469 $cssclass = " class='draft'";
1472 // (can't use offset time since offsets might vary between blogs)
1473 if ( $current['itime'] > $template['now'] )
1475 $cssclass = " class='future'";
1478 echo "<td{$cssclass}>\n";
1480 echo '<dt>' . _LIST_ITEM_BLOG . "</dt>\n";
1481 echo '<dd>' . Entity::hsc($current['bshortname']) . "</dd>\n";
1482 echo '<dt>' . _LIST_ITEM_CAT . "</dt>\n";
1483 echo '<dd>' . Entity::hsc($current['cname']) . "</dd>\n";
1484 echo '<dt>' . _LIST_ITEM_AUTHOR . "</dt>\n";
1485 echo '<dd>' . Entity::hsc($current['mname']) . "</dd>\n";
1486 echo '<dt>' . _LIST_ITEM_DATE . "</dt>\n";
1487 echo '<dd>' . date("Y-m-d",$current['itime']) . "</dd>\n";
1488 echo '<dt>' . _LIST_ITEM_TIME . "</dt>\n";
1489 echo '<dd>' . date("H:i",$current['itime']) . "</dd>\n";
1493 $id = listplug_nextBatchId();
1495 echo "<td{$cssclass}>\n";
1497 echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}]\" value=\"{$current['inumber']}\" />\n";
1498 echo "<label for=\"batch{$id}\">" . Entity::hsc(strip_tags($current['ititle'])) . "</label>\n";
1501 $current['ibody'] = strip_tags($current['ibody']);
1502 $current['ibody'] = Entity::hsc(Entity::shorten($current['ibody'], 300, '...'));
1503 echo "<p>{$current['ibody']}</p>\n";
1506 echo "<td{$cssclass}>\n";
1508 echo "<li><a href=\"index.php?action=itemedit&itemid={$current['inumber']}\">" . _LISTS_EDIT . "</a></li>\n";
1510 // evaluate amount of comments for the item
1511 $COMMENTS = new Comments($current['inumber']);
1512 $camount = $COMMENTS->amountComments();
1515 echo "<li><a href=\"index.php?action=itemcommentlist&itemid={$current['inumber']}\">( ";
1516 echo sprintf(_LIST_ITEM_COMMENTS, $COMMENTS->amountComments()) . " )</a></li>\n";
1520 echo '<li>' . _LIST_ITEM_NOCONTENT . "</li>\n";
1523 echo "<li><a href=\"index.php?action=itemmove&itemid={$current['inumber']}\">" . _LISTS_MOVE . "</a></li>\n";
1524 echo "<li><a href=\"index.php?action=itemdelete&itemid={$current['inumber']}\">" . _LISTS_DELETE . "</a></li>\n";
1531 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) )
1533 $template = "<th><%colinfo%></th>\n"
1534 . "<th><%colcontent%></th>\n"
1535 . "<th style=\"white-space:nowrap\"><%colaction%></th>\n";
1539 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD'];
1542 'colinfo' => _LIST_ITEM_INFO,
1543 'colcontent' => _LIST_ITEM_CONTENT,
1544 'colaction' => _LISTS_ACTIONS
1548 $current = $vars['current'];
1549 // string -> unix timestamp
1550 $current['itime'] = strtotime($current['itime']);
1551 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) )
1553 $template = "<td<%cssclass%>>\n"
1554 . "<%bshortlabel%> <%bshortnameval%><br />\n"
1555 . "<%categorylabel%> <%categorynameval%><br />\n"
1556 . "<%authorlabel%> <%authornameval%><br />\n"
1557 . "<%itemdatelabel%> <%itemdateval%><br />\n"
1558 . "<%itemtimelabel%> <%itemtimeval%>\n"
1560 . "<td<%cssclass%>>\n"
1561 . "<input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%itemid%>\" />\n"
1562 . "<label for=\"batch<%batchid%>\"><b><%itemtitle%></b></label><br />\n"
1565 . "<td<%cssclass%>>\n"
1566 . "<a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a><br />\n"
1567 . "<a href=\"index.php?action=itemmove&itemid=<%itemid%>\"><%movebtn%></a><br />\n"
1568 . "<a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a><br />\n"
1574 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY'];
1578 if ( $current['idraft'] == 1 )
1580 $cssclass = ' class="draft"';
1583 // (can't use offset time since offsets might vary between blogs)
1584 if ( $current['itime'] > $vars['now'] )
1586 $cssclass = ' class="future"';
1588 $body = strip_tags($current['ibody']);
1590 'cssclass' => $cssclass,
1591 'bshortlabel' => _LIST_ITEM_BLOG,
1592 'bshortnameval' => Entity::hsc($current['bshortname']),
1593 'categorylabel' => _LIST_ITEM_CAT,
1594 'categorynameval' => Entity::hsc($current['cname']),
1595 'authorlabel' => _LIST_ITEM_AUTHOR,
1596 'authornameval' => Entity::hsc($current['mname']),
1597 'itemdatelabel' => _LIST_ITEM_DATE,
1598 'itemdateval' => date("Y-m-d",$current['itime']),
1599 'itemdatelabel' => _LIST_ITEM_TIME,
1600 'itemdateval' => date("H:i",$current['itime']),
1601 'batchid' => listplug_nextBatchId(),
1602 'itemid' => $current['inumber'],
1603 'itemtitle' => Entity::hsc(strip_tags($current['ititle'])),
1604 'itembody' => Entity::hsc(Entity::shorten($body, 300, '...')),
1605 'editbtn' => _LISTS_EDIT,
1606 'movebtn' => _LISTS_MOVE,
1607 'delbtn' => _LISTS_DELETE,
1609 // evaluate amount of comments for the item
1610 $comment = new Comments($current['inumber']);
1611 $camount = $comment->amountComments();
1614 $data['camount'] = "<a href=\"index.php?action=itemcommentlist&itemid={$current['inumber']}\">(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")</a><br />\n";
1618 $data['camount'] = _LIST_ITEM_NOCONTENT . "<br />\n";
1622 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT']) )
1628 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT'];
1633 return Template::fill($template, $data);
1634 >>>>>>> skinnable-master
1637 // for batch operations: generates the index numbers for checkboxes
1638 function listplug_nextBatchId()
1645 function listplug_table_commentlist($template, $type)
1650 echo '<th>' . _LISTS_INFO . "</th>\n";
1651 echo '<th>' . _LIST_COMMENT . "</th>\n";
1652 echo '<th colspan="3">' . _LISTS_ACTIONS . "</th>";
1655 $current = $template['current'];
1656 $current['ctime'] = strtotime($current['ctime']); // string -> unix timestamp
1660 echo '<li>' . date("Y-m-d@H:i",$current['ctime']) . "</li>\n";
1661 if ( isset($current['mname']) )
1663 echo '<li>' . Entity::hsc($current['mname']) ,' ', _LIST_COMMENTS_MEMBER . "</li>\n";
1667 echo '<li>' . Entity::hsc($current['cuser']) . "</li>\n";
1669 if ( isset($current['cmail']) && $current['cmail'] )
1671 echo '<li>' . Entity::hsc($current['cmail']) . "</li>\n";
1673 if ( isset($current['cemail']) && $current['cemail'] )
1675 echo '<li>' . Entity::hsc($current['cemail']) . "</li>\n";
1680 $id = listplug_nextBatchId();
1683 echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}\" value=\"{$current['cnumber']}\" />\n";
1684 echo "<label for=\"batch{$id}\">\n";
1685 $current['cbody'] = strip_tags($current['cbody']);
1686 $current['cbody'] = Entity::hsc(Entity::shorten($current['cbody'], 300, '...'));
1687 echo $current['cbody'];
1691 echo '<td><a href="index.php?action=commentedit&commentid=' . $current['cnumber'] . '">' . _LISTS_EDIT . "</a></td>\n";
1692 echo '<td><a href="index.php?action=commentdelete&commentid=' . $current['cnumber'] . '">' . _LISTS_DELETE . "</a></td>\n";
1693 if ( $template['canAddBan'] )
1695 echo '<td><a href="index.php?action=banlistnewfromitem&itemid=' . $current['citem'] . '&ip=' . Entity::hsc($current['cip']), '" title="' . Entity::hsc($current['chost']) . '">' . _LIST_COMMENT_BANIP . "</a></td>\n";
1702 function listplug_table_bloglist($template, $type)
1707 echo '<th>' . _NAME . "</th>\n";
1708 echo '<th colspan="7">' . _LISTS_ACTIONS . "</th>\n";
1711 $current = $template['current'];
1712 $current['bname'] = Entity::hsc($current['bname']);
1714 echo "<td title=\"blogid:{$current['bnumber']} shortname:{$current['bshortname']}\"><a href=\"{$current['burl']}\"><img src=\"images/globe.gif\" width=\"13\" height=\"13\" alt=\"". _BLOGLIST_TT_VISIT."\" /></a>{$current['bname']}</td>\n";
1715 echo "<td><a href=\"index.php?action=createitem&blogid={$current['bnumber']}\" title=\"" . _BLOGLIST_TT_ADD ."\">" . _BLOGLIST_ADD . "</a></td>\n";
1716 echo "<td><a href=\"index.php?action=itemlist&blogid={$current['bnumber']}\" title=\"". _BLOGLIST_TT_EDIT."\">". _BLOGLIST_EDIT."</a></td>\n";
1717 echo "<td><a href=\"index.php?action=blogcommentlist&blogid={$current['bnumber']}\" title=\"". _BLOGLIST_TT_COMMENTS."\">". _BLOGLIST_COMMENTS."</a></td>\n";
1718 echo "<td><a href=\"index.php?action=bookmarklet&blogid={$current['bnumber']}\" title=\"". _BLOGLIST_TT_BMLET."\">". _BLOGLIST_BMLET . "</a></td>\n";
1720 if ( $current['tadmin'] == 1 )
1722 echo "<td><a href=\"index.php?action=blogsettings&blogid={$current['bnumber']}\" title=\"" . _BLOGLIST_TT_SETTINGS . "\">" . _BLOGLIST_SETTINGS . "</a></td>\n";
1723 echo "<td><a href=\"index.php?action=banlist&blogid={$current['bnumber']}\" title=\"" . _BLOGLIST_TT_BANS . "\">" . _BLOGLIST_BANS . "</a></td>\n";
1726 if ( $template['superadmin'] )
1728 echo "<td><a href=\"index.php?action=deleteblog&blogid={$current['bnumber']}\" title=\"". _BLOGLIST_TT_DELETE."\">" ._BLOGLIST_DELETE. "</a></td>\n";
1735 function listplug_table_shortblognames($template, $type)
1740 echo '<th>' . _EBLOG_SHORTNAME . "</th>\n";
1741 echo '<th>' . _EBLOG_NAME. "</th>";
1744 $current = $template['current'];
1745 $current['bshortname'] = Entity::hsc($current['bshortname']);
1746 $current['bname'] = Entity::hsc($current['bname']);
1748 echo "<td>{$current['bshortname']}</td>\n";
1749 echo "<td>{$current['bname']}</td>\n";
1755 function listplug_table_shortnames($template, $type)
1760 echo '<th>' . _NAME . "</th>\n";
1761 echo '<th>' . _LISTS_DESC. "</th>\n";
1764 $current = $template['current'];
1765 $current['name'] = Entity::hsc($current['name']);
1766 $current['description'] = Entity::hsc($current['description']);
1768 echo "<td>{$current['name']}</td>\n";
1769 echo "<td>{$current['description']}</td>\n";
1776 function listplug_table_categorylist($template, $type)
1781 echo '<th>' . _LISTS_NAME . "</th>";
1782 echo '<th>' . _LISTS_DESC."</th>\n";
1783 echo '<th colspan="2">' . _LISTS_ACTIONS . "</th>\n";
1786 $id = listplug_nextBatchId();
1788 $current = $template['current'];
1789 $current['cname'] = Entity::hsc($current['cname']);
1790 $current['cdesc'] = Entity::hsc($current['cdesc']);
1793 echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}]\" value=\"{$current['catid']}\" />\n";
1794 echo "<label for=\"batch{$id}\">{$current['cname']}</label>\n";
1796 echo "<td>{$current['cdesc']}</td>\n";
1797 echo "<td><a href=\"index.php?action=categoryedit&blogid={$current['cblog']}&catid={$current['catid']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_EDIT . "</a></td>\n";
1798 echo "<td><a href=\"index.php?action=categorydelete&blogid={$current['cblog']}&catid={$current['catid']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . "</a></td>\n";
1804 function listplug_table_templatelist($template, $type)
1810 echo '<th>' . _LISTS_NAME . "</th>\n";
1811 echo '<th>' . _LISTS_DESC . "</th>\n";
1812 echo '<th colspan="3">' . _LISTS_ACTIONS . "</th>\n";
1815 $current = $template['current'];
1816 $current['tdnumber'] = (integer) $current['tdnumber'];
1817 $current['tdname'] = Entity::hsc($current['tdname']);
1818 $current['tddesc'] = Entity::hsc($current['tddesc']);
1820 $url = "index.php?action=templateclone&templateid={$current['tdnumber']}";
1821 $url = Entity::hsc($manager->addTicketToUrl($url));
1823 echo "<td>{$current['tdname']}</td>\n";
1824 echo "<td>{$current['tddesc']}</td>\n";
1826 echo "<a href=\"index.php?action=templateedit&templateid={$current['tdnumber']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_EDIT . "</a>\n";
1829 echo "<a href=\"{$url}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_CLONE . "</a>\n";
1832 echo "<a href=\"index.php?action=templatedelete&templateid={$current['tdnumber']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . "</a>\n";
1839 function listplug_table_skinlist($template, $type)
1841 global $CONF, $DIR_SKINS, $manager;
1845 echo '<th>' . _LISTS_NAME . "</th>\n";
1846 echo '<th>' . _LISTS_DESC . "</th>\n";
1847 echo '<th colspan="3">' . _LISTS_ACTIONS . "</th>\n";
1850 $current = $template['current'];
1851 $current['sdnumber'] = (integer) $current['sdnumber'];
1852 $current['sdname'] = Entity::hsc($current['sdname']);
1853 $current['sdtype'] = Entity::hsc($current['sdtype']);
1857 // use a special style for the default skin
1858 if ( $current['sdnumber'] == $CONF['BaseSkin'] )
1860 echo '<h3 id="base_skin">' . $current['sdname'] . "</h3>\n";
1864 echo '<h3>' . $current['sdname'] . "</h3>\n";
1868 echo '<dt>' . _LISTS_TYPE . "</dt>\n";
1869 echo '<dd>' . $current['sdtype'] . "</dd>\n";
1871 echo '<dt>' . _LIST_SKINS_INCMODE . "</dt>\n";
1873 if ( $current['sdincmode'] == 'skindir' )
1875 echo '<dd>' . _PARSER_INCMODE_SKINDIR . "</dd>\n";
1879 echo '<dd>' . _PARSER_INCMODE_NORMAL . "</dd>\n";
1882 if ( $current['sdincpref'] )
1884 echo '<dt>' . _LIST_SKINS_INCPREFIX . "</dt>\n";
1885 echo '<dd>' . Entity::hsc($current['sdincpref']) . "</dd>\n";
1889 function listplug_table_commentlist($vars, $type, $template_name = '')
1893 $templates = array();
1894 if ( !empty($template_name) )
1896 $templates =& $manager->getTemplate($template_name);
1902 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD']) )
1904 $template = "<th><%colinfo%></th>\n"
1905 . "<th><%colcontent%></th>\n"
1906 . "<th colspan=\"3\"><%colaction%></th>\n";
1910 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD'];
1913 'colinfo' => _LISTS_INFO,
1914 'colcontent' => _LIST_COMMENT,
1915 'colaction' => _LISTS_ACTIONS
1919 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) )
1921 $template = "<td><%commentdate%><br /><%commentator%><br /><%commentsite%><br /><%commentmail%><br /></td>\n"
1923 . "<input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />"
1924 . "<label for=\"batch<%batchid%>\"><%commentbody%></label>\n"
1926 . "<td style=\"white-space:nowrap\">\n"
1927 . "<a href=\"index.php?action=commentedit&commentid=<%commentid%>\"><%editbtn%></a>\n"
1929 . "<td style=\"white-space:nowrap\">\n"
1930 . "<a href=\"index.php?action=commentdelete&commentid=<%commentid%>\"><%delbtn%></a>\n"
1936 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY'];
1938 $current = $vars['current'];
1939 $body = strip_tags($current['cbody']);
1941 'commentdate' => date("Y-m-d@H:i", strtotime($current['ctime'])),
1942 'batchid' => listplug_nextBatchId(),
1943 'commentid' => $current['cnumber'],
1944 'commentbody' => Entity::hsc(Entity::shorten($current['cbody'], 300, '...')),
1945 'editbtn' => _LISTS_EDIT,
1946 'delbtn' => _LISTS_DELETE,
1948 if ( isset($current['mname']) )
1950 $data['commentator'] = Entity::hsc($current['mname']) . ' ' . _LIST_COMMENTS_MEMBER;
1954 $data['commentator'] = Entity::hsc($current['cuser']);
1956 if ( isset($current['cmail']) && $current['cmail'] )
1958 $data['commentsite'] = Entity::hsc($current['cmail']);
1962 $data['commentsite'] = '';
1964 if ( isset($current['cemail']) && $current['cemail'] )
1966 $data['commentmail'] = Entity::hsc($current['cemail']);
1970 $data['commentmail'] = '';
1972 if ( $vars['canAddBan'] )
1974 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) )
1976 $subTpl = "<td style=\"white-space:nowrap\">"
1977 . "<a href=\"index.php?action=banlistnewfromitem&itemid=<%itemid%>&ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%></a>"
1982 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN'];
1985 'itemid' => $current['citem'],
1986 'banip' => Entity::hsc($current['cip']),
1987 'banbtn' => _LIST_COMMENT_BANIP,
1989 $data['addbanlist'] = Template::fill($subTpl, $subData);
1993 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT']) )
1999 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT'];
2004 return Template::fill($template, $data);
2007 function listplug_table_bloglist($vars, $type, $template_name = '')
2011 $templates = array();
2012 if ( !empty($template_name) )
2014 $templates =& $manager->getTemplate($template_name);
2020 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD']) )
2022 $template = "<th><%blognames%></th>\n"
2023 . "<th colspan=\"7\"><%actionshead%></th>\n";
2027 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD'];
2030 'blognames' => _NAME,
2031 'actionshead' => _LISTS_ACTIONS,
2035 $current = $vars['current'];
2036 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY']) )
2038 $template = "<td title=\"blogid:<%blogid%> shortname:<%shortname%>\">\n"
2039 . "<a href=\"<%blogurl%>\"><img src=\"images/globe.gif\" width=\"13\" height=\"13\" alt=\"<%iconalt%>\" /></a><%blogname%></td>\n"
2040 . "<td><a href=\"index.php?action=createitem&blogid=<%blogid%>\" title=\"<%ttaddtext%>\"><%addtext%></a></td>\n"
2041 . "<td><a href=\"index.php?action=itemlist&blogid=<%blogid%>\" title=\"<%ttedittext%>\"><%edittext%></a></td>\n"
2042 . "<td><a href=\"index.php?action=blogcommentlist&blogid=<%blogid%>\" title=\"<%ttcommenttext%>\"><%commenttext%></a></td>\n"
2043 . "<td><a href=\"index.php?action=bookmarklet&blogid=<%blogid%>\" title=\"<%ttbmlettext%>\"><%bmlettext%></a></td>\n";
2047 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY'];
2050 'blogid' => $current['bnumber'],
2051 'shortname' => Entity::hsc($current['bshortname']),
2052 'blogurl' => $current['burl'],
2053 'blogname' => Entity::hsc($current['bname']),
2054 'ttaddtext' => _BLOGLIST_TT_ADD,
2055 'addtext' => _BLOGLIST_ADD,
2056 'ttedittext' => _BLOGLIST_TT_EDIT,
2057 'edittext' => _BLOGLIST_EDIT,
2058 'ttcommenttext' => _BLOGLIST_TT_COMMENTS,
2059 'commenttext' => _BLOGLIST_COMMENTS,
2060 'ttbmlettext' => _BLOGLIST_TT_BMLET,
2061 'bmlettext' => _BLOGLIST_BMLET,
2063 if ( $current['tadmin'] == 1 )
2065 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
2067 $template .= "<td><a href=\"index.php?action=blogsettings&blogid=<%blogid%>\" title=\"<%ttsettingtext%>\"><%settingtext%></a></td>\n"
2068 . "<td><a href=\"index.php?action=banlist&blogid=<%blogid%>\" title=\"<%ttbanstext%>\"><%banstext%></a></td>\n";
2072 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
2074 $data['ttsettingtext'] = _BLOGLIST_TT_SETTINGS;
2075 $data['settingtext'] = _BLOGLIST_SETTINGS;
2076 $data['ttbanstext'] = _BLOGLIST_TT_BANS;
2077 $data['banstext'] = _BLOGLIST_BANS;
2080 if ( $vars['superadmin'] )
2082 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_SADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
2084 $template .= "<td><a href=\"index.php?action=deleteblog&blogid=<%blogid%>\" title=\"<%ttdeletetext%>\"><%deletetext%></a></td>\n";
2088 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_SADM'];
2090 $data['ttdeletetext'] = _BLOGLIST_TT_DELETE;
2091 $data['deletetext'] = _BLOGLIST_DELETE;
2095 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) )
2101 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT'];
2106 return Template::fill($template, $data);
2109 function listplug_table_shortblognames($vars, $type, $template_name = '')
2113 $templates = array();
2114 if ( !empty($template_name) )
2116 $templates =& $manager->getTemplate($template_name);
2122 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD']) )
2124 $template = "<th><%colshortname%></th>\n"
2125 . "<th><%colblogname%></th>\n";
2129 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD'];
2132 'colshortname' => _EBLOG_SHORTNAME,
2133 'colblogname' => _EBLOG_NAME,
2137 $current = $vars['current'];
2138 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']) )
2140 $template = "<td><%bshortname%></td>\n"
2141 . "<td><%blogname%></td>\n";
2145 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY'];
2148 'bshortname' => Entity::hsc($current['bshortname']),
2149 'blogname' => Entity::hsc($current['bname']),
2153 $current = $vars['current'];
2154 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT']) )
2160 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT'];
2165 return Template::fill($template, $data);
2168 function listplug_table_shortnames($vars, $type, $template_name = '')
2172 $templates = array();
2173 if ( !empty($template_name) )
2175 $templates =& $manager->getTemplate($template_name);
2181 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD']) )
2183 $template = "<th><%colname%></th>\n"
2184 . "<th><%coldesc%></th>\n";
2188 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD'];
2192 'coldesc' => _LISTS_DESC,
2196 $current = $vars['current'];
2197 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']) )
2199 $template = "<td><%name%></td>\n"
2200 . "<td><%desc%></td>\n";
2204 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY'];
2207 'name' => Entity::hsc($current['name']),
2208 'desc' => Entity::hsc($current['description']),
2212 $current = $vars['current'];
2213 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT']) )
2219 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT'];
2224 return Template::fill($template, $data);
2227 function listplug_table_categorylist($vars, $type, $template_name = '')
2231 $templates = array();
2232 if ( !empty($template_name) )
2234 $templates =& $manager->getTemplate($template_name);
2240 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD']) )
2242 $template = "<th><%colname%></th>\n"
2243 . "<th><%coldesc%></th>\n"
2244 . "<th colspan=\"2\"><%colact%></th>\n";
2248 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD'];
2251 'colname' => _LISTS_NAME,
2252 'coldesc' => _LISTS_DESC,
2253 'colact' => _LISTS_ACTIONS,
2257 $current = $vars['current'];
2258 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY']) )
2260 $template = "<td>\n"
2261 . "<input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%catid%>\" />\n"
2262 . "<label for=\"batch<%batchid%>\"><%catname%></label>\n"
2264 . "<td><%catdesc%></td>\n"
2265 . "<td><a href=\"index.php?action=categoryedit&blogid=<%blogid%>&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a></td>\n"
2266 . "<td><a href=\"index.php?action=categorydelete&blogid=<%blogid%>&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a></td>\n";
2270 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY'];
2274 'batchid' => listplug_nextBatchId(),
2275 'catid' => intval($current['catid']),
2276 'catname' => Entity::hsc($current['cname']),
2277 'catdesc' => Entity::hsc($current['cdesc']),
2278 'blogid' => intval($current['cblog']),
2279 'tabindex' => intval($vars['tabindex']),
2280 'editbtn' => _LISTS_EDIT,
2281 'delbtn' => _LISTS_DELETE,
2285 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT']) )
2291 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT'];
2296 return Template::fill($template, $data);
2299 function listplug_table_templatelist($vars, $type, $template_name = '')
2301 global $manager, $CONF;
2303 $templates = array();
2304 if ( !empty($template_name) )
2306 $templates =& $manager->getTemplate($template_name);
2312 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
2314 $template = "<th><%colname%></th>\n"
2315 . "<th><%coldesc%></th>\n"
2316 . "<th colspan=\"3\"><%colact%></th>\n";
2320 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
2323 'colname' => _LISTS_NAME,
2324 'coldesc' => _LISTS_DESC,
2325 'colact' => _LISTS_ACTIONS,
2329 $current = $vars['current'];
2330 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
2332 $template = "<td><%templatename%></td>\n"
2333 . "<td><%templatedesc%></td>\n"
2334 . "<td style=\"white-space:nowrap\">"
2335 . "<a href=\"<%editurl%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>\n"
2337 . "<td style=\"white-space:nowrap\">\n"
2338 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>\n"
2340 . "<td style=\"white-space:nowrap\">\n"
2341 . "<a href=\"<%deleteurl%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>\n"
2346 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
2350 'templatename' => Entity::hsc($current['tdname']),
2351 'templatedesc' => Entity::hsc($current['tddesc']),
2352 'templateid' => (integer) $current['tdnumber'],
2353 'tabindex' => (integer) $vars['tabindex'],
2355 'clonebtn' => _LISTS_CLONE,
2356 'cloneaction' => $vars['cloneaction'],
2357 'cloneurl' => "{$CONF['AdminURL']}index.php?action={$vars['cloneaction']}&templateid={$current['tdnumber']}",
2359 'delbtn' => _LISTS_DELETE,
2360 'deleteaction' => $vars['deleteaction'],
2361 'deleteurl' => "{$CONF['AdminURL']}index.php?action={$vars['deleteaction']}&templateid={$current['tdnumber']}",
2363 'editbtn' => _LISTS_EDIT,
2364 'editaction' => $vars['editaction'],
2365 'editurl' => "{$CONF['AdminURL']}index.php?action={$vars['editaction']}&templateid={$current['tdnumber']}"
2369 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
2375 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
2380 return Template::fill($template, $data);
2383 function listplug_table_skinlist($vars, $type, $template_name = '')
2385 global $CONF, $DIR_SKINS, $manager;
2387 $templates = array();
2388 if ( !empty($template_name) )
2390 $templates =& $manager->getTemplate($template_name);
2396 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
2398 $template = "<th><%colname%></th>\n"
2399 . "<th><%coldesc%></th>\n"
2400 . "<th colspan=\"3\"><%colact%></th>\n";
2404 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
2407 'colname' => _LISTS_NAME,
2408 'coldesc' => _LISTS_DESC,
2409 'colact' => _LISTS_ACTIONS,
2413 $current = $vars['current'];
2414 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
2416 $template = "<td><%skinname%><br /><br />\n"
2417 . "<%skintypelabel%> <%skintype%><br />\n"
2418 . "<%incmodelabel%> <%incmode%><br />\n"
2419 . "<%incpreflabel%> <%incpref%><br />\n"
2421 . "<%readme%></td>\n"
2422 . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"
2423 . "<td style=\"white-space:nowrap\">"
2424 . "<a href=\"index.php?action=skinedit&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>"
2426 . "<td style=\"white-space:nowrap\">"
2427 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>"
2429 . "<td style=\"white-space:nowrap\">"
2430 . "<a href=\"index.php?action=skindelete&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>"
2435 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
2439 'tabindex' => $vars['tabindex']++,
2441 'skinid' => (integer) $current['sdnumber'],
2442 'skindesc' => Entity::hsc($current['sddesc']),
2444 'skintypelabel' => _LISTS_TYPE,
2445 'skintype' => Entity::hsc($current['sdtype']),
2447 'incmodelabel' => _LIST_SKINS_INCMODE,
2448 'incmode' => ($current['sdincmode'] == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
2450 'incpreflabel' => ($current['sdincpref']) ? _SKIN_INCLUDE_PREFIX : '',
2451 'incpref' => ($current['sdincpref']) ? Entity::hsc($current['sdincpref']) : '',
2453 'editbtn' => _LISTS_EDIT,
2454 'editaction' => $vars['editaction'],
2455 'editurl' => "{$CONF['AdminURL']}index.php?action={$vars['editaction']}&skinid={$current['sdnumber']}",
2457 'clonebtn' => _LISTS_CLONE,
2458 'cloneaction' => $vars['cloneaction'],
2459 'cloneurl' => "{$CONF['AdminURL']}index.php?action={$vars['cloneaction']}&skinid={$current['sdnumber']}",
2461 'delbtn' => _LISTS_DELETE,
2462 'deleteaction' => $vars['deleteaction'],
2463 'deleteurl' => "{$CONF['AdminURL']}index.php?action={$vars['deleteaction']}&skinid={$current['sdnumber']}"
2466 if ( $current['sdnumber'] != $vars['default'] )
2468 $data['skinname'] = Entity::hsc($current['sdname']);
2472 $data['skinname'] = '<strong>' . Entity::hsc($current['sdname']) . '</strong>';
2474 >>>>>>> skinnable-master
2476 // add preview image when present
2477 if ( $current['sdincpref'] && @file_exists("{$DIR_SKINS}{$current['sdincpref']}preview.png") )
2482 $data['skinthumb'] = "<p>\n";
2483 >>>>>>> skinnable-master
2485 $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current['sdname']);
2486 $has_enlargement = @file_exists($DIR_SKINS . $current['sdincpref'] . 'preview-large.png');
2487 if ( $has_enlargement )
2490 echo '<a href="',$CONF['SkinsURL'], Entity::hsc($current['sdincpref']),'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
2491 echo '<img class="skinpreview" src="',$CONF['SkinsURL'], Entity::hsc($current['sdincpref']),'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
2492 echo "</a><br />\n";
2496 echo '<img class="skinpreview" src="',$CONF['SkinsURL'], Entity::hsc($current['sdincpref']),'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" /><br />\n";
2498 $data['skinthumb'] .= '<a href="' . $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
2500 $data['skinthumb'] .= '<img class="skinpreview" src="' . $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
2501 if ( $has_enlargement )
2503 $data['skinthumb'] .= "</a><br />\n";
2504 >>>>>>> skinnable-master
2507 if ( @file_exists("{$DIR_SKINS}{$current['sdincpref']}readme.html") )
2509 $url = $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'readme.html';
2510 $title = sprintf(_LIST_SKIN_README, $current['sdname']);
2512 echo "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
2521 echo '<p>' . Entity::hsc($current['sddesc']) . "</p>\n";
2523 /* make list of defined skins */
2524 $skin = new Skin($current['sdnumber']);
2525 $available_skin_types = $skin->getAvailableTypes();
2527 echo _LIST_SKINS_DEFINED;
2529 foreach ( $available_skin_types as $type => $friendlyName )
2531 if ( $friendlyName === FALSE )
2533 $friendlyName = ucfirst($type);
2535 $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
2539 $data['readme'] ="";
2542 $data['skinthumb'] .= "</p>\n";
2545 $skin =& $manager->getSkin($current['sdnumber'], $vars['handler']);
2546 $available_types = $skin->getAvailableTypes();
2548 $data['skinparts'] = _LIST_SKINS_DEFINED
2550 foreach ( $available_types as $type => $label )
2552 if ( $label === FALSE )
2554 $label = ucfirst($type);
2555 >>>>>>> skinnable-master
2556 $article = 'skinpartspecial';
2560 $article = "skinpart{$type}";
2564 echo helpHtml($article) . "\n";
2565 echo "<a href=\"index.php?action=skinedittype&skinid={$current['sdnumber']}&type={$type}\" tabindex=\"{$template['tabindex']}\">";
2566 echo Entity::hsc($friendlyName);
2574 echo "<a href=\nindex.php?action=skinedit&skinid={$current['sdnumber']}\n tabindex=\n{$template['tabindex']}>" . _LISTS_EDIT . "</a>\n";
2577 $url = "index.php?action=skinclone&skinid={$current['sdnumber']}";
2578 $url = Entity::hsc($manager->addTicketToUrl($url));
2580 echo "<a href=\"{$url}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_CLONE . "</a>\n";
2583 echo "<a href=\"index.php?action=skindelete&skinid={$current['sdnumber']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . "</a></td>\n";
2589 function listplug_table_draftlist($template, $type)
2594 echo '<th>' . _LISTS_BLOG . "</th>\n";
2595 echo '<th>' . _LISTS_TITLE . "</th>\n";
2596 echo '<th colspan="2">' . _LISTS_ACTIONS . "</th>\n";
2599 $current = $template['current'];
2600 $current['bshortname'] = Entity::hsc($current['bshortname']);
2601 $current['ititle'] = Entity::hsc(strip_tags($current['ititle']));
2603 echo "<td>{$current['bshortname']}</td>\n";
2604 echo "<td>{$current['ititle']}</td>\n";
2605 echo "<td><a href=\"index.php?action=itemedit&itemid={$current['inumber']}\">" . _LISTS_EDIT . "</a></td>\n";
2606 echo "<td><a href=\"index.php?action=itemdelete&itemid={$current['inumber']}\">" . _LISTS_DELETE . "</a></td>\n";
2612 function listplug_table_otherdraftlist($template, $type)
2617 echo '<th>' . _LISTS_BLOG . "</th>\n";
2618 echo '<th>' . _LISTS_TITLE . "</th>\n";
2619 echo '<th>' . _LISTS_AUTHOR . "</th>\n";
2620 echo '<th colspan="2">' . _LISTS_ACTIONS . "</th>\n";
2623 $current = $template['current'];
2624 $current['bshortname'] = Entity::hsc($current['bshortname']);
2625 $current['ititle'] = Entity::hsc(strip_tags($current['ititle']));
2626 $current['mname'] = Entity::hsc($current['mname']);
2628 echo "<td>{$current['bshortname']}</td>\n";
2629 echo "<td>{$current['ititle']}</td>\n";
2630 echo "<td>{$current['mname']}</td>\n";
2631 echo "<td><a href=\"index.php?action=itemedit&itemid={$current['inumber']}\">" . _LISTS_EDIT . "</a></td>\n";
2632 echo "<td><a href=\"index.php?action=itemdelete&itemid={$current['inumber']}\">" . _LISTS_DELETE . "</a></td>\n";
2638 function listplug_table_actionlist($template, $type)
2643 echo '<th>' . _LISTS_TIME . "</th>\n";
2644 echo '<th>' . _LIST_ACTION_MSG . "</th>\n";
2647 $current = $template['current'];
2648 $current['timestamp'] = Entity::hsc($current['timestamp']);
2649 $current['message'] = Entity::hsc($current['message']);
2651 echo "<td>{$current['timestamp']}</td>\n";
2652 echo "<td>{$current['message']}</td>\n";
2658 function listplug_table_banlist($template, $type)
2663 echo '<th>' . _LIST_BAN_IPRANGE . "</th>\n";
2664 echo '<th>' . _LIST_BAN_REASON."</th>\n";
2665 echo '<th>' . _LISTS_ACTIONS . "</th>\n";
2668 $current = $template['current'];
2669 $current['blogid'] = (integer) $current['blogid'];
2670 $current['iprange'] = Entity::hsc($current['iprange']);
2671 $current['reason'] = Entity::hsc($current['reason']);
2673 echo "<td>{$current['iprange']}</td>\n";
2674 echo "<td>{$current['reason']}</td>\n";
2675 echo '<td><a href="index.php?action=banlistdelete&blogid=' . $current['blogid'] . '&iprange=' . Entity::hsc($current['iprange']) . '">' . _LISTS_DELETE . "</a></td>\n";
2680 $data['skinparts'] .= "<li>\n"
2681 . helpHtml($article) . "\n"
2682 . "<a href=\"{$CONF['AdminURL']}index.php?action={$vars['edittypeaction']}&skinid={$current['sdnumber']}&type={$type}\" tabindex=\"{$vars['tabindex']}\">"
2683 . Entity::hsc($label)
2687 $data['skinparts'] .= "</ul>\n";
2690 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
2696 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
2701 return Template::fill($template, $data);
2704 function listplug_table_draftlist($vars, $type, $template_name = '')
2708 $templates = array();
2709 if ( !empty($template_name) )
2711 $templates =& $manager->getTemplate($template_name);
2716 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD']) )
2718 $template = "<th><%colblog%></th>\n"
2719 . "<th><%coldesc%></th>\n"
2720 . "<th colspan=\"2\"><%colact%></th>\n";
2724 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD'];
2727 'colblog' => _LISTS_BLOG,
2728 'coldesc' => _LISTS_TITLE,
2729 'colact' => _LISTS_ACTIONS,
2733 $current = $vars['current'];
2734 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY']) )
2736 $template = "<td><%bshortname%></td>\n"
2737 . "<td><%ititle%></td>\n"
2738 . "<td><a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a></td>\n"
2739 . "<td><a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a></td>\n";
2743 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY'];
2746 'bshortname' => Entity::hsc($current['bshortname']),
2747 'ititle' => Entity::hsc(strip_tags($current['ititle'])),
2748 'itemid' => intval($current['inumber']),
2749 'editbtn' => _LISTS_EDIT,
2750 'delbtn' => _LISTS_DELETE,
2754 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT']) )
2760 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT'];
2765 return Template::fill($template, $data);
2768 function listplug_table_otherdraftlist($vars, $type, $template_name = '')
2772 $templates = array();
2773 if ( !empty($template_name) )
2775 $templates =& $manager->getTemplate($template_name);
2781 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD']) )
2783 $template = "<th><%colblog%></th>\n"
2784 . "<th><%coldesc%></th>\n"
2785 . "<th><%colautr%></th>\n"
2786 . "<th colspan=\"2\"><%colact%></th>\n";
2790 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD'];
2793 'colblog' => _LISTS_BLOG,
2794 'coldesc' => _LISTS_TITLE,
2795 'colautr' => _LISTS_AUTHOR,
2796 'colact' => _LISTS_ACTIONS,
2800 $current = $vars['current'];
2801 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY']) )
2803 $template = "<td><%bshortname%></td>\n"
2804 . "<td><%ititle%></td>\n"
2805 . "<td><%iauthor%></td>\n"
2806 . "<td><a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a></td>\n"
2807 . "<td><a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a></td>\n";
2811 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY'];
2814 'bshortname' => Entity::hsc($current['bshortname']),
2815 'ititle' => Entity::hsc(strip_tags($current['ititle'])),
2816 'iauthor' => Entity::hsc(strip_tags($current['mname'])),
2817 'itemid' => intval($current['inumber']),
2818 'editbtn' => _LISTS_EDIT,
2819 'delbtn' => _LISTS_DELETE,
2823 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT']) )
2829 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT'];
2834 return Template::fill($template, $data);
2837 function listplug_table_actionlist($vars, $type, $template_name = '')
2841 $templates = array();
2842 if ( !empty($template_name) )
2844 $templates =& $manager->getTemplate($template_name);
2850 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD']) )
2852 $template = "<th><%coltime%></th>\n"
2853 . "<th><%colmesg%></th>\n";
2857 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD'];
2860 'coltime' => _LISTS_TIME,
2861 'colmesg' => _LIST_ACTION_MSG,
2865 $current = $vars['current'];
2866 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']) )
2868 $template = "<td><%timestamp%></td>\n"
2869 . "<td><%message%></td>\n";
2873 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY'];
2876 'timestamp' => Entity::hsc($current['timestamp']),
2877 'message' => Entity::hsc($current['message']),
2881 $current = $vars['current'];
2882 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT']) )
2888 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT'];
2893 return Template::fill($template, $data);
2896 function listplug_table_banlist($vars, $type, $template_name = '')
2900 $templates = array();
2901 if ( !empty($template_name) )
2903 $templates =& $manager->getTemplate($template_name);
2909 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD']) )
2911 $template = "<th><%iprange%></th>\n"
2912 . "<th><%reason%></th>\n"
2913 . "<th><%colact%></th>\n";
2917 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD'];
2920 'iprange' => _LIST_BAN_IPRANGE,
2921 'reason' => _LIST_BAN_REASON,
2922 'colact' => _LISTS_ACTIONS,
2926 $current = $vars['current'];
2927 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']) )
2929 $template = "<td><%iprange%></td>\n"
2930 . "<td><%reason%></td>\n"
2931 . "<td><a href=\"index.php?action=banlistdelete&blogid=<%blogid%>&iprange=<%iprange%>\"><%delbtn%></a></td>\n";
2935 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY'];
2938 'iprange' => Entity::hsc($current['iprange']),
2939 'reason' => Entity::hsc($current['reason']),
2940 'blogid' => intval($current['blogid']),
2941 'delbtn' => _LISTS_DELETE,
2945 $current = $vars['current'];
2946 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT']) )
2952 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT'];
2957 return Template::fill($template, $data);
2961 * listplug_list_normalskinlist()
2963 * @param array $vars array for variables
2964 * @param string $type HEAD/BODY/FOOT
2965 * @param string $template_name name of template
2966 * @return string marked-up string
2968 function listplug_list_normalskinlist($vars, $type, $template_name = '')
2970 global $manager, $CONF;
2972 /* available variables as a default */
2974 'skinid' => (integer) $vars['skinid'],
2975 'skinname' => Entity::hsc($vars['skinname']),
2978 $templates = array();
2979 if ( $template_name )
2981 $templates =& $manager->getTemplate($template_name);
2987 if ( !array_key_exists('NORMALSKINLIST_HEAD', $templates) || empty($templates['NORMALSKINLIST_HEAD']) )
2989 $template = "<ul>\n";
2993 $template = $templates['NORMALSKINLIST_HEAD'];
2998 $current = $vars['current'];
2999 if ( !array_key_exists('NORMALSKINLIST_BODY', $templates) || empty($templates['NORMALSKINLIST_BODY']) )
3002 . "<a href=\"<%editurl%>\" tabindex=\"<%tabindex%>\"><%skintypename%></a>"
3008 $template = $templates['NORMALSKINLIST_BODY'];
3011 $data['tabindex'] = $vars['tabindex']++;
3012 $data['skintype'] = $current['skintype'];
3013 $data['skintypename'] = $current['skintypename'];
3014 $data['editaction'] = $vars['editaction'];
3015 $data['editurl'] = "{$CONF['AdminURL']}?action={$vars['editaction']}&skinid={$vars['skinid']}&type={$current['skintype']}";
3016 /* TODO: removeaction? */
3017 /* TODO: customHelpHtml("skinpart{$skintype}-{$template_name}") */
3021 if ( !array_key_exists('NORMALSKINLIST_FOOT', $templates) || empty($templates['NORMALSKINLIST_FOOT']) )
3023 $template = "</ul>\n";
3027 $template = $templates['NORMALSKINLIST_FOOT'];
3033 return Template::fill($template, $data);
3037 * listplug_list_specialskinlist()
3039 * @param array $vars array for variables
3040 * @param string $type HEAD/BODY/FOOT
3041 * @param string $template_name name of template
3042 * @return string marked-up string
3044 function listplug_list_specialskinlist($vars, $type, $template_name = '')
3046 global $manager, $CONF;
3048 /* available variables as a default */
3050 'skinid' => (integer) $vars['skinid'],
3051 'skinname' => Entity::hsc($vars['skinname']),
3054 /* retrieve templates */
3055 $templates = array();
3056 if ( $template_name )
3058 $templates =& $manager->getTemplate($template_name);
3064 if ( !array_key_exists('SPECIALSKINLIST_HEAD', $templates) || empty($templates['SPECIALSKINLIST_HEAD']) )
3066 $template = "<ul>\n";
3070 $template = $templates['SPECIALSKINLIST_HEAD'];
3074 $current = $vars['current'];
3075 if ( !array_key_exists('SPECIALSKINLIST_BODY', $templates) || empty($templates['SPECIALSKINLIST_BODY']) )
3078 . "<a href=\"<%editurl%>\" tabindex=\"<%tabindex%>\">"
3082 . "<a href=\"<%removeurl%>\" tabindex=\"<%tabindex%>\" >"
3083 . "<%text(_LISTS_DELETE)%>"
3090 $template = $templates['SPECIALSKINLIST_BODY'];
3093 $data['tabindex'] = (integer) $vars['tabindex']++;
3094 $data['skintype'] = Entity::hsc($current['skintype']);
3095 $data['skintypename'] = Entity::hsc($current['skintypename']);
3096 $data['editaction'] = $vars['editaction'];
3097 $data['editurl'] = "{$CONF['AdminURL']}?action={$vars['editaction']}&skinid={$vars['skinid']}&type={$current['skintype']}";
3098 $data['removeaction'] = $vars['editaction'];
3099 $data['removeurl'] = "{$CONF['AdminURL']}?action={$vars['removeaction']}&skinid={$vars['skinid']}&type={$current['skintype']}";
3103 if ( !array_key_exists('SPECIALSKINLIST_FOOT', $templates) || empty($templates['SPECIALSKINLIST_FOOT']) )
3105 $template = "</ul>\n";
3109 $template = $templates['SPECIALSKINLIST_FOOT'];
3114 return Template::fill($template, $data);
3118 * listplug_input_yesno()
3120 * @param string $name name of input element with radio type attribute
3121 * @param string $checkedval value which should be checked
3122 * @param integer $tabindex tabindex number
3123 * @param string $value1 value of radio 1
3124 * @param string $value2 value of radio 2
3125 * @param string $yesval label for yes
3126 * @param string $noval label for no
3127 * @param boolean $isAdmin super admin or not
3128 * @param string $template_name name of template
3129 * @param boolean $showlist used in showlist or not
3130 * @return string marked-up string
3132 function listplug_input_yesno($name, $checkedval, $tabindex = 0,
3133 $value1 = 1, $value2 = 0, $yesval = _YES, $noval = _NO,
3134 $isAdmin = 0, $template_name = '', $showlist = FALSE)
3138 $templates = array();
3139 if ( $template_name )
3141 $templates =& $manager->getTemplate($template_name);
3144 if ( $name == 'admin' )
3146 if ( !array_key_exists('INPUTYESNO_TEMPLATE_ADMIN', $templates) || empty($templates['INPUTYESNO_TEMPLATE_ADMIN']) )
3148 $template = "<input type=\"radio\" id=\"<%yesid%>\" name=\"<%name%>\" value=\"<%yesval%>\" <%yescheckedval%> onclick=\"selectCanLogin(true);\" />\n"
3149 . "<label for=\"<%yesid%>\"><%yesvaltext%></label>\n"
3150 . "<input type=\"radio\" id=\"<%noid%>\" name=\"<%name%>\" value=\"<%noval%>\" <%nocheckedval%> <%disabled%> onclick=\"selectCanLogin(false);\" />\n"
3151 . "<label for=\"<%noid%>\"><%novaltext%></label>\n";
3155 $template = $templates['INPUTYESNO_TEMPLATE_ADMIN'];
3160 if ( array_key_exists('INPUTYESNO_TEMPLATE_NORMAL', $templates) && !empty($templates['INPUTYESNO_TEMPLATE_NORMAL']) )
3162 $template = $templates['INPUTYESNO_TEMPLATE_NORMAL'];
3164 else if ( $showlist && array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO', $templates) && !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO']) )
3166 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO'];
3170 $template = "<input type=\"radio\" id=\"<%yesid%>\" name=\"<%name%>\" value=\"<%yesval%>\" <%yescheckedval%> />\n"
3171 . "<label for=\"<%yesid%>\"><%yesvaltext%></label>\n"
3172 . "<input type=\"radio\" id=\"<%noid%>\" name=\"<%name%>\" value=\"<%noval%>\" <%nocheckedval%> <%disabled%> />\n"
3173 . "<label for=\"<%noid%>\"><%novaltext%></label>\n";
3177 $id = preg_replace('#[|]#', '-', $name);
3178 $id1 = $id . $value1;
3179 $id2 = $id . $value2;
3181 'name' => Entity::hsc($name),
3182 'yesval' => Entity::hsc($value1),
3183 'noval' => Entity::hsc($value2),
3184 'yesid' => Entity::hsc($id1),
3185 'noid' => Entity::hsc($id2),
3186 'yesvaltext' => $yesval,
3187 'novaltext' => $noval,
3188 'yescheckedval' => ($checkedval == $value1) ? 'checked="checked" tabindex="' . $tabindex . '"': '',
3189 'nocheckedval' => ($checkedval != $value1) ? 'checked="checked" tabindex="' . $tabindex . '"': '',
3190 'disabled' => ($isAdmin && $name == 'canlogin') ? ' disabled="disabled"' : '',
3193 return Template::fill($template, $dat);
3197 * listplug_batchlist()
3199 * @param string $attr item/member/team/category/comment
3200 * @param resource $query SQL resorce
3201 * @param string $type type for showlist()
3202 * @param array $vars array for variables
3204 function listplug_batchlist($attr, $query, $type, $vars, $template_name)
3209 $content = "<form method=\"post\" action=\"index.php\">\n";
3212 $content .= showlist($query, $type, $vars, $template_name);
3219 'delete' => _BATCH_ITEM_DELETE,
3220 'move' => _BATCH_ITEM_MOVE
3225 'delete' => _BATCH_MEMBER_DELETE,
3226 'setadmin' => _BATCH_MEMBER_SET_ADM,
3227 'unsetadmin' => _BATCH_MEMBER_UNSET_ADM
3232 'delete' => _BATCH_TEAM_DELETE,
3233 'setadmin' => _BATCH_TEAM_SET_ADM,
3234 'unsetadmin' => _BATCH_TEAM_UNSET_ADM,
3239 'delete' => _BATCH_CAT_DELETE,
3240 'move' => _BATCH_CAT_MOVE,
3245 'delete' => _BATCH_COMMENT_DELETE,
3253 $content .= "<p class=\"batchoperations\">\n"
3255 . "<select name=\"batchaction\">\n";
3257 foreach ( $options as $option => $label )
3259 $content .= "<option value=\"{$option}\">{$label}</option>\n";
3261 $content .= "</select>\n";
3263 if ( $attr == 'team' )
3265 $content .= '<input type="hidden" name="blogid" value="' . intRequestVar('blogid') . '" />';
3267 else if ( $attr == 'comment' )
3269 $content .= '<input type="hidden" name="itemid" value="' . intRequestVar('itemid') . '" />';
3272 $content .= '<input type="submit" value="' . _BATCH_EXEC . '" />'
3274 . "<a href=\"\" onclick=\"if( event && event.preventDefault ) event.preventDefault(); return batchSelectAll(1); \">" . _BATCH_SELECTALL . "</a>"
3276 . "<a href=\"\" onclick=\"if( event && event.preventDefault ) event.preventDefault(); return batchSelectAll(0); \">" . _BATCH_DESELECTALL . "</a>"
3278 . "<input type=\"hidden\" name=\"action\" value=\"batch{$attr}\" />\n"
3279 . '<input type="hidden" name="ticket" value="' . Entity::hsc($manager->getNewTicket()) . '" />' . "\n"
3287 * listplug_navlist()
3289 * @param string $attr item/member/team/category/comment
3290 * @param resource $query SQL resorce
3291 * @param string $type type for showlist()
3292 * @param array $vars array for variables
3293 * @param string $template_name name of template
3294 * @return string contents
3296 function listplug_navlist($attribute, $query, $type, $vars, $template_name)
3298 global $CONF, $manager;
3299 $dat['adminurl'] = $CONF['AdminURL'];
3301 $templates = array();
3302 if ( $template_name )
3304 $templates =& $manager->getTemplate($template_name);
3307 $dat['prev'] = $vars['start'] - $vars['amount'];
3308 if ( $dat['prev'] < $vars['minamount'] )
3310 $dat['prev'] = $vars['minamount'];
3313 $dat['next'] = $vars['start'] + $vars['amount'];
3316 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_NAVILIST', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_NAVILIST']) )
3318 $navi .= "<table frame=\"box\" rules=\"all\" sumamry=\"navigation actions\" class=\"navigation\">\n"
3321 . "<form method=\"post\" action=\"<%adminurl%>\">\n"
3322 . "<input type=\"hidden\" name=\"start\" value=\"<%prev%>\" />\n"
3323 . "<button type=\"submit\" name=\"action\" value=\"<%action%>\">< < <%listsprev%></button>\n"
3324 . "<input type=\"hidden\" name=\"blogid\" value=\"<%blogid%>\" />\n"
3325 . "<input type=\"hidden\" name=\"itemid\" value=\"<%itemid%>\" />\n"
3326 . "<input type=\"hidden\" name=\"search\" value=\"<%search%>\" />\n"
3327 . "<input type=\"hidden\" name=\"amount\" value=\"<%amount%>\" />\n"
3331 . "<form method=\"post\" action=\"<%adminurl%>\">\n"
3332 . "<input type=\"text\" name=\"amount\" size=\"3\" value=\"<%amount%>\" />\n"
3333 . "<%listsperpage%>"
3334 . "<input type=\"hidden\" name=\"start\" value=\"0\" />\n"
3335 . "<button type=\"submit\" name=\"action\" value=\"<%action%>\">> <%listschange%></button>\n"
3336 . "<input type=\"hidden\" name=\"blogid\" value=\"<%blogid%>\" />\n"
3337 . "<input type=\"hidden\" name=\"itemid\" value=\"<%itemid%>\" />\n"
3338 . "<input type=\"hidden\" name=\"search\" value=\"<%search%>\" />\n"
3339 . "<input type=\"hidden\" name=\"amount\" value=\"<%amount%>\" />\n"
3343 . "<form method=\"post\" action=\"<%adminurl%>\">\n"
3344 . "<input type=\"text\" name=\"search\" value=\"<%search%>\" size=\"7\" />\n"
3345 . "<input type=\"hidden\" name=\"start\" value=\"0\" />\n"
3346 . "<button type=\"submit\" name=\"action\" value=\"<%action%>\">> <%listssearch%></button>\n"
3347 . "<input type=\"hidden\" name=\"blogid\" value=\"<%blogid%>\" />\n"
3348 . "<input type=\"hidden\" name=\"itemid\" value=\"<%itemid%>\" />\n"
3349 . "<input type=\"hidden\" name=\"search\" value=\"<%search%>\" />\n"
3350 . "<input type=\"hidden\" name=\"amount\" value=\"<%amount%>\" />\n"
3354 . "<form method=\"post\" action=\"<%adminurl%>\">\n"
3355 . "<input type=\"hidden\" name=\"start\" value=\"<%next%>\" />\n"
3356 . "<button type=\"submit\" name=\"action\" value=\"<%action%>\"><%listsnext%>> > </button>\n"
3357 . "<input type=\"hidden\" name=\"blogid\" value=\"<%blogid%>\" />\n"
3358 . "<input type=\"hidden\" name=\"itemid\" value=\"<%itemid%>\" />\n"
3359 . "<input type=\"hidden\" name=\"search\" value=\"<%search%>\" />\n"
3360 . "<input type=\"hidden\" name=\"amount\" value=\"<%amount%>\" />\n"
3368 $navi .= $templates['SHOWLIST_LISTPLUG_TABLE_NAVILIST'];
3370 $dat['listsprev'] = _LISTS_PREV;
3371 $dat['listschange'] = _LISTS_CHANGE;
3372 $dat['listssearch'] = _LISTS_SEARCH;
3373 $dat['listsnext'] = _LISTS_NEXT;
3374 $dat['listsperpage'] = _LISTS_PERPAGE;
3376 $template = Template::fill($navi, $dat);
3379 $template .= listplug_batchlist($attribute, $query, $type, $vars, $template_name);
3382 $template .= Template::fill($navi, $dat);
3385 >>>>>>> skinnable-master