3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
\r
4 * Copyright (C) 2002-2012 The Nucleus Group
\r
6 * This program is free software; you can redistribute it and/or
\r
7 * modify it under the terms of the GNU General Public License
\r
8 * as published by the Free Software Foundation; either version 2
\r
9 * of the License, or (at your option) any later version.
\r
10 * (see nucleus/documentation/index.html#license for more info)
\r
13 * Functions to create lists of things inside the admin are
\r
15 * @license http://nucleuscms.org/license.txt GNU General Public License
\r
16 * @copyright Copyright (C) 2002-2012 The Nucleus Group
\r
17 * @version $Id: showlist.php 1662 2012-02-12 12:18:37Z sakamocchi $
\r
21 // can take either an array of objects, or an SQL query
\r
22 function showlist($query, $type, $vars, $templateName = '')
\r
24 if ( is_array($query) )
\r
26 if ( sizeof($query) == 0 )
\r
31 call_user_func("listplug_{$type}", $vars, 'HEAD', $templateName);
\r
33 foreach ( $query as $currentObj )
\r
35 $vars['current'] = $currentObj;
\r
36 call_user_func("listplug_{$type}", $vars, 'BODY', $templateName);
\r
39 call_user_func("listplug_{$type}", $vars, 'FOOT', $templateName);
\r
41 return sizeof($query);
\r
45 $res = DB::getResult($query);
\r
47 // don't do anything if there are no results
\r
48 $numrows = $res->rowCount();
\r
49 if ( $numrows == 0 )
\r
53 call_user_func("listplug_{$type}", $vars, 'HEAD', $templateName);
\r
55 while( $vars['current'] = $res->fetchObject() )
\r
57 call_user_func("listplug_{$type}", $vars, 'BODY', $templateName);
\r
60 call_user_func("listplug_{$type}", $vars, 'FOOT', $templateName);
\r
62 $res->closeCursor();
\r
64 // return amount of results
\r
69 function listplug_select($vars, $type, $templateName = '')
\r
73 $templates = array();
\r
74 if ( !empty($templateName) )
\r
76 $templates = Template::read($templateName);
\r
82 if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_HEAD']) )
\r
84 $template = "<select<%name%><%tabindex%><%javascript%>>\n"
\r
85 . "<%extraoption%>\n";
\r
89 $template = $templates['SHOWLIST_LISTPLUG_SELECT_HEAD'];
\r
92 'name' => isset($vars['name']) ? ' name="' . $vars['name'] . '"' : '',
\r
93 'tabindex' => isset($vars['tabindex']) ? ' tabindex="' . $vars['tabindex'] . '"' : '',
\r
94 'javascript' => isset($vars['javascript']) ? ' ' . $vars['javascript'] : '',
\r
95 'extraoption' => isset($vars['extra']) ? '<option value="' . $vars['extra'] . '">' . $vars['extra'] . "</option>" : ''
\r
99 $current = $vars['current'];
\r
100 if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_BODY']) )
\r
102 $template = "<option value=\"<%value%>\"<%selected%><%title%>><%option%></option>\n";
\r
106 $template = $templates['SHOWLIST_LISTPLUG_SELECT_BODY'];
\r
109 'value' => Entity::hsc($current->value),
\r
110 'selected' => ($vars['selected'] == $current->value) ? ' selected="selected"' : '',
\r
112 if ( array_key_exists('shorten', $vars) && $vars['shorten'] > 0 )
\r
114 $data['title'] = ' title="' . Entity::hsc($current->text) . '"';
\r
115 $current->text = Entity::hsc(Entity::shorten($current->text, $vars['shorten'], $vars['shortenel']));
\r
119 $data['title'] = '';
\r
121 $data['option'] = Entity::hsc($current->text);
\r
124 if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_FOOT']) )
\r
126 $template = "</select>\n";
\r
130 $template = $templates['SHOWLIST_LISTPLUG_SELECT_FOOT'];
\r
136 if ( !class_exists('Actions') )
\r
138 include "{$DIR_LIBS}ACTIONS.php";
\r
140 $template = Template::fill($template, $data);
\r
141 $handler = new Actions('template');
\r
143 $parser = new Parser($handler);
\r
144 $parser->parse($template);
\r
149 function listplug_table($vars, $type, $templateName = '')
\r
151 $templates = array();
\r
152 if ( !empty($templateName) )
\r
154 $templates = Template::read($templateName);
\r
160 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_HEAD']) )
\r
162 $template = "<table frame=\"box\" rules=\"all\" summary=\"{$templateName}\">"
\r
172 $template = $templates['SHOWLIST_LISTPLUG_TABLE_HEAD'];
\r
175 'typehead' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'HEAD', $templateName)
\r
179 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BODY']) )
\r
181 $template = "<tr onmouseover=\"focusRow(this);\" onmouseout=\"blurRow(this);\">\n"
\r
187 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BODY'];
\r
189 // tabletype specific thingies
\r
191 'typebody' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'BODY', $templateName)
\r
195 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_FOOT']) )
\r
197 $template = "<%typefoot%>\n"
\r
203 $template = $templates['SHOWLIST_LISTPLUG_TABLE_FOOT'];
\r
205 // tabletype specific thingies
\r
207 'typefoot' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'FOOT', $templateName)
\r
212 $template = Template::fill($template, $data);
\r
214 if ( !class_exists('Actions') )
\r
217 include $DIR_LIBS . 'ACTIONS.php';
\r
220 $handler = new Actions('template', $template, $data);
\r
222 $parser = new PARSER($handler);
\r
223 $parser->parse($template);
\r
228 function listplug_table_memberlist($vars, $type, $templateName = '')
\r
230 $templates = array();
\r
231 if ( !empty($templateName) )
\r
233 $templates = Template::read($templateName);
\r
239 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD']) )
\r
241 $template = "<th><%colmembername%></th>\n"
\r
242 . "<th><%colmemberrname%></th>\n"
\r
243 . "<th><%colmemberurl%></th>\n"
\r
244 . "<th><%colmemberadmin%><%helplink(superadmin)%></th>\n"
\r
245 . "<th><%colmemberlogin%><%helplink(canlogin)%></th>\n"
\r
246 . "<th colspan=\"2\"><%colactions%></th>\n";
\r
250 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD'];
\r
253 'colmembername' => _LIST_MEMBER_NAME,
\r
254 'colmemberrname' => _LIST_MEMBER_RNAME,
\r
255 'colmemberurl' => _LIST_MEMBER_URL,
\r
256 'colmemberadmin' => _LIST_MEMBER_ADMIN,
\r
257 'colmemberlogin' => _LIST_MEMBER_LOGIN,
\r
258 'colactions' => _LISTS_ACTIONS,
\r
262 $current = $vars['current'];
\r
263 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY']) )
\r
265 $template = "<td>\n"
\r
266 . "<input type=\"checkbox\" id=\"batch<%id%>\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
\r
267 . "<label for=\"batch<%id%>\">\n"
\r
268 . "<a href=\"mailto:<%mailaddress%>\" tabindex=\"<%tabindex%>\"><%name%></a>\n"
\r
269 . "</label>\n</td>\n"
\r
270 . "<td><%realname%></td>\n"
\r
271 . "<td><a href=\"<%url%>\" tabindex=\"<%tabindex%>\"><%url%></a></td>\n"
\r
272 . "<td><%admin%></td>\n"
\r
273 . "<td><%login%></td>\n"
\r
274 . "<td><a href=\"index.php?action=memberedit&memberid=<%memberid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a></td>\n"
\r
275 . "<td><a href=\"index.php?action=memberdelete&memberid=<%memberid%>\" tabindex=\"<%tabindex%>\"><%deletebtn%></a></td>\n";
\r
279 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY'];
\r
282 'id' => listplug_nextBatchId(),
\r
283 'memberid' => $current->mnumber,
\r
284 'mailaddress' => Entity::hsc($current->memail),
\r
285 'tabindex' => $vars['tabindex'],
\r
286 'name' => Entity::hsc($current->mname),
\r
287 'realname' => Entity::hsc($current->mrealname),
\r
288 'url' => Entity::hsc($current->murl),
\r
289 'admin' => ($current->madmin ? _YES : _NO),
\r
290 'login' => ($current->mcanlogin ? _YES : _NO),
\r
291 'editbtn' => _LISTS_EDIT,
\r
292 'deletebtn' => _LISTS_DELETE,
\r
296 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT']) )
\r
302 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT'];
\r
307 return Template::fill($template, $data);
\r
310 function listplug_table_teamlist($vars, $type, $templateName = '')
\r
314 $templates = array();
\r
315 if ( !empty($templateName) )
\r
317 $templates = Template::read($templateName);
\r
323 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD']) )
\r
325 $template = "<th><%colmembername%></th>\n"
\r
326 . "<th><%colmemberrname%></th>\n"
\r
327 . "<th><%colteamadmin%><%helplink(teamadmin)%></th>\n"
\r
328 . "<th colspan=\"2\"><%colactions%></th>\n";
\r
332 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD'];
\r
335 'colmembername' => _LIST_MEMBER_NAME,
\r
336 'colmemberrname' => _LIST_MEMBER_RNAME,
\r
337 'colteamadmin' => _LIST_TEAM_ADMIN,
\r
338 'colactions' => _LISTS_ACTIONS,
\r
342 $current = $vars['current'];
\r
343 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY']) )
\r
345 $template = "<td>\n"
\r
346 . "<input type=\"checkbox\" id=\"batch<%id%>\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
\r
347 . "<label for=\"batch<%id%>\">\n"
\r
348 . "<a href=\"mailto:<%mailaddress%>\" tabindex=\"<%tabindex%>\"><%name%></a>\n"
\r
349 . "</label>\n</td>\n"
\r
350 . "<td><%realname%></td>\n"
\r
351 . "<td><%admin%></td>\n"
\r
352 . "<td><a href=\"index.php?action=teamdelete&memberid=<%memberid%>&blogid=<%blogid%>\" tabindex=\"<%tabindex%>\"><%deletebtn%></a></td>\n"
\r
353 . "<td><a href=\"<%chadminurl%>\" tabindex=\"<%tabindex%>\"><%chadminbtn%></a></td>\n";
\r
357 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY'];
\r
359 $url = 'index.php?action=teamchangeadmin&memberid=' . intval($current->tmember) . '&blogid=' . intval($current->tblog);
\r
360 $url = $manager->addTicketToUrl($url);
\r
362 'id' => listplug_nextBatchId(),
\r
363 'memberid' => $current->tmember,
\r
364 'mailaddress' => Entity::hsc($current->memail),
\r
365 'tabindex' => $vars['tabindex'],
\r
366 'name' => Entity::hsc($current->mname),
\r
367 'realname' => Entity::hsc($current->mrealname),
\r
368 'admin' => ($current->tadmin ? _YES : _NO),
\r
369 'blogid' => $current->tblog,
\r
370 'deletebtn' => _LISTS_DELETE,
\r
371 'chadminurl' => Entity::hsc($url),
\r
375 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT']) )
\r
381 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT'];
\r
386 return Template::fill($template, $data);
\r
389 function listplug_table_pluginlist($vars, $type, $templateName = '')
\r
393 $templates = array();
\r
394 if ( !empty($templateName) )
\r
396 $templates = Template::read($templateName);
\r
402 if ( array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD']) )
\r
404 $template = "<th><%colinfo%></th>\n"
\r
405 . "<th><%coldesc%></th>\n"
\r
406 . "<th colspan=\"2\"><%colactions%></th>\n";
\r
410 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD'];
\r
413 'colinfo' => _LISTS_INFO,
\r
414 'coldesc' => _LISTS_DESC,
\r
415 'colactions' => _LISTS_ACTIONS,
\r
419 $current = $vars['current'];
\r
421 $plug =& $manager->getPlugin($current->pfile);
\r
424 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) )
\r
426 $template = "<td>\n"
\r
427 . "<strong><%plugname%></strong><br />\n"
\r
428 . "<%autherlabel%> <%plugauther%><br />\n"
\r
429 . "<%versionlabel%> <%plugversion%><br />\n"
\r
430 . "<%pluggeturl%><br />\n"
\r
433 . "<%desclabel%><br /><%plugdesc%>\n"
\r
434 . "<%eventlist%>\n"
\r
435 . "<%needupdate%>\n"
\r
436 . "<%dependlist%>\n"
\r
437 . "<%depreqlist%>\n"
\r
442 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY'];
\r
445 'plugname' => Entity::hsc($plug->getName()),
\r
446 'autherlabel' => _LIST_PLUGS_AUTHOR,
\r
447 'plugauther' => Entity::hsc($plug->getAuthor()),
\r
448 'versionlabel' => _LIST_PLUGS_VER,
\r
449 'plugversion' => Entity::hsc($plug->getVersion()),
\r
450 'tabindex' => $vars['tabindex'],
\r
451 'desclabel' => _LIST_PLUGS_DESC,
\r
452 'plugdesc' => Entity::hen($plug->getDescription()),
\r
454 if ( $plug->getURL() )
\r
456 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL']) )
\r
458 $subTpl = "<a href=\"<%plugurl%>\" tabindex=\"<%tabindex%>\"><%plugsite%></a>";
\r
462 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL'];
\r
465 'plugurl' => Entity::hsc($plug->getURL()),
\r
466 'tabindex' => $vars['tabindex'],
\r
467 'plugsite' => _LIST_PLUGS_SITE,
\r
469 $data['pluggeturl'] = Template::fill($subTpl, $subData);
\r
473 $data['pluggeturl'] = '';
\r
475 if ( count($plug->getEventList()) > 0 )
\r
477 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST']) )
\r
479 $subTpl = "<br /><br /><%evntlstlbl%><br /><%eventlist%>";
\r
483 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST'];
\r
486 'evntlstlbl' => _LIST_PLUGS_SUBS,
\r
487 'eventlist' => Entity::hsc(implode(', ', $plug->getEventList())),
\r
489 $data['eventlist'] = Template::fill($subTpl, $subData);
\r
493 $data['eventlist'] = '';
\r
495 if ( !$plug->subscribtionListIsUptodate() )
\r
497 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE']) )
\r
499 $subTpl = "<br /><br /><strong><%updatealert%></strong>";
\r
503 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE'];
\r
506 'updatealert' => _LIST_PLUG_SUBS_NEEDUPDATE,
\r
508 $data['needupdate'] = Template::fill($subTpl, $subData);
\r
512 $data['needupdate'] = '';
\r
514 if ( count($plug->getPluginDep() ) > 0)
\r
516 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND']) )
\r
518 $subTpl = "<br /><br /><%deplistlbl%><br /><%dependlist%>";
\r
522 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND'];
\r
525 'deplistlbl' => _LIST_PLUGS_DEP,
\r
526 'dependlist' => Entity::hsc(implode(', ', $plug->getPluginDep())),
\r
528 $data['dependlist'] = Template::fill($subTpl, $subData);
\r
532 $data['dependlist'] = '';
\r
534 /* check dependency */
\r
536 $res = DB::getResult('SELECT pfile FROM ' . sql_table('plugin'));
\r
537 foreach ( $res as $row )
\r
539 $preq =& $manager->getPlugin($row['pfile']);
\r
542 $depList = $preq->getPluginDep();
\r
543 foreach ( $depList as $depName )
\r
545 if ( $current->pfile == $depName )
\r
547 $req[] = $row['pfile'];
\r
553 if ( count($req) > 0 )
\r
555 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) )
\r
557 $subTpl = "<br /><br /><%deprlstlbl%><br /><%depreqlist%>";
\r
561 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ'];
\r
564 'deprlstlbl' => _LIST_PLUGS_DEPREQ,
\r
565 'depreqlist' => Entity::hsc(implode(', ', $req)),
\r
567 $data['depreqlist'] = Template::fill($subTpl, $subData);
\r
571 $data['depreqlist'] = '';
\r
576 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE']) )
\r
578 $template = "<td colspan=\"2\"><%noplugalert%></td>\n";
\r
582 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE'];
\r
585 'noplugalert' => sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current->pfile)),
\r
588 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) )
\r
590 $template .= "<td>\n"
\r
591 . "<a href=\"<%actionupurl%>\" tabindex=\"<%tabindex%>\"><%actionuptxt%></a><br />\n"
\r
592 . "<a href=\"<%actiondownurl%>\" tabindex=\"<%tabindex%>\"><%actiondowntxt%></a><br />\n"
\r
593 . "<a href=\"<%actuninsturl%>\" tabindex=\"<%tabindex%>\"><%actuninsttxt%></a><br />"
\r
594 . "<%plugadminurl%>\n"
\r
595 . "<%plughelpurl%>\n"
\r
596 . "<%plugoptsetting%>\n"
\r
601 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN'];
\r
604 $baseUrl = 'index.php?plugid=' . $current->pid . '&action=';
\r
605 $upUrl = $manager->addTicketToUrl($baseUrl . 'pluginup');
\r
606 $downUrl = $manager->addTicketToUrl($baseUrl . 'plugindown');
\r
608 $data['actionuptxt'] = _LIST_PLUGS_UP;
\r
609 $data['actionupurl'] = Entity::hsc($upUrl);
\r
610 $data['actiondowntxt'] = _LIST_PLUGS_DOWN;
\r
611 $data['actiondownurl'] = Entity::hsc($downUrl);
\r
612 $data['actuninsttxt'] = _LIST_PLUGS_UNINSTALL;
\r
613 $data['actuninsturl'] = 'index.php?action=plugindelete&plugid=' . $current->pid;
\r
615 if ( $plug && ($plug->hasAdminArea() > 0) )
\r
617 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN']) )
\r
619 $subTpl = "<a href=\"<%actadminurl%>\" tabindex=\"<%tabindex%>\"><%actadmintxt%></a><br />\n";
\r
623 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN'];
\r
626 'actadminurl' => Entity::hsc($plug->getAdminURL()),
\r
627 'tabindex' => $vars['tabindex'],
\r
628 'actadmintxt' => _LIST_PLUGS_ADMIN,
\r
630 $data['plugadminurl'] = Template::fill($subTpl, $subData);
\r
634 $data['plugadminurl'] = '';
\r
636 if ( $plug && ($plug->supportsFeature('HelpPage') > 0) )
\r
638 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP']) )
\r
640 $subTpl = "<a href=\"<%acthelpurl%>\" tabindex=\"<%tabindex%>\"><%acthelptxt%></a><br />\n";
\r
644 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP'];
\r
647 'acthelpurl' => 'index.php?action=pluginhelp&plugid=' . $current->pid,
\r
648 'tabindex' => $vars['tabindex'],
\r
649 'acthelptxt' => _LIST_PLUGS_HELP,
\r
651 $data['plughelpurl'] = Template::fill($subTpl, $subData);
\r
655 $data['plughelpurl'] = '';
\r
657 $optQuery = 'SELECT '
\r
658 . ' COUNT(*) AS result '
\r
660 . sql_table('plugin_option_desc') . ' '
\r
662 . ' ocontext = "global" '
\r
664 $pOptions = DB::getValue(sprintf($optQuery, $current->pid));
\r
665 if ( $pOptions > 0 )
\r
667 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) )
\r
669 $subTpl = "<a href=\"<%actoptionurl%>\" tabindex=\"<%tabindex%>\"><%actoptiontxt%></a>\n";
\r
673 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL'];
\r
676 'actoptionurl' => 'index.php?action=pluginoptions&plugid=' . $current->pid,
\r
677 'tabindex' => $vars['tabindex'],
\r
678 'actoptiontxt' => _LIST_PLUGS_OPTIONS,
\r
680 $data['plugoptsetting'] = Template::fill($subTpl, $subData);
\r
684 $data['plugoptsetting'] = '';
\r
688 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT']) )
\r
694 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT'];
\r
699 return Template::fill($template, $data);
\r
702 function listplug_table_plugoptionlist($vars, $type, $templateName = '')
\r
706 $templates = array();
\r
707 if ( !empty($templateName) )
\r
709 $templates = Template::read($templateName);
\r
715 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD']) )
\r
717 $template = "<th><%colinfo%></th><th><%colvalue%></th>\n";
\r
721 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD'];
\r
724 'colinfo' => _LISTS_INFO,
\r
725 'colvalue' => _LISTS_VALUE,
\r
729 $current = $vars['current'];
\r
730 $template = listplug_plugOptionRow($current, $templateName);
\r
734 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT']) )
\r
736 $template = "<tr>\n"
\r
737 . "<th colspan=\"2\"><%savetext%></th>"
\r
738 . "<th colspan=\"2\"><%savetext%></th>"
\r
739 . "<td><input type=\"submit\" value=\"<%savetext%>\" /></td>"
\r
744 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT'];
\r
747 'savetext' => _PLUGS_SAVE,
\r
752 return Template::fill($template, $data);
\r
755 function listplug_plugOptionRow($current, $templateName = '')
\r
757 $templates = array();
\r
758 if ( !empty($templateName) )
\r
760 $templates = Template::read($templateName);
\r
763 $varname = "plugoption[{$current['oid']}][{$current['contextid']}]";
\r
765 // retreive the optionmeta
\r
766 $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
\r
768 // only if it is not a hidden option write the controls to the page
\r
769 if ( in_array('access', $meta) && $meta['access'] == 'hidden' )
\r
775 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY']) )
\r
777 $template = "<td><%description%></td>\n"
\r
782 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY'];
\r
787 switch($current['type'])
\r
790 $template .= AdminActions::input_yesno($varname, $current['value'], 0, 'yes', 'no', _YES, _NO, 0, $templateName, 1);
\r
793 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) )
\r
795 $template .= "<input type=\"password\" size=\"40\" maxlength=\"128\" name=\"<%varname%>\" value=\"<%value%>\" />\n";
\r
799 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD'];
\r
802 'varname' => Entity::hsc($varname),
\r
803 'value' => Entity::hsc($current['value']),
\r
807 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP']) )
\r
809 $template .= "<select name=\"<%varname%>\">\n";
\r
813 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP'];
\r
815 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO']) )
\r
817 $subTpl = "<option value=\"<%value%>\"<%selected%>><%optname%></option>\n";
\r
821 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO'];
\r
823 $options = NucleusPlugin::getOptionSelectValues($current['typeinfo']);
\r
824 $options = preg_split('#|#', $options);
\r
826 for ( $i=0; $i<(count($options)-1); $i+=2 )
\r
828 $name = $options[$i];
\r
829 $value = $options[$i+1];
\r
830 if ( defined($name) )
\r
832 $name = constant($name);
\r
836 'optname' => Entity::hsc($name),
\r
837 'value' => Entity::hsc($value)
\r
839 if ($value != $current['value'])
\r
841 $subData['selected'] = '';
\r
845 $subData['selected'] = ' selected="selected"';
\r
847 $template .= Template::fill($subTpl, $subData);
\r
849 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC']) )
\r
851 $template .= "</select>\n";
\r
855 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC'];
\r
857 $data['varname'] = Entity::hsc($varname);
\r
860 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA']) )
\r
862 $template .= "<textarea class=\"pluginoption\" cols=\"30\" rows=\"5\" name=\"<%varname%>\"<%readonly%>><%value%></textarea>\n";
\r
866 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA'];
\r
869 'varname' => Entity::hsc($varname),
\r
870 'value' => Entity::hsc($current['value'])
\r
872 if ( !array_key_exists('access', $current) || $current['access'] != 'readonly')
\r
874 $data['readonly'] = '';
\r
878 $data['readonly'] = ' readonly="readonly"';
\r
883 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT']) )
\r
885 $template .= "<input type=\"text\" size=\"40\" maxlength=\"128\" name=\"<%varname%>\" value=\"<%value%>\"<%datatype%><%readonly%> />\n";
\r
889 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT'];
\r
892 'varname' => Entity::hsc($varname),
\r
893 'value' => Entity::hsc($current['value'])
\r
895 if ( !array_key_exists('datatype', $current) || $current['datatype'] != 'numerical')
\r
897 $data['datatype'] = '';
\r
901 $data['datatype'] = ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
\r
903 if ( !array_key_exists('access', $current) || $current['access'] != 'readonly')
\r
905 $data['readonly'] = '';
\r
909 $data['readonly'] = ' readonly="readonly"';
\r
913 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT']) )
\r
915 $template .= "<%extra%></td>\n";
\r
919 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT'];
\r
922 if ( !array_key_exists('extra', $current) )
\r
924 $data['extra'] = '';
\r
928 $data['extra'] = Entity::hsc($current['extra']);
\r
931 if ( !array_key_exists('description', $current) )
\r
933 $data['description'] = Entity::hsc($current['name']);
\r
935 else if ( !defined($current['description']) )
\r
937 $data['description'] = Entity::hsc($current['description']);
\r
941 $data['description'] = Entity::hsc(constant($current['description']));
\r
944 return Template::fill($template, $data, 1);
\r
947 function listplug_table_itemlist($vars, $type, $templateName = '')
\r
951 $templates = array();
\r
952 if ( !empty($templateName) )
\r
954 $templates = Template::read($templateName);
\r
960 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) )
\r
962 $template = "<th><%colinfo%></th>\n"
\r
963 . "<th><%colcontent%></th>\n"
\r
964 . "<th style=\"white-space:nowrap\"><%colaction%></th>\n";
\r
968 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD'];
\r
971 'colinfo' => _LIST_ITEM_INFO,
\r
972 'colcontent' => _LIST_ITEM_CONTENT,
\r
973 'colaction' => _LISTS_ACTIONS
\r
977 $current = $vars['current'];
\r
978 // string -> unix timestamp
\r
979 $current->itime = strtotime($current->itime);
\r
980 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) )
\r
982 $template = "<td<%cssclass%>>\n"
\r
983 . "<%bshortlabel%> <%bshortnameval%><br />\n"
\r
984 . "<%categorylabel%> <%categorynameval%><br />\n"
\r
985 . "<%authorlabel%> <%authornameval%><br />\n"
\r
986 . "<%itemdatelabel%> <%itemdateval%><br />\n"
\r
987 . "<%itemtimelabel%> <%itemtimeval%>\n"
\r
989 . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%itemid%>\" />\n"
\r
990 . "<label for=\"batch<%batchid%>\"><b><%itemtitle%></b></label><br />\n"
\r
993 . "<a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a><br />\n"
\r
995 . "<a href=\"index.php?action=itemmove&itemid=<%itemid%>\"><%movebtn%></a><br />\n"
\r
996 . "<a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a><br />\n"
\r
1001 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY'];
\r
1005 if ( $current->idraft == 1 )
\r
1007 $cssclass = ' class="draft"';
\r
1010 // (can't use offset time since offsets might vary between blogs)
\r
1011 if ( $current->itime > $vars['now'] )
\r
1013 $cssclass = ' class="future"';
\r
1015 $body = strip_tags($current->ibody);
\r
1017 'cssclass' => $cssclass,
\r
1018 'bshortlabel' => _LIST_ITEM_BLOG,
\r
1019 'bshortnameval' => Entity::hsc($current->bshortname),
\r
1020 'categorylabel' => _LIST_ITEM_CAT,
\r
1021 'categorynameval' => Entity::hsc($current->cname),
\r
1022 'authorlabel' => _LIST_ITEM_AUTHOR,
\r
1023 'authornameval' => Entity::hsc($current->mname),
\r
1024 'itemdatelabel' => _LIST_ITEM_DATE,
\r
1025 'itemdateval' => date("Y-m-d",$current->itime),
\r
1026 'itemdatelabel' => _LIST_ITEM_TIME,
\r
1027 'itemdateval' => date("H:i",$current->itime),
\r
1028 'batchid' => listplug_nextBatchId(),
\r
1029 'itemid' => $current->inumber,
\r
1030 'itemtitle' => Entity::hsc(strip_tags($current->ititle)),
\r
1031 'itembody' => Entity::hsc(Entity::shorten($body, 300, '...')),
\r
1032 'editbtn' => _LISTS_EDIT,
\r
1033 'movebtn' => _LISTS_MOVE,
\r
1034 'delbtn' => _LISTS_DELETE,
\r
1036 // evaluate amount of comments for the item
\r
1037 $comment = new Comments($current->inumber);
\r
1038 $camount = $comment->amountComments();
\r
1039 if ( $camount > 0 )
\r
1041 $data['camount'] = "<a href=\"index.php?action=itemcommentlist&itemid=\"{$current->inumber}\">(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")</a><br />\n";
\r
1045 $data['camount'] = "<li>" . _LIST_ITEM_NOCONTENT . "</li>\n";
\r
1049 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT']) )
\r
1055 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT'];
\r
1060 return Template::fill($template, $data);
\r
1063 // for batch operations: generates the index numbers for checkboxes
\r
1064 function listplug_nextBatchId()
\r
1070 function listplug_table_commentlist($vars, $type, $templateName = '')
\r
1073 $templates = array();
\r
1074 if ( !empty($templateName) )
\r
1076 $templates = Template::read($templateName);
\r
1082 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD']) )
\r
1084 $template = "<th><%colinfo%></th>\n"
\r
1085 . "<th><%colcontent%></th>\n"
\r
1086 . "<th colspan=\"3\"><%colaction%></th>\n";
\r
1090 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD'];
\r
1093 'colinfo' => _LISTS_INFO,
\r
1094 'colcontent' => _LIST_COMMENT,
\r
1095 'colaction' => _LISTS_ACTIONS
\r
1099 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) )
\r
1101 $template = "<td><%commentdate%><br /><%commentator%><br /><%commentsite%><br /><%commentmail%><br /></td>\n"
\r
1102 . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />"
\r
1103 . "<label for=\"batch<%batchid%>\"><%commentbody%></label></td>\n"
\r
1104 . "<td style=\"white-space:nowrap\">"
\r
1105 . "<a href=\"index.php?action=commentedit&commentid=<%commentid%>\"><%editbtn%></a></td>\n"
\r
1106 . "<td style=\"white-space:nowrap\">"
\r
1107 . "<a href=\"index.php?action=commentdelete&commentid=<%commentid%>\"><%delbtn%></a></td>\n"
\r
1108 . "<%addbanlist%>";
\r
1112 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY'];
\r
1114 $current = $vars['current'];
\r
1115 $body = strip_tags($current->cbody);
\r
1117 'commentdate' => date("Y-m-d@H:i", strtotime($current->ctime)),
\r
1118 'batchid' => listplug_nextBatchId(),
\r
1119 'commentid' => $current->cnumber,
\r
1120 'commentbody' => Entity::hsc(Entity::shorten($current->cbody, 300, '...')),
\r
1121 'editbtn' => _LISTS_EDIT,
\r
1122 'delbtn' => _LISTS_DELETE,
\r
1124 if ( isset($current->mname) )
\r
1126 $data['commentator'] = Entity::hsc($current->mname) . ' ' . _LIST_COMMENTS_MEMBER;
\r
1130 $data['commentator'] = Entity::hsc($current->cuser);
\r
1132 if ( isset($current->cmail) && $current->cmail )
\r
1134 $data['commentsite'] = Entity::hsc($current->cmail);
\r
1138 $data['commentsite'] = '';
\r
1140 if ( isset($current->cemail) && $current->cemail )
\r
1142 $data['commentmail'] = Entity::hsc($current->cemail);
\r
1146 $data['commentmail'] = '';
\r
1148 if ( $vars['canAddBan'] )
\r
1150 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) )
\r
1152 $subTpl = "<td style=\"white-space:nowrap\"><a href=\"index.php?action=banlistnewfromitem&itemid=<%itemid%>&ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%></a></td>\n";
\r
1156 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN'];
\r
1159 'itemid' => $current->citem,
\r
1160 'banip' => Entity::hsc($current->cip),
\r
1161 'banbtn' => _LIST_COMMENT_BANIP,
\r
1163 $data['addbanlist'] = Template::fill($subTpl, $subData);
\r
1167 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT']) )
\r
1173 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT'];
\r
1178 return Template::fill($template, $data);
\r
1181 function listplug_table_bloglist($vars, $type, $templateName = '')
\r
1183 $templates = array();
\r
1184 if ( !empty($templateName) )
\r
1186 $templates = Template::read($templateName);
\r
1192 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD']) )
\r
1194 $template = "<th><%blognames%></th>\n"
\r
1195 . "<th colspan=\"7\"><%actionshead%></th>\n";
\r
1199 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD'];
\r
1202 'blognames' => _NAME,
\r
1203 'actionshead' => _LISTS_ACTIONS,
\r
1207 $current = $vars['current'];
\r
1208 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY']) )
\r
1210 $template = "<td title=\"blogid:<%blogid%> shortname:<%shortname%>\">\n"
\r
1211 . "<a href=\"<%blogurl%>\"><img src=\"images/globe.gif\" width=\"13\" height=\"13\" alt=\"<%iconalt%>\" /></a><%blogname%></td>\n"
\r
1212 . "<td><a href=\"index.php?action=createitem&blogid=<%blogid%>\" title=\"<%ttaddtext%>\"><%addtext%></a></td>\n"
\r
1213 . "<td><a href=\"index.php?action=itemlist&blogid=<%blogid%>\" title=\"<%ttedittext%>\"><%edittext%></a></td>\n"
\r
1214 . "<td><a href=\"index.php?action=blogcommentlist&blogid=<%blogid%>\" title=\"<%ttcommenttext%>\"><%commenttext%></a></td>\n"
\r
1215 . "<td><a href=\"index.php?action=bookmarklet&blogid=<%blogid%>\" title=\"<%ttbmlettext%>\"><%bmlettext%></a></td>\n";
\r
1219 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY'];
\r
1222 'blogid' => $current->bnumber,
\r
1223 'shortname' => Entity::hsc($current->bshortname),
\r
1224 'blogurl' => $current->burl,
\r
1225 'blogname' => Entity::hsc($current->bname),
\r
1226 'ttaddtext' => _BLOGLIST_TT_ADD,
\r
1227 'addtext' => _BLOGLIST_ADD,
\r
1228 'ttedittext' => _BLOGLIST_TT_EDIT,
\r
1229 'edittext' => _BLOGLIST_EDIT,
\r
1230 'ttcommenttext' => _BLOGLIST_TT_COMMENTS,
\r
1231 'commenttext' => _BLOGLIST_COMMENTS,
\r
1232 'ttbmlettext' => _BLOGLIST_TT_BMLET,
\r
1233 'bmlettext' => _BLOGLIST_BMLET,
\r
1235 if ( $current->tadmin == 1 )
\r
1237 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
\r
1239 $template .= "<td><a href=\"index.php?action=blogsettings&blogid=<%blogid%>\" title=\"<%ttsettingtext%>\"><%settingtext%></a></td>\n"
\r
1240 . "<td><a href=\"index.php?action=banlist&blogid=<%blogid%>\" title=\"<%ttbanstext%>\"><%banstext%></a></td>\n";
\r
1244 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
\r
1246 $data['ttsettingtext'] = _BLOGLIST_TT_SETTINGS;
\r
1247 $data['settingtext'] = _BLOGLIST_SETTINGS;
\r
1248 $data['ttbanstext'] = _BLOGLIST_TT_BANS;
\r
1249 $data['banstext'] = _BLOGLIST_BANS;
\r
1252 if ( $vars['superadmin'] )
\r
1254 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_SADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
\r
1256 $template .= "<td><a href=\"index.php?action=deleteblog&blogid=<%blogid%>\" title=\"<%ttdeletetext%>\"><%deletetext%></a></td>\n";
\r
1260 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_SADM'];
\r
1262 $data['ttdeletetext'] = _BLOGLIST_TT_DELETE;
\r
1263 $data['deletetext'] = _BLOGLIST_DELETE;
\r
1267 $current = $vars['current'];
\r
1268 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) )
\r
1274 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT'];
\r
1279 return Template::fill($template, $data);
\r
1282 function listplug_table_shortblognames($vars, $type, $templateName = '')
\r
1284 $templates = array();
\r
1285 if ( !empty($templateName) )
\r
1287 $templates = Template::read($templateName);
\r
1293 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD']) )
\r
1295 $template = "<th><%colshortname%></th>\n"
\r
1296 . "<th><%colblogname%></th>\n";
\r
1300 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD'];
\r
1303 'colshortname' => _EBLOG_SHORTNAME,
\r
1304 'colblogname' => _EBLOG_NAME,
\r
1308 $current = $vars['current'];
\r
1309 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']) )
\r
1311 $template = "<td><%bshortname%></td>\n"
\r
1312 . "<td><%blogname%></td>\n";
\r
1316 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY'];
\r
1319 'bshortname' => Entity::hsc($current->bshortname),
\r
1320 'blogname' => Entity::hsc($current->bname),
\r
1324 $current = $vars['current'];
\r
1325 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT']) )
\r
1331 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT'];
\r
1336 return Template::fill($template, $data);
\r
1339 function listplug_table_shortnames($vars, $type, $templateName = '')
\r
1342 $templates = array();
\r
1343 if ( !empty($templateName) )
\r
1345 $templates = Template::read($templateName);
\r
1351 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD']) )
\r
1353 $template = "<th><%colname%></th>\n"
\r
1354 . "<th><%coldesc%></th>\n";
\r
1358 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD'];
\r
1361 'colname' => _NAME,
\r
1362 'coldesc' => _LISTS_DESC,
\r
1366 $current = $vars['current'];
\r
1367 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']) )
\r
1369 $template = "<td><%name%></td>\n"
\r
1370 . "<td><%desc%></td>\n";
\r
1374 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY'];
\r
1377 'name' => Entity::hsc($current->name),
\r
1378 'desc' => Entity::hsc($current->description),
\r
1382 $current = $vars['current'];
\r
1383 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT']) )
\r
1389 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT'];
\r
1394 return Template::fill($template, $data);
\r
1397 function listplug_table_categorylist($vars, $type, $templateName = '')
\r
1399 $templates = array();
\r
1400 if ( !empty($templateName) )
\r
1402 $templates = Template::read($templateName);
\r
1408 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD']) )
\r
1410 $template = "<th><%colname%></th>\n"
\r
1411 . "<th><%coldesc%></th>\n"
\r
1412 . "<th colspan=\"2\"><%colact%></th>\n";
\r
1416 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD'];
\r
1419 'colname' => _LISTS_NAME,
\r
1420 'coldesc' => _LISTS_DESC,
\r
1421 'colact' => _LISTS_ACTIONS,
\r
1425 $current = $vars['current'];
\r
1426 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY']) )
\r
1428 $template = "<td>\n"
\r
1429 . "<input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%catid%>\" />\n"
\r
1430 . "<label for=\"batch<%batchid%>\"><%catname%></label>\n"
\r
1432 . "<td><%catdesc%></td>\n"
\r
1433 . "<td><a href=\"index.php?action=categoryedit&blogid=<%blogid%>&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a></td>\n"
\r
1434 . "<td><a href=\"index.php?action=categorydelete&blogid=<%blogid%>&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a></td>\n";
\r
1438 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY'];
\r
1442 'batchid' => listplug_nextBatchId(),
\r
1443 'catid' => intval($current->catid),
\r
1444 'catname' => Entity::hsc($current->cname),
\r
1445 'catdesc' => Entity::hsc($current->cdesc),
\r
1446 'blogid' => intval($current->cblog),
\r
1447 'tabindex' => intval($vars['tabindex']),
\r
1448 'editbtn' => _LISTS_EDIT,
\r
1449 'delbtn' => _LISTS_DELETE,
\r
1453 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT']) )
\r
1459 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT'];
\r
1464 return Template::fill($template, $data);
\r
1467 function listplug_table_templatelist($vars, $type, $templateName = '')
\r
1471 $templates = array();
\r
1472 if ( !empty($templateName) )
\r
1474 $templates = Template::read($templateName);
\r
1480 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
\r
1482 $template = "<th><%colname%></th>\n"
\r
1483 . "<th><%coldesc%></th>\n"
\r
1484 . "<th colspan=\"3\"><%colact%></th>\n";
\r
1488 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
\r
1491 'colname' => _LISTS_NAME,
\r
1492 'coldesc' => _LISTS_DESC,
\r
1493 'colact' => _LISTS_ACTIONS,
\r
1497 $current = $vars['current'];
\r
1498 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
\r
1500 $template = "<td><%templatename%></td>\n"
\r
1501 . "<td><%templatedesc%></td>\n"
\r
1502 . "<td style=\"white-space:nowrap\">"
\r
1503 . "<a href=\"index.php?action=templateedit&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>\n"
\r
1505 . "<td style=\"white-space:nowrap\">\n"
\r
1506 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>\n"
\r
1508 . "<td style=\"white-space:nowrap\">\n"
\r
1509 . "<a href=\"index.php?action=templatedelete&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>\n"
\r
1514 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
\r
1517 $url = "index.php?action=templateclone&templateid={$current->tdnumber}";
\r
1519 'templatename' => Entity::hsc($current->tdname),
\r
1520 'templatedesc' => Entity::hsc($current->tddesc),
\r
1521 'templateid' => (integer) $current->tdnumber,
\r
1522 'tabindex' => (integer) $vars['tabindex'],
\r
1523 'cloneurl' => Entity::hsc($manager->addTicketToUrl($url)),
\r
1524 'editbtn' => _LISTS_EDIT,
\r
1525 'clonebtn' => _LISTS_CLONE,
\r
1526 'delbtn' => _LISTS_DELETE,
\r
1530 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
\r
1536 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
\r
1541 return Template::fill($template, $data);
\r
1544 function listplug_table_skinlist($vars, $type, $templateName = '')
\r
1546 global $CONF, $DIR_SKINS, $manager;
\r
1548 $templates = array();
\r
1549 if ( !empty($templateName) )
\r
1551 $templates = Template::read($templateName);
\r
1557 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
\r
1559 $template = "<th><%colname%></th>\n"
\r
1560 . "<th><%coldesc%></th>\n"
\r
1561 . "<th colspan=\"3\"><%colact%></th>\n";
\r
1565 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
\r
1568 'colname' => _LISTS_NAME,
\r
1569 'coldesc' => _LISTS_DESC,
\r
1570 'colact' => _LISTS_ACTIONS,
\r
1574 $current = $vars['current'];
\r
1575 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
\r
1577 $template = "<td><%skinname%><br /><br />\n"
\r
1578 . "<%skintypelabel%> <%skintype%><br />\n"
\r
1579 . "<%incmodelabel%> <%incmode%><br />\n"
\r
1580 . "<%incpreflabel%> <%incpref%><br />\n"
\r
1582 . "<%readme%></td>\n"
\r
1583 . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"
\r
1584 . "<td style=\"white-space:nowrap\">"
\r
1585 . "<a href=\"index.php?action=skinedit&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%>"
\r
1587 . "<td style=\"white-space:nowrap\">"
\r
1588 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
\r
1590 . "<td style=\"white-space:nowrap\">"
\r
1591 . "<a href=\"index.php?action=skindelete&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%>"
\r
1596 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
\r
1599 $url = $manager->addTicketToUrl('index.php?action=skinclone&skinid=' . intval($current->sdnumber));
\r
1601 'skintypelabel' => _LISTS_TYPE,
\r
1602 'skintype' => Entity::hsc($current->sdtype),
\r
1603 'incmodelabel' => _LIST_SKINS_INCMODE,
\r
1604 'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
\r
1605 'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',
\r
1606 'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',
\r
1607 'skindesc' => Entity::hsc($current->sddesc),
\r
1608 'skinid' => (integer) $current->sdnumber,
\r
1609 'tabindex' => $vars['tabindex'],
\r
1610 'cloneurl' => Entity::hsc($url),
\r
1611 'editbtn' => _LISTS_EDIT,
\r
1612 'clonebtn' => _LISTS_CLONE,
\r
1613 'delbtn' => _LISTS_DELETE,
\r
1616 // use a special style for the default skin
\r
1617 if ( $current->sdnumber != $CONF['BaseSkin'] )
\r
1619 $data['skinname'] = Entity::hsc($current->sdname);
\r
1623 $data['skinname'] = '<strong>' . Entity::hsc($current->sdname) . '</strong>';
\r
1626 // add preview image when present
\r
1627 if ( $current->sdincpref && @file_exists("{$DIR_SKINS}{$current->sdincpref}preview.png") )
\r
1629 $data['skinthumb'] = "<p>\n";
\r
1631 $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
\r
1632 $has_enlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');
\r
1633 if ( $has_enlargement )
\r
1635 $data['skinthumb'] .= '<a href="' . $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
\r
1637 $data['skinthumb'] .= '<img class="skinpreview" src="' . $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
\r
1638 if ( $has_enlargement )
\r
1640 $data['skinthumb'] .= "</a><br />\n";
\r
1643 if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
\r
1645 $url = $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'readme.html';
\r
1646 $title = sprintf(_LIST_SKIN_README, $current->sdname);
\r
1647 $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
\r
1651 $data['readme'] ="";
\r
1654 $data['skinthumb'] .= "</p>\n";
\r
1657 $skin = new Skin($current->sdnumber);
\r
1658 $available_skin_types = $skin->getAvailableTypes();
\r
1660 $data['skinparts'] = _LIST_SKINS_DEFINED;
\r
1661 $data['skinparts'] .= "<ul>\n";
\r
1662 foreach ( $available_skin_types as $type => $friendlyName )
\r
1664 if ( $friendlyName === FALSE )
\r
1666 $friendlyName = ucfirst($type);
\r
1667 $article = 'skinpartspecial';
\r
1671 $article = "skinpart{$type}";
\r
1673 $data['skinparts'] .= "<li>\n"
\r
1674 . helpHtml($article) . "\n"
\r
1675 . "<a href=\"index.php?action=skinedittype&skinid={$current->sdnumber}&type={$type}\" tabindex=\"{$vars['tabindex']}\">"
\r
1676 . Entity::hsc($friendlyName)
\r
1680 $data['skinparts'] .= "</ul>\n";
\r
1683 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
\r
1689 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
\r
1694 return Template::fill($template, $data);
\r
1697 function listplug_table_draftlist($vars, $type, $templateName = '')
\r
1699 $templates = array();
\r
1700 if ( !empty($templateName) )
\r
1702 $templates = Template::read($templateName);
\r
1707 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD']) )
\r
1709 $template = "<th><%colblog%></th>\n"
\r
1710 . "<th><%coldesc%></th>\n"
\r
1711 . "<th colspan=\"2\"><%colact%></th>\n";
\r
1715 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD'];
\r
1718 'colblog' => _LISTS_BLOG,
\r
1719 'coldesc' => _LISTS_TITLE,
\r
1720 'colact' => _LISTS_ACTIONS,
\r
1724 $current = $vars['current'];
\r
1725 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY']) )
\r
1727 $template = "<td><%bshortname%></td>\n"
\r
1728 . "<td><%ititle%></td>\n"
\r
1729 . "<td><a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a></td>\n"
\r
1730 . "<td><a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a></td>\n";
\r
1734 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY'];
\r
1737 'bshortname' => Entity::hsc($current->bshortname),
\r
1738 'ititle' => Entity::hsc(strip_tags($current->ititle)),
\r
1739 'itemid' => intval($current->inumber),
\r
1740 'editbtn' => _LISTS_EDIT,
\r
1741 'delbtn' => _LISTS_DELETE,
\r
1745 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT']) )
\r
1751 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT'];
\r
1756 return Template::fill($template, $data);
\r
1759 function listplug_table_otherdraftlist($vars, $type, $templateName = '')
\r
1761 $templates = array();
\r
1762 if ( !empty($templateName) )
\r
1764 $templates = Template::read($templateName);
\r
1770 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD']) )
\r
1772 $template = "<th><%colblog%></th>\n"
\r
1773 . "<th><%coldesc%></th>\n"
\r
1774 . "<th><%colautr%></th>\n"
\r
1775 . "<th colspan=\"2\"><%colact%></th>\n";
\r
1779 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD'];
\r
1782 'colblog' => _LISTS_BLOG,
\r
1783 'coldesc' => _LISTS_TITLE,
\r
1784 'colautr' => _LISTS_AUTHOR,
\r
1785 'colact' => _LISTS_ACTIONS,
\r
1789 $current = $vars['current'];
\r
1790 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY']) )
\r
1792 $template = "<td><%bshortname%></td>\n"
\r
1793 . "<td><%ititle%></td>\n"
\r
1794 . "<td><%iauthor%></td>\n"
\r
1795 . "<td><a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a></td>\n"
\r
1796 . "<td><a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a></td>\n";
\r
1800 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY'];
\r
1803 'bshortname' => Entity::hsc($current->bshortname),
\r
1804 'ititle' => Entity::hsc(strip_tags($current->ititle)),
\r
1805 'iauthor' => Entity::hsc(strip_tags($current->mname)),
\r
1806 'itemid' => intval($current->inumber),
\r
1807 'editbtn' => _LISTS_EDIT,
\r
1808 'delbtn' => _LISTS_DELETE,
\r
1812 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT']) )
\r
1818 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT'];
\r
1823 return Template::fill($template, $data);
\r
1826 function listplug_table_actionlist($vars, $type, $templateName = '')
\r
1828 $templates = array();
\r
1829 if ( !empty($templateName) )
\r
1831 $templates = Template::read($templateName);
\r
1837 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD']) )
\r
1839 $template = "<th><%coltime%></th>\n"
\r
1840 . "<th><%colmesg%></th>\n";
\r
1844 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD'];
\r
1847 'coltime' => _LISTS_TIME,
\r
1848 'colmesg' => _LIST_ACTION_MSG,
\r
1852 $current = $vars['current'];
\r
1853 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']) )
\r
1855 $template = "<td><%timestamp%></td>\n"
\r
1856 . "<td><%message%></td>\n";
\r
1860 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY'];
\r
1863 'timestamp' => Entity::hsc($current->timestamp),
\r
1864 'message' => Entity::hsc($current->message),
\r
1868 $current = $vars['current'];
\r
1869 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT']) )
\r
1875 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT'];
\r
1880 return Template::fill($template, $data);
\r
1883 function listplug_table_banlist($vars, $type, $templateName = '')
\r
1885 $templates = array();
\r
1886 if ( !empty($templateName) )
\r
1888 $templates = Template::read($templateName);
\r
1894 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD']) )
\r
1896 $template = "<th><%iprange%></th>\n"
\r
1897 . "<th><%reason%></th>\n"
\r
1898 . "<th><%colact%></th>\n";
\r
1902 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD'];
\r
1905 'iprange' => _LIST_BAN_IPRANGE,
\r
1906 'reason' => _LIST_BAN_REASON,
\r
1907 'colact' => _LISTS_ACTIONS,
\r
1911 $current = $vars['current'];
\r
1912 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']) )
\r
1914 $template = "<td><%iprange%></td>\n"
\r
1915 . "<td><%reason%></td>\n"
\r
1916 . "<td><a href=\"index.php?action=banlistdelete&blogid=<%blogid%>&iprange=<%iprange%>\"><%delbtn%></a></td>\n";
\r
1920 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY'];
\r
1923 'iprange' => Entity::hsc($current->iprange),
\r
1924 'reason' => Entity::hsc($current->reason),
\r
1925 'blogid' => intval($current->blogid),
\r
1926 'delbtn' => _LISTS_DELETE,
\r
1930 $current = $vars['current'];
\r
1931 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT']) )
\r
1937 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT'];
\r
1942 return Template::fill($template, $data);
\r
1945 function listplug_table_adminskinlist($vars, $type, $templateName = '')
\r
1947 global $CONF, $DIR_SKINS, $DIR_NUCLEUS, $manager;
\r
1949 $adminSkinURL = $CONF['SkinsURL'] . 'admin/';
\r
1950 $adminSkinDir = $DIR_SKINS . 'admin/';
\r
1952 $templates = array();
\r
1953 if ( !empty($templateName) )
\r
1955 $templates = Template::read($templateName);
\r
1960 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
\r
1962 $template = "<th><%colname%></th>\n"
\r
1963 . "<th><%coldesc%></th>\n"
\r
1964 . "<th colspan=\"3\"><%colact%></th>\n";
\r
1968 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
\r
1971 'colname' => _LISTS_NAME,
\r
1972 'coldesc' => _LISTS_DESC,
\r
1973 'colact' => _LISTS_ACTIONS,
\r
1977 $current = $vars['current'];
\r
1978 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
\r
1980 $template = "<td><%skinname%><br /><br />\n"
\r
1981 . "<%skintypelabel%> <%skintype%><br />\n"
\r
1982 . "<%incmodelabel%> <%incmode%><br />\n"
\r
1983 . "<%incpreflabel%> <%incpref%><br />\n"
\r
1985 . "<%readme%></td>\n"
\r
1986 . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"
\r
1987 . "<td style=\"white-space:nowrap\">"
\r
1988 . "<a href=\"index.php?action=adminskinedit&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%>"
\r
1990 . "<td style=\"white-space:nowrap\">"
\r
1991 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
\r
1993 . "<td style=\"white-space:nowrap\">"
\r
1994 . "<a href=\"index.php?action=adminskindelete&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%>"
\r
1999 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
\r
2002 $url = $manager->addTicketToUrl('index.php?action=adminskinclone&skinid=' . intval($current->sdnumber));
\r
2004 'skintypelabel' => _LISTS_TYPE,
\r
2005 'skintype' => Entity::hsc($current->sdtype),
\r
2006 'incmodelabel' => _LIST_SKINS_INCMODE,
\r
2007 'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
\r
2008 'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',
\r
2009 'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',
\r
2010 'skindesc' => Entity::hsc($current->sddesc),
\r
2011 'skinid' => (integer) $current->sdnumber,
\r
2012 'tabindex' => $vars['tabindex'],
\r
2013 'cloneurl' => Entity::hsc($url),
\r
2014 'editbtn' => _LISTS_EDIT,
\r
2015 'clonebtn' => _LISTS_CLONE,
\r
2016 'delbtn' => _LISTS_DELETE,
\r
2019 // use a special style for the default skin
\r
2020 if ( $current->sdnumber != $CONF['AdminSkin'] )
\r
2022 $data['skinname'] = Entity::hsc($current->sdname);
\r
2026 $data['skinname'] = '<strong>' . Entity::hsc($current->sdname) . '</strong>';
\r
2029 // add preview image when present
\r
2030 if ( $current->sdincpref && @file_exists("{$adminSkinDir}{$current->sdincpref}preview.png") )
\r
2032 $data['skinthumb'] = "<p>\n";
\r
2034 $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
\r
2035 $has_enlargement = @file_exists($adminSkinDir . $current->sdincpref . 'preview-large.png');
\r
2036 if ( $has_enlargement )
\r
2038 $data['skinthumb'] .= '<a href="' . $adminSkinURL . Entity::hsc($current->sdincpref) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
\r
2040 $data['skinthumb'] .= '<img class="skinpreview" src="' . $adminSkinURL . Entity::hsc($current->sdincpref) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
\r
2041 if ( $has_enlargement )
\r
2043 $data['skinthumb'] .= "</a><br />\n";
\r
2046 if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
\r
2048 $url = $adminSkinURL . Entity::hsc($current->sdincpref) . 'readme.html';
\r
2049 $title = sprintf(_LIST_SKIN_README, $current->sdname);
\r
2050 $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
\r
2054 $data['readme'] ="";
\r
2057 $data['skinthumb'] .= "</p>\n";
\r
2060 $skin = new Skin($current->sdnumber, 'AdminActions');
\r
2061 $available_skin_types = $skin->getAvailableTypes();
\r
2063 $data['skinparts'] = _LIST_SKINS_DEFINED;
\r
2064 $data['skinparts'] .= "<ul>\n";
\r
2065 foreach ( $available_skin_types as $type => $friendlyName )
\r
2067 if ( $friendlyName === FALSE )
\r
2069 $friendlyName = ucfirst($type);
\r
2070 $article = 'skinpartspecial';
\r
2074 $article = "skinpart{$type}";
\r
2076 $data['skinparts'] .= "<li>\n"
\r
2077 . helpHtml($article) . "\n"
\r
2078 . "<a href=\"index.php?action=adminskinedittype&skinid={$current->sdnumber}&type={$type}\" tabindex=\"{$vars['tabindex']}\">"
\r
2079 . Entity::hsc($friendlyName)
\r
2083 $data['skinparts'] .= "</ul>\n";
\r
2086 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
\r
2092 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
\r
2097 return Template::fill($template, $data);
\r
2100 function listplug_table_admintemplatelist($vars, $type, $templateName = '')
\r
2104 $templates = array();
\r
2105 if ( !empty($templateName) )
\r
2107 $templates = Template::read($templateName);
\r
2113 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
\r
2115 $template = "<th><%colname%></th>\n"
\r
2116 . "<th><%coldesc%></th>\n"
\r
2117 . "<th colspan=\"3\"><%colact%></th>\n";
\r
2121 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
\r
2124 'colname' => _LISTS_NAME,
\r
2125 'coldesc' => _LISTS_DESC,
\r
2126 'colact' => _LISTS_ACTIONS,
\r
2130 $current = $vars['current'];
\r
2131 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
\r
2133 $template = "<td><%templatename%></td>\n"
\r
2134 . "<td><%templatedesc%></td>\n"
\r
2135 . "<td style=\"white-space:nowrap\">"
\r
2136 . "<a href=\"index.php?action=admintemplateedit&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>\n"
\r
2138 . "<td style=\"white-space:nowrap\">\n"
\r
2139 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>\n"
\r
2141 . "<td style=\"white-space:nowrap\">\n"
\r
2142 . "<a href=\"index.php?action=admintemplatedelete&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>\n"
\r
2147 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
\r
2149 $url = "index.php?action=admintemplateclone&templateid={$current->tdnumber}";
\r
2151 'templatename' => Entity::hsc($current->tdname),
\r
2152 'templatedesc' => Entity::hsc($current->tddesc),
\r
2153 'templateid' => (integer) $current->tdnumber,
\r
2154 'tabindex' => (integer) $vars['tabindex'],
\r
2155 'cloneurl' => Entity::hsc($manager->addTicketToUrl($url)),
\r
2156 'editbtn' => _LISTS_EDIT,
\r
2157 'clonebtn' => _LISTS_CLONE,
\r
2158 'delbtn' => _LISTS_DELETE,
\r
2162 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
\r
2168 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
\r
2173 return Template::fill($template, $data);
\r