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 = sql_query($query);
\r
47 // don't do anything if there are no results
\r
48 $numrows = sql_num_rows($res);
\r
49 if ( $numrows == 0 )
\r
53 call_user_func("listplug_{$type}", $vars, 'HEAD', $templateName);
\r
55 while( $vars['current'] = sql_fetch_object($res) )
\r
57 call_user_func("listplug_{$type}", $vars, 'BODY', $templateName);
\r
60 call_user_func("listplug_{$type}", $vars, 'FOOT', $templateName);
\r
62 sql_free_result($res);
\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
385 return Template::fill($template, $data);
\r
388 function listplug_table_pluginlist($vars, $type, $templateName = '')
\r
392 $templates = array();
\r
393 if ( !empty($templateName) )
\r
395 $templates = Template::read($templateName);
\r
401 if ( array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD']) )
\r
403 $template = "<th><%colinfo%></th>\n"
\r
404 . "<th><%coldesc%></th>\n"
\r
405 . "<th colspan=\"2\"><%colactions%></th>\n";
\r
409 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD'];
\r
412 'colinfo' => _LISTS_INFO,
\r
413 'coldesc' => _LISTS_DESC,
\r
414 'colactions' => _LISTS_ACTIONS,
\r
418 $current = $vars['current'];
\r
420 $plug =& $manager->getPlugin($current->pfile);
\r
423 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) )
\r
425 $template = "<td>\n"
\r
426 . "<strong><%plugname%></strong><br />\n"
\r
427 . "<%autherlabel%> <%plugauther%><br />\n"
\r
428 . "<%versionlabel%> <%plugversion%><br />\n"
\r
429 . "<%pluggeturl%><br />\n"
\r
432 . "<%desclabel%><br /><%plugdesc%>\n"
\r
433 . "<%eventlist%>\n"
\r
434 . "<%needupdate%>\n"
\r
435 . "<%dependlist%>\n"
\r
436 . "<%depreqlist%>\n"
\r
441 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY'];
\r
444 'plugname' => Entity::hsc($plug->getName()),
\r
445 'autherlabel' => _LIST_PLUGS_AUTHOR,
\r
446 'plugauther' => Entity::hsc($plug->getAuthor()),
\r
447 'versionlabel' => _LIST_PLUGS_VER,
\r
448 'plugversion' => Entity::hsc($plug->getVersion()),
\r
449 'tabindex' => $vars['tabindex'],
\r
450 'desclabel' => _LIST_PLUGS_DESC,
\r
451 'plugdesc' => Entity::hen($plug->getDescription()),
\r
453 if ( $plug->getURL() )
\r
455 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL']) )
\r
457 $subTpl = "<a href=\"<%plugurl%>\" tabindex=\"<%tabindex%>\"><%plugsite%></a>";
\r
461 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL'];
\r
464 'plugurl' => Entity::hsc($plug->getURL()),
\r
465 'tabindex' => $vars['tabindex'],
\r
466 'plugsite' => _LIST_PLUGS_SITE,
\r
468 $data['pluggeturl'] = Template::fill($subTpl, $subData);
\r
472 $data['pluggeturl'] = '';
\r
474 if ( count($plug->getEventList()) > 0 )
\r
476 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST']) )
\r
478 $subTpl = "<br /><br /><%evntlstlbl%><br /><%eventlist%>";
\r
482 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST'];
\r
485 'evntlstlbl' => _LIST_PLUGS_SUBS,
\r
486 'eventlist' => Entity::hsc(implode(', ', $plug->getEventList())),
\r
488 $data['eventlist'] = Template::fill($subTpl, $subData);
\r
492 $data['eventlist'] = '';
\r
494 if ( !$plug->subscribtionListIsUptodate() )
\r
496 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE']) )
\r
498 $subTpl = "<br /><br /><strong><%updatealert%></strong>";
\r
502 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE'];
\r
505 'updatealert' => _LIST_PLUG_SUBS_NEEDUPDATE,
\r
507 $data['needupdate'] = Template::fill($subTpl, $subData);
\r
511 $data['needupdate'] = '';
\r
513 if ( count($plug->getPluginDep() ) > 0)
\r
515 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND']) )
\r
517 $subTpl = "<br /><br /><%deplistlbl%><br /><%dependlist%>";
\r
521 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND'];
\r
524 'deplistlbl' => _LIST_PLUGS_DEP,
\r
525 'dependlist' => Entity::hsc(implode(', ', $plug->getPluginDep())),
\r
527 $data['dependlist'] = Template::fill($subTpl, $subData);
\r
531 $data['dependlist'] = '';
\r
533 /* check dependency */
\r
535 $res = sql_query('SELECT pfile FROM ' . sql_table('plugin'));
\r
536 while( $o = sql_fetch_object($res) )
\r
538 $preq =& $manager->getPlugin($o->pfile);
\r
541 $depList = $preq->getPluginDep();
\r
542 foreach ( $depList as $depName )
\r
544 if ( $current->pfile == $depName )
\r
546 $req[] = $o->pfile;
\r
552 if ( count($req) > 0 )
\r
554 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) )
\r
556 $subTpl = "<br /><br /><%deprlstlbl%><br /><%depreqlist%>";
\r
560 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ'];
\r
563 'deprlstlbl' => _LIST_PLUGS_DEPREQ,
\r
564 'depreqlist' => Entity::hsc(implode(', ', $req)),
\r
566 $data['depreqlist'] = Template::fill($subTpl, $subData);
\r
570 $data['depreqlist'] = '';
\r
575 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE']) )
\r
577 $template = "<td colspan=\"2\"><%noplugalert%></td>\n";
\r
581 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE'];
\r
584 'noplugalert' => sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current->pfile)),
\r
587 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) )
\r
589 $template .= "<td>\n"
\r
590 . "<a href=\"<%actionupurl%>\" tabindex=\"<%tabindex%>\"><%actionuptxt%></a><br />\n"
\r
591 . "<a href=\"<%actiondownurl%>\" tabindex=\"<%tabindex%>\"><%actiondowntxt%></a><br />\n"
\r
592 . "<a href=\"<%actuninsturl%>\" tabindex=\"<%tabindex%>\"><%actuninsttxt%></a><br />"
\r
593 . "<%plugadminurl%>\n"
\r
594 . "<%plughelpurl%>\n"
\r
595 . "<%plugoptsetting%>\n"
\r
600 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN'];
\r
603 $baseUrl = 'index.php?plugid=' . $current->pid . '&action=';
\r
604 $upUrl = $manager->addTicketToUrl($baseUrl . 'pluginup');
\r
605 $downUrl = $manager->addTicketToUrl($baseUrl . 'plugindown');
\r
607 $data['actionuptxt'] = _LIST_PLUGS_UP;
\r
608 $data['actionupurl'] = Entity::hsc($upUrl);
\r
609 $data['actiondowntxt'] = _LIST_PLUGS_DOWN;
\r
610 $data['actiondownurl'] = Entity::hsc($downUrl);
\r
611 $data['actuninsttxt'] = _LIST_PLUGS_UNINSTALL;
\r
612 $data['actuninsturl'] = 'index.php?action=plugindelete&plugid=' . $current->pid;
\r
614 if ( $plug && ($plug->hasAdminArea() > 0) )
\r
616 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN']) )
\r
618 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN'];
\r
622 $subTpl = "<a href=\"<%actadminurl%>\" tabindex=\"<%tabindex%>\"><%actadmintxt%></a><br />\n";
\r
625 'actadminurl' => Entity::hsc($plug->getAdminURL()),
\r
626 'tabindex' => $vars['tabindex'],
\r
627 'actadmintxt' => _LIST_PLUGS_ADMIN,
\r
629 $data['plugadminurl'] = Template::fill($subTpl, $subData);
\r
633 $data['plugadminurl'] = '';
\r
635 if ( $plug && ($plug->supportsFeature('HelpPage') > 0) )
\r
637 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP']) )
\r
639 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP'];
\r
643 $subTpl = "<a href=\"<%acthelpurl%>\" tabindex=\"<%tabindex%>\"><%acthelptxt%></a><br />\n";
\r
646 'acthelpurl' => 'index.php?action=pluginhelp&plugid=' . $current->pid,
\r
647 'tabindex' => $vars['tabindex'],
\r
648 'acthelptxt' => _LIST_PLUGS_HELP,
\r
650 $data['plughelpurl'] = Template::fill($subTpl, $subData);
\r
654 $data['plughelpurl'] = '';
\r
656 $optQuery = 'SELECT '
\r
657 . ' COUNT(*) AS result '
\r
659 . sql_table('plugin_option_desc') . ' '
\r
661 . ' ocontext = "global" '
\r
663 $pOptions = quickQuery(sprintf($optQuery, $current->pid));
\r
664 if ( $pOptions > 0 )
\r
666 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) )
\r
668 $subTpl = "<a href=\"<%actoptionurl%>\" tabindex=\"<%tabindex%>\"><%actoptiontxt%></a>\n";
\r
672 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL'];
\r
675 'actoptionurl' => 'index.php?action=pluginoptions&plugid=' . $current->pid,
\r
676 'tabindex' => $vars['tabindex'],
\r
677 'actoptiontxt' => _LIST_PLUGS_OPTIONS,
\r
679 $data['plugoptsetting'] = Template::fill($subTpl, $subData);
\r
683 $data['plugoptsetting'] = '';
\r
687 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT']) )
\r
693 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT'];
\r
698 return Template::fill($template, $data);
\r
701 function listplug_table_plugoptionlist($vars, $type, $templateName = '')
\r
705 $templates = array();
\r
706 if ( !empty($templateName) )
\r
708 $templates = Template::read($templateName);
\r
714 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD']) )
\r
716 $template = "<th><%colinfo%></th><th><%colvalue%></th>\n";
\r
720 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD'];
\r
723 'colinfo' => _LISTS_INFO,
\r
724 'colvalue' => _LISTS_VALUE,
\r
728 $current = $vars['current'];
\r
729 $template = listplug_plugOptionRow($current, $templateName);
\r
733 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT']) )
\r
735 $template = "<tr>\n"
\r
736 . "<th colspan=\"2\"><%savetext%></th>"
\r
737 . "<th colspan=\"2\"><%savetext%></th>"
\r
738 . "<td><input type=\"submit\" value=\"<%savetext%>\" /></td>"
\r
743 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT'];
\r
746 'savetext' => _PLUGS_SAVE,
\r
751 return Template::fill($template, $data);
\r
754 function listplug_plugOptionRow($current, $templateName = '')
\r
756 $templates = array();
\r
757 if ( !empty($templateName) )
\r
759 $templates = Template::read($templateName);
\r
762 $varname = "plugoption[{$current['oid']}][{$current['contextid']}]";
\r
764 // retreive the optionmeta
\r
765 $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
\r
767 // only if it is not a hidden option write the controls to the page
\r
768 if ( in_array('access', $meta) && $meta['access'] == 'hidden' )
\r
774 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY']) )
\r
776 $template = "<td><%description%></td>\n"
\r
781 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY'];
\r
786 switch($current['type'])
\r
789 $template .= AdminActions::input_yesno($varname, $current['value'], 0, 'yes', 'no', _YES, _NO, 0, $templateName, 1);
\r
792 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) )
\r
794 $template .= "<input type=\"password\" size=\"40\" maxlength=\"128\" name=\"<%varname%>\" value=\"<%value%>\" />\n";
\r
798 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD'];
\r
801 'varname' => Entity::hsc($varname),
\r
802 'value' => Entity::hsc($current['value']),
\r
806 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP']) )
\r
808 $template .= "<select name=\"<%varname%>\">\n";
\r
812 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP'];
\r
814 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO']) )
\r
816 $subTpl = "<option value=\"<%value%>\"<%selected%>><%optname%></option>\n";
\r
820 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO'];
\r
822 $options = NucleusPlugin::getOptionSelectValues($current['typeinfo']);
\r
823 $options = i18n::explode('|', $options);
\r
825 for ( $i=0; $i<(count($options)-1); $i+=2 )
\r
828 'optname' => Entity::hsc($options[$i]),
\r
829 'value' => Entity::hsc($options[$i+1])
\r
831 if ($options[$i+1] != $current['value'])
\r
833 $subData['selected'] = '';
\r
837 $subData['selected'] = ' selected="selected"';
\r
839 $template .= Template::fill($subTpl, $subData);
\r
841 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC']) )
\r
843 $template .= "</select>\n";
\r
847 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC'];
\r
849 $data['varname'] = Entity::hsc($varname);
\r
852 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA']) )
\r
854 $template .= "<textarea class=\"pluginoption\" cols=\"30\" rows=\"5\" name=\"<%varname%>\"<%readonly%>><%value%></textarea>\n";
\r
858 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA'];
\r
861 'varname' => Entity::hsc($varname),
\r
862 'value' => Entity::hsc($current['value'])
\r
864 if ( !array_key_exists('access', $current) || $current['access'] != 'readonly')
\r
866 $data['readonly'] = '';
\r
870 $data['readonly'] = ' readonly="readonly"';
\r
875 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT']) )
\r
877 $template .= "<input type=\"text\" size=\"40\" maxlength=\"128\" name=\"<%varname%>\" value=\"<%value%>\"<%datatype%><%readonly%> />\n";
\r
881 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT'];
\r
884 'varname' => Entity::hsc($varname),
\r
885 'value' => Entity::hsc($current['value'])
\r
887 if ( !array_key_exists('datatype', $current) || $current['datatype'] != 'numerical')
\r
889 $data['datatype'] = '';
\r
893 $data['datatype'] = ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
\r
895 if ( !array_key_exists('access', $current) || $current['access'] != 'readonly')
\r
897 $data['readonly'] = '';
\r
901 $data['readonly'] = ' readonly="readonly"';
\r
904 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT']) )
\r
906 $template .= "<%extra%></td>\n";
\r
910 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT'];
\r
912 $data['extra'] = isset($current['extra']) ? $current['extra'] : '';
\r
913 $data['description'] = $current['description'] ? Entity::hsc($current['description']) : Entity::hsc($current['name']);
\r
915 return Template::fill($template, $data, 1);
\r
918 function listplug_table_itemlist($vars, $type, $templateName = '')
\r
922 $templates = array();
\r
923 if ( !empty($templateName) )
\r
925 $templates = Template::read($templateName);
\r
931 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) )
\r
933 $template = "<th><%colinfo%></th>\n"
\r
934 . "<th><%colcontent%></th>\n"
\r
935 . "<th style=\"white-space:nowrap\"><%colaction%></th>\n";
\r
939 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD'];
\r
942 'colinfo' => _LIST_ITEM_INFO,
\r
943 'colcontent' => _LIST_ITEM_CONTENT,
\r
944 'colaction' => _LISTS_ACTIONS
\r
948 $current = $vars['current'];
\r
949 // string -> unix timestamp
\r
950 $current->itime = strtotime($current->itime);
\r
951 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) )
\r
953 $template = "<td<%cssclass%>>\n"
\r
954 . "<%bshortlabel%> <%bshortnameval%><br />\n"
\r
955 . "<%categorylabel%> <%categorynameval%><br />\n"
\r
956 . "<%authorlabel%> <%authornameval%><br />\n"
\r
957 . "<%itemdatelabel%> <%itemdateval%><br />\n"
\r
958 . "<%itemtimelabel%> <%itemtimeval%>\n"
\r
960 . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch<%batchid%>\" value=\"<%itemid%>\" />\n"
\r
961 . "<label for=\"batch<%batchid%>\"><b><%itemtitle%></b></label><br />\n"
\r
964 . "<a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a><br />\n"
\r
966 . "<a href=\"index.php?action=itemmove&itemid=<%itemid%>\"><%movebtn%></a><br />\n"
\r
967 . "<a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a><br />\n"
\r
972 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY'];
\r
976 if ( $current->idraft == 1 )
\r
978 $cssclass = ' class="draft"';
\r
981 // (can't use offset time since offsets might vary between blogs)
\r
982 if ( $current->itime > $vars['now'] )
\r
984 $cssclass = ' class="future"';
\r
986 $body = strip_tags($current->ibody);
\r
988 'cssclass' => $cssclass,
\r
989 'bshortlabel' => _LIST_ITEM_BLOG,
\r
990 'bshortnameval' => Entity::hsc($current->bshortname),
\r
991 'categorylabel' => _LIST_ITEM_CAT,
\r
992 'categorynameval' => Entity::hsc($current->cname),
\r
993 'authorlabel' => _LIST_ITEM_AUTHOR,
\r
994 'authornameval' => Entity::hsc($current->mname),
\r
995 'itemdatelabel' => _LIST_ITEM_DATE,
\r
996 'itemdateval' => date("Y-m-d",$current->itime),
\r
997 'itemdatelabel' => _LIST_ITEM_TIME,
\r
998 'itemdateval' => date("H:i",$current->itime),
\r
999 'batchid' => listplug_nextBatchId(),
\r
1000 'itemid' => $current->inumber,
\r
1001 'itemtitle' => Entity::hsc(strip_tags($current->ititle)),
\r
1002 'itembody' => Entity::hsc(Entity::shorten($body, 300, '...')),
\r
1003 'editbtn' => _LISTS_EDIT,
\r
1004 'movebtn' => _LISTS_MOVE,
\r
1005 'delbtn' => _LISTS_DELETE,
\r
1007 // evaluate amount of comments for the item
\r
1008 $comment = new Comments($current->inumber);
\r
1009 $camount = $comment->amountComments();
\r
1010 if ( $camount > 0 )
\r
1012 $data['camount'] = "<a href=\"index.php?action=itemcommentlist&itemid=\"{$current->inumber}\">(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")</a><br />\n";
\r
1016 $data['camount'] = "<li>" . _LIST_ITEM_NOCONTENT . "</li>\n";
\r
1020 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT']) )
\r
1026 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT'];
\r
1031 return Template::fill($template, $data);
\r
1034 // for batch operations: generates the index numbers for checkboxes
\r
1035 function listplug_nextBatchId()
\r
1041 function listplug_table_commentlist($vars, $type, $templateName = '')
\r
1044 $templates = array();
\r
1045 if ( !empty($templateName) )
\r
1047 $templates = Template::read($templateName);
\r
1053 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD']) )
\r
1055 $template = "<th><%colinfo%></th>\n"
\r
1056 . "<th><%colcontent%></th>\n"
\r
1057 . "<th colspan=\"3\"><%colaction%></th>\n";
\r
1061 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD'];
\r
1064 'colinfo' => _LISTS_INFO,
\r
1065 'colcontent' => _LIST_COMMENT,
\r
1066 'colaction' => _LISTS_ACTIONS
\r
1070 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) )
\r
1072 $template = "<td><%commentdate%><br /><%commentator%><br /><%commentsite%><br /><%commentmail%><br /></td>\n"
\r
1073 . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />"
\r
1074 . "<label for=\"batch<%batchid%>\"><%commentbody%></label></td>\n"
\r
1075 . "<td style=\"white-space:nowrap\">"
\r
1076 . "<a href=\"index.php?action=commentedit&commentid=<%commentid%>\"><%editbtn%></a></td>\n"
\r
1077 . "<td style=\"white-space:nowrap\">"
\r
1078 . "<a href=\"index.php?action=commentdelete&commentid=<%commentid%>\"><%delbtn%></a></td>\n"
\r
1079 . "<%addbanlist%>";
\r
1083 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY'];
\r
1085 $current = $vars['current'];
\r
1086 $body = strip_tags($current->cbody);
\r
1088 'commentdate' => date("Y-m-d@H:i", strtotime($current->ctime)),
\r
1089 'batchid' => listplug_nextBatchId(),
\r
1090 'commentid' => $current->cnumber,
\r
1091 'commentbody' => Entity::hsc(Entity::shorten($current->cbody, 300, '...')),
\r
1092 'editbtn' => _LISTS_EDIT,
\r
1093 'delbtn' => _LISTS_DELETE,
\r
1095 if ( isset($current->mname) )
\r
1097 $data['commentator'] = Entity::hsc($current->mname) . ' ' . _LIST_COMMENTS_MEMBER;
\r
1101 $data['commentator'] = Entity::hsc($current->cuser);
\r
1103 if ( isset($current->cmail) && $current->cmail )
\r
1105 $data['commentsite'] = Entity::hsc($current->cmail);
\r
1109 $data['commentsite'] = '';
\r
1111 if ( isset($current->cemail) && $current->cemail )
\r
1113 $data['commentmail'] = Entity::hsc($current->cemail);
\r
1117 $data['commentmail'] = '';
\r
1119 if ( $vars['canAddBan'] )
\r
1121 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) )
\r
1123 $subTpl = "<td style=\"white-space:nowrap\"><a href=\"index.php?action=banlistnewfromitem&itemid=<%itemid%>&ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%></a></td>\n";
\r
1127 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN'];
\r
1130 'itemid' => $current->citem,
\r
1131 'banip' => Entity::hsc($current->cip),
\r
1132 'banbtn' => _LIST_COMMENT_BANIP,
\r
1134 $data['addbanlist'] = Template::fill($subTpl, $subData);
\r
1138 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT']) )
\r
1144 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT'];
\r
1146 $subData = array();
\r
1149 return Template::fill($template, $data);
\r
1152 function listplug_table_bloglist($vars, $type, $templateName = '')
\r
1154 $templates = array();
\r
1155 if ( !empty($templateName) )
\r
1157 $templates = Template::read($templateName);
\r
1163 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD']) )
\r
1165 $template = "<th><%blognames%></th>\n"
\r
1166 . "<th colspan=\"7\"><%actionshead%></th>\n";
\r
1170 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD'];
\r
1173 'blognames' => _NAME,
\r
1174 'actionshead' => _LISTS_ACTIONS,
\r
1178 $current = $vars['current'];
\r
1179 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY']) )
\r
1181 $template = "<td title=\"blogid:<%blogid%> shortname:<%shortname%>\">\n"
\r
1182 . "<a href=\"<%blogurl%>\"><img src=\"images/globe.gif\" width=\"13\" height=\"13\" alt=\"<%iconalt%>\" /></a><%blogname%></td>\n"
\r
1183 . "<td><a href=\"index.php?action=createitem&blogid=<%blogid%>\" title=\"<%ttaddtext%>\"><%addtext%></a></td>\n"
\r
1184 . "<td><a href=\"index.php?action=itemlist&blogid=<%blogid%>\" title=\"<%ttedittext%>\"><%edittext%></a></td>\n"
\r
1185 . "<td><a href=\"index.php?action=blogcommentlist&blogid=<%blogid%>\" title=\"<%ttcommenttext%>\"><%commenttext%></a></td>\n"
\r
1186 . "<td><a href=\"index.php?action=bookmarklet&blogid=<%blogid%>\" title=\"<%ttbmlettext%>\"><%bmlettext%></a></td>\n";
\r
1190 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY'];
\r
1193 'blogid' => $current->bnumber,
\r
1194 'shortname' => Entity::hsc($current->bshortname),
\r
1195 'blogurl' => $current->burl,
\r
1196 'blogname' => Entity::hsc($current->bname),
\r
1197 'ttaddtext' => _BLOGLIST_TT_ADD,
\r
1198 'addtext' => _BLOGLIST_ADD,
\r
1199 'ttedittext' => _BLOGLIST_TT_EDIT,
\r
1200 'edittext' => _BLOGLIST_EDIT,
\r
1201 'ttcommenttext' => _BLOGLIST_TT_COMMENTS,
\r
1202 'commenttext' => _BLOGLIST_COMMENTS,
\r
1203 'ttbmlettext' => _BLOGLIST_TT_BMLET,
\r
1204 'bmlettext' => _BLOGLIST_BMLET,
\r
1206 if ( $current->tadmin == 1 )
\r
1208 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
\r
1210 $template .= "<td><a href=\"index.php?action=blogsettings&blogid=<%blogid%>\" title=\"<%ttsettingtext%>\"><%settingtext%></a></td>\n"
\r
1211 . "<td><a href=\"index.php?action=banlist&blogid=<%blogid%>\" title=\"<%ttbanstext%>\"><%banstext%></a></td>\n";
\r
1215 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
\r
1217 $data['ttsettingtext'] = _BLOGLIST_TT_SETTINGS;
\r
1218 $data['settingtext'] = _BLOGLIST_SETTINGS;
\r
1219 $data['ttbanstext'] = _BLOGLIST_TT_BANS;
\r
1220 $data['banstext'] = _BLOGLIST_BANS;
\r
1223 if ( $vars['superadmin'] )
\r
1225 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
\r
1227 $template .= "<td><a href=\"index.php?action=deleteblog&blogid=<%blogid%>\" title=\"<%ttdeletetext%>\"><%deletetext%></a></td>\n";
\r
1231 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
\r
1233 $data['ttdeletetext'] = _BLOGLIST_TT_DELETE;
\r
1234 $data['deletetext'] = _BLOGLIST_DELETE;
\r
1238 $current = $vars['current'];
\r
1239 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) )
\r
1245 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT'];
\r
1250 return Template::fill($template, $data);
\r
1253 function listplug_table_shortblognames($vars, $type, $templateName = '')
\r
1255 $templates = array();
\r
1256 if ( !empty($templateName) )
\r
1258 $templates = Template::read($templateName);
\r
1264 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD']) )
\r
1266 $template = "<th><%colshortname%></th>\n"
\r
1267 . "<th><%colblogname%></th>\n";
\r
1271 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD'];
\r
1274 'colshortname' => _EBLOG_SHORTNAME,
\r
1275 'colblogname' => _EBLOG_NAME,
\r
1279 $current = $vars['current'];
\r
1280 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']) )
\r
1282 $template = "<td><%bshortname%></td>\n"
\r
1283 . "<td><%blogname%></td>\n";
\r
1287 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY'];
\r
1290 'bshortname' => Entity::hsc($current->bshortname),
\r
1291 'blogname' => Entity::hsc($current->bname),
\r
1295 $current = $vars['current'];
\r
1296 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT']) )
\r
1302 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT'];
\r
1307 return Template::fill($template, $data);
\r
1310 function listplug_table_shortnames($vars, $type, $templateName = '')
\r
1313 $templates = array();
\r
1314 if ( !empty($templateName) )
\r
1316 $templates = Template::read($templateName);
\r
1322 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD'. $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD']) )
\r
1324 $template = "<th><%colname%></th>\n"
\r
1325 . "<th><%coldesc%></th>\n";
\r
1329 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD'];
\r
1332 'colname' => _NAME,
\r
1333 'coldesc' => _LISTS_DESC,
\r
1337 $current = $vars['current'];
\r
1338 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']) )
\r
1340 $template = "<td><%name%></td>\n"
\r
1341 . "<td><%desc%></td>\n";
\r
1345 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY'];
\r
1348 'name' => Entity::hsc($current->name),
\r
1349 'desc' => Entity::hsc($current->description),
\r
1353 $current = $vars['current'];
\r
1354 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT'. $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT']) )
\r
1360 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT'];
\r
1365 return Template::fill($template, $data);
\r
1368 function listplug_table_categorylist($vars, $type, $templateName = '')
\r
1370 $templates = array();
\r
1371 if ( !empty($templateName) )
\r
1373 $templates = Template::read($templateName);
\r
1379 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD']) )
\r
1381 $template = "<th><%colname%></th>\n"
\r
1382 . "<th><%coldesc%></th>\n"
\r
1383 . "<th colspan=\"2\"><%colact%></th>\n";
\r
1387 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD'];
\r
1390 'colname' => _LISTS_NAME,
\r
1391 'coldesc' => _LISTS_DESC,
\r
1392 'colact' => _LISTS_ACTIONS,
\r
1396 $current = $vars['current'];
\r
1397 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY']) )
\r
1399 $template = "<td>\n"
\r
1400 . "<input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%catid%>\" />\n"
\r
1401 . "<label for=\"batch<%batchid%>\"><%catname%></label>\n"
\r
1403 . "<td><%catdesc%></td>\n"
\r
1404 . "<td><a href=\"index.php?action=categoryedit&blogid=<%blogid%>&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a></td>\n"
\r
1405 . "<td><a href=\"index.php?action=categorydelete&blogid=<%blogid%>&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a></td>\n";
\r
1409 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY'];
\r
1413 'batchid' => listplug_nextBatchId(),
\r
1414 'catid' => intval($current->catid),
\r
1415 'catname' => Entity::hsc($current->cname),
\r
1416 'catdesc' => Entity::hsc($current->cdesc),
\r
1417 'blogid' => intval($current->catcblogid),
\r
1418 'tabindex' => intval($vars['tabindex']),
\r
1419 'editbtn' => _LISTS_EDIT,
\r
1420 'delbtn' => _LISTS_DELETE,
\r
1424 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT']) )
\r
1430 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT'];
\r
1435 return Template::fill($template, $data);
\r
1438 function listplug_table_templatelist($vars, $type, $templateName = '')
\r
1442 $templates = array();
\r
1443 if ( !empty($templateName) )
\r
1445 $templates = Template::read($templateName);
\r
1451 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
\r
1453 $template = "<th><%colname%></th>\n"
\r
1454 . "<th><%coldesc%></th>\n"
\r
1455 . "<th colspan=\"3\"><%colact%></th>\n";
\r
1459 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
\r
1462 'colname' => _LISTS_NAME,
\r
1463 'coldesc' => _LISTS_DESC,
\r
1464 'colact' => _LISTS_ACTIONS,
\r
1468 $current = $vars['current'];
\r
1469 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
\r
1471 $template = "<td><%templatename%></td>\n"
\r
1472 . "<td><%templatedesc%></td>\n"
\r
1473 . "<td style=\"white-space:nowrap\">"
\r
1474 . "<a href=\"index.php?action=templateedit&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>\n"
\r
1476 . "<td style=\"white-space:nowrap\">\n"
\r
1477 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>\n"
\r
1479 . "<td style=\"white-space:nowrap\">\n"
\r
1480 . "<a href=\"index.php?action=templatedelete&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>\n"
\r
1485 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
\r
1488 $url = "index.php?action=templateclone&templateid={$current->tdnumber}";
\r
1490 'templatename' => Entity::hsc($current->tdname),
\r
1491 'templatedesc' => Entity::hsc($current->tddesc),
\r
1492 'templateid' => (integer) $current->tdnumber,
\r
1493 'tabindex' => (integer) $vars['tabindex'],
\r
1494 'cloneurl' => Entity::hsc($manager->addTicketToUrl($url)),
\r
1495 'editbtn' => _LISTS_EDIT,
\r
1496 'clonebtn' => _LISTS_CLONE,
\r
1497 'delbtn' => _LISTS_DELETE,
\r
1501 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
\r
1507 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
\r
1512 return Template::fill($template, $data);
\r
1515 function listplug_table_skinlist($vars, $type, $templateName = '')
\r
1517 global $CONF, $DIR_SKINS, $manager;
\r
1519 $templates = array();
\r
1520 if ( !empty($templateName) )
\r
1522 $templates = Template::read($templateName);
\r
1528 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
\r
1530 $template = "<th><%colname%></th>\n"
\r
1531 . "<th><%coldesc%></th>\n"
\r
1532 . "<th colspan=\"3\"><%colact%></th>\n";
\r
1536 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
\r
1539 'colname' => _LISTS_NAME,
\r
1540 'coldesc' => _LISTS_DESC,
\r
1541 'colact' => _LISTS_ACTIONS,
\r
1545 $current = $vars['current'];
\r
1546 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
\r
1548 $template = "<td><%skinname%><br /><br />\n"
\r
1549 . "<%skintypelabel%> <%skintype%><br />\n"
\r
1550 . "<%incmodelabel%> <%incmode%><br />\n"
\r
1551 . "<%incpreflabel%> <%incpref%><br />\n"
\r
1553 . "<%readme%></td>\n"
\r
1554 . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"
\r
1555 . "<td style=\"white-space:nowrap\">"
\r
1556 . "<a href=\"index.php?action=skinedit&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%>"
\r
1558 . "<td style=\"white-space:nowrap\">"
\r
1559 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
\r
1561 . "<td style=\"white-space:nowrap\">"
\r
1562 . "<a href=\"index.php?action=skindelete&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%>"
\r
1567 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
\r
1570 $url = $manager->addTicketToUrl('index.php?action=skinclone&skinid=' . intval($current->sdnumber));
\r
1572 'skintypelabel' => _LISTS_TYPE,
\r
1573 'skintype' => Entity::hsc($current->sdtype),
\r
1574 'incmodelabel' => _LIST_SKINS_INCMODE,
\r
1575 'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
\r
1576 'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',
\r
1577 'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',
\r
1578 'skindesc' => Entity::hsc($current->sddesc),
\r
1579 'skinid' => (integer) $current->sdnumber,
\r
1580 'tabindex' => $vars['tabindex'],
\r
1581 'cloneurl' => Entity::hsc($url),
\r
1582 'editbtn' => _LISTS_EDIT,
\r
1583 'clonebtn' => _LISTS_CLONE,
\r
1584 'delbtn' => _LISTS_DELETE,
\r
1587 // use a special style for the default skin
\r
1588 if ( $current->sdnumber != $CONF['BaseSkin'] )
\r
1590 $data['skinname'] = Entity::hsc($current->sdname);
\r
1594 $data['skinname'] = '<strong>' . Entity::hsc($current->sdname) . '</strong>';
\r
1597 // add preview image when present
\r
1598 if ( $current->sdincpref && @file_exists("{$DIR_SKINS}{$current->sdincpref}preview.png") )
\r
1600 $data['skinthumb'] = "<p>\n";
\r
1602 $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
\r
1603 $has_enlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');
\r
1604 if ( $has_enlargement )
\r
1606 $data['skinthumb'] .= '<a href="' . $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
\r
1608 $data['skinthumb'] .= '<img class="skinpreview" src="' . $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
\r
1609 if ( $has_enlargement )
\r
1611 $data['skinthumb'] .= "</a><br />\n";
\r
1614 if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
\r
1616 $url = $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'readme.html';
\r
1617 $title = sprintf(_LIST_SKIN_README, $current->sdname);
\r
1618 $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
\r
1622 $data['readme'] ="";
\r
1625 $data['skinthumb'] .= "</p>\n";
\r
1628 $skin = new Skin($current->sdnumber);
\r
1629 $available_skin_types = $skin->getAvailableTypes();
\r
1631 $data['skinparts'] = _LIST_SKINS_DEFINED;
\r
1632 $data['skinparts'] .= "<ul>\n";
\r
1633 foreach ( $available_skin_types as $type => $friendlyName )
\r
1635 if ( $friendlyName === FALSE )
\r
1637 $friendlyName = ucfirst($type);
\r
1638 $article = 'skinpartspecial';
\r
1642 $article = "skinpart{$type}";
\r
1644 $data['skinparts'] .= "<li>\n"
\r
1645 . helpHtml($article) . "\n"
\r
1646 . "<a href=\"index.php?action=skinedittype&skinid={$current->sdnumber}&type={$type}\" tabindex=\"{$vars['tabindex']}\">"
\r
1647 . Entity::hsc($friendlyName)
\r
1651 $data['skinparts'] .= "</ul>\n";
\r
1654 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
\r
1660 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
\r
1665 return Template::fill($template, $data);
\r
1668 function listplug_table_draftlist($vars, $type, $templateName = '')
\r
1670 $templates = array();
\r
1671 if ( !empty($templateName) )
\r
1673 $templates = Template::read($templateName);
\r
1678 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD']) )
\r
1680 $template = "<th><%colblog%></th>\n"
\r
1681 . "<th><%coldesc%></th>\n"
\r
1682 . "<th colspan=\"2\"><%colact%></th>\n";
\r
1686 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD'];
\r
1689 'colblog' => _LISTS_BLOG,
\r
1690 'coldesc' => _LISTS_TITLE,
\r
1691 'colact' => _LISTS_ACTIONS,
\r
1695 $current = $vars['current'];
\r
1696 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY']) )
\r
1698 $template = "<td><%bshortname%></td>\n"
\r
1699 . "<td><%ititle%></td>\n"
\r
1700 . "<td><a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a></td>\n"
\r
1701 . "<td><a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a></td>\n";
\r
1705 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY'];
\r
1708 'bshortname' => Entity::hsc($current->bshortname),
\r
1709 'ititle' => Entity::hsc(strip_tags($current->ititle)),
\r
1710 'itemid' => intval($current->inumber),
\r
1711 'editbtn' => _LISTS_EDIT,
\r
1712 'delbtn' => _LISTS_DELETE,
\r
1716 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT']) )
\r
1722 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT'];
\r
1727 return Template::fill($template, $data);
\r
1730 function listplug_table_otherdraftlist($vars, $type, $templateName = '')
\r
1732 $templates = array();
\r
1733 if ( !empty($templateName) )
\r
1735 $templates = Template::read($templateName);
\r
1741 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD']) )
\r
1743 $template = "<th><%colblog%></th>\n"
\r
1744 . "<th><%coldesc%></th>\n"
\r
1745 . "<th><%colautr%></th>\n"
\r
1746 . "<th colspan=\"2\"><%colact%></th>\n";
\r
1750 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD'];
\r
1753 'colblog' => _LISTS_BLOG,
\r
1754 'coldesc' => _LISTS_TITLE,
\r
1755 'colautr' => _LISTS_AUTHOR,
\r
1756 'colact' => _LISTS_ACTIONS,
\r
1760 $current = $vars['current'];
\r
1761 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY']) )
\r
1763 $template = "<td><%bshortname%></td>\n"
\r
1764 . "<td><%ititle%></td>\n"
\r
1765 . "<td><%iauthor%></td>\n"
\r
1766 . "<td><a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a></td>\n"
\r
1767 . "<td><a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a></td>\n";
\r
1771 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY'];
\r
1774 'bshortname' => Entity::hsc($current->bshortname),
\r
1775 'ititle' => Entity::hsc(strip_tags($current->ititle)),
\r
1776 'iauthor' => Entity::hsc(strip_tags($current->mname)),
\r
1777 'itemid' => intval($current->inumber),
\r
1778 'editbtn' => _LISTS_EDIT,
\r
1779 'delbtn' => _LISTS_DELETE,
\r
1783 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT']) )
\r
1789 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT'];
\r
1794 return Template::fill($template, $data);
\r
1797 function listplug_table_actionlist($vars, $type, $templateName = '')
\r
1799 $templates = array();
\r
1800 if ( !empty($templateName) )
\r
1802 $templates = Template::read($templateName);
\r
1808 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD']) )
\r
1810 $template = "<th><%coltime%></th>\n"
\r
1811 . "<th><%colmesg%></th>\n";
\r
1815 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD'];
\r
1818 'coltime' => _LISTS_TIME,
\r
1819 'colmesg' => _LIST_ACTION_MSG,
\r
1823 $current = $vars['current'];
\r
1824 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']) )
\r
1826 $template = "<td><%timestamp%></td>\n"
\r
1827 . "<td><%message%></td>\n";
\r
1831 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY'];
\r
1834 'timestamp' => Entity::hsc($current->timestamp),
\r
1835 'message' => Entity::hsc($current->message),
\r
1839 $current = $vars['current'];
\r
1840 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT']) )
\r
1846 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT'];
\r
1851 return Template::fill($template, $data);
\r
1854 function listplug_table_banlist($vars, $type, $templateName = '')
\r
1856 $templates = array();
\r
1857 if ( !empty($templateName) )
\r
1859 $templates = Template::read($templateName);
\r
1865 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD']) )
\r
1867 $template = "<th><%iprange%></th>\n"
\r
1868 . "<th><%reason%></th>\n"
\r
1869 . "<th><%colact%></th>\n";
\r
1873 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD'];
\r
1876 'iprange' => _LIST_BAN_IPRANGE,
\r
1877 'reason' => _LIST_BAN_REASON,
\r
1878 'colact' => _LISTS_ACTIONS,
\r
1882 $current = $vars['current'];
\r
1883 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY'. $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']) )
\r
1885 $template = "<td><%iprange%></td>\n"
\r
1886 . "<td><%reason%></td>\n"
\r
1887 . "<td><a href=\"index.php?action=banlistdelete&blogid=<%blogid%>&iprange=<%iprange%>\"><%delbtn%></a></td>\n";
\r
1891 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY'];
\r
1894 'iprange' => Entity::hsc($current->iprange),
\r
1895 'reason' => Entity::hsc($current->reason),
\r
1896 'blogid' => intval($current->blogid),
\r
1897 'delbtn' => _LISTS_DELETE,
\r
1901 $current = $vars['current'];
\r
1902 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT']) )
\r
1908 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT'];
\r
1913 return Template::fill($template, $data);
\r
1916 function listplug_table_adminskinlist($vars, $type, $templateName = '')
\r
1918 global $CONF, $DIR_SKINS, $DIR_NUCLEUS, $manager;
\r
1920 $adminSkinURL = $CONF['SkinsURL'] . 'admin/';
\r
1921 $adminSkinDir = $DIR_SKINS . 'admin/';
\r
1923 $templates = array();
\r
1924 if ( !empty($templateName) )
\r
1926 $templates = Template::read($templateName);
\r
1931 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
\r
1933 $template = "<th><%colname%></th>\n"
\r
1934 . "<th><%coldesc%></th>\n"
\r
1935 . "<th colspan=\"3\"><%colact%></th>\n";
\r
1939 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
\r
1942 'colname' => _LISTS_NAME,
\r
1943 'coldesc' => _LISTS_DESC,
\r
1944 'colact' => _LISTS_ACTIONS,
\r
1948 $current = $vars['current'];
\r
1949 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
\r
1951 $template = "<td><%skinname%><br /><br />\n"
\r
1952 . "<%skintypelabel%> <%skintype%><br />\n"
\r
1953 . "<%incmodelabel%> <%incmode%><br />\n"
\r
1954 . "<%incpreflabel%> <%incpref%><br />\n"
\r
1956 . "<%readme%></td>\n"
\r
1957 . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"
\r
1958 . "<td style=\"white-space:nowrap\">"
\r
1959 . "<a href=\"index.php?action=adminskinedit&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%>"
\r
1961 . "<td style=\"white-space:nowrap\">"
\r
1962 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
\r
1964 . "<td style=\"white-space:nowrap\">"
\r
1965 . "<a href=\"index.php?action=adminskindelete&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%>"
\r
1970 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
\r
1973 $url = $manager->addTicketToUrl('index.php?action=adminskinclone&skinid=' . intval($current->sdnumber));
\r
1975 'skintypelabel' => _LISTS_TYPE,
\r
1976 'skintype' => Entity::hsc($current->sdtype),
\r
1977 'incmodelabel' => _LIST_SKINS_INCMODE,
\r
1978 'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
\r
1979 'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',
\r
1980 'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',
\r
1981 'skindesc' => Entity::hsc($current->sddesc),
\r
1982 'skinid' => (integer) $current->sdnumber,
\r
1983 'tabindex' => $vars['tabindex'],
\r
1984 'cloneurl' => Entity::hsc($url),
\r
1985 'editbtn' => _LISTS_EDIT,
\r
1986 'clonebtn' => _LISTS_CLONE,
\r
1987 'delbtn' => _LISTS_DELETE,
\r
1990 // use a special style for the default skin
\r
1991 if ( $current->sdnumber != $CONF['DefaultAdminSkin'] )
\r
1993 $data['skinname'] = Entity::hsc($current->sdname);
\r
1997 $data['skinname'] = '<strong>' . Entity::hsc($current->sdname) . '</strong>';
\r
2000 // add preview image when present
\r
2001 if ( $current->sdincpref && @file_exists("{$adminSkinDir}{$current->sdincpref}preview.png") )
\r
2003 $data['skinthumb'] = "<p>\n";
\r
2005 $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
\r
2006 $has_enlargement = @file_exists($adminSkinDir . $current->sdincpref . 'preview-large.png');
\r
2007 if ( $has_enlargement )
\r
2009 $data['skinthumb'] .= '<a href="' . $adminSkinURL . Entity::hsc($current->sdincpref) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
\r
2011 $data['skinthumb'] .= '<img class="skinpreview" src="' . $adminSkinURL . Entity::hsc($current->sdincpref) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
\r
2012 if ( $has_enlargement )
\r
2014 $data['skinthumb'] .= "</a><br />\n";
\r
2017 if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
\r
2019 $url = $adminSkinURL . Entity::hsc($current->sdincpref) . 'readme.html';
\r
2020 $title = sprintf(_LIST_SKIN_README, $current->sdname);
\r
2021 $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
\r
2025 $data['readme'] ="";
\r
2028 $data['skinthumb'] .= "</p>\n";
\r
2031 $skin = new Skin($current->sdnumber, 'AdminActions');
\r
2032 $available_skin_types = $skin->getAvailableTypes();
\r
2034 $data['skinparts'] = _LIST_SKINS_DEFINED;
\r
2035 $data['skinparts'] .= "<ul>\n";
\r
2036 foreach ( $available_skin_types as $type => $friendlyName )
\r
2038 if ( $friendlyName === FALSE )
\r
2040 $friendlyName = ucfirst($type);
\r
2041 $article = 'skinpartspecial';
\r
2045 $article = "skinpart{$type}";
\r
2047 $data['skinparts'] .= "<li>\n"
\r
2048 . helpHtml($article) . "\n"
\r
2049 . "<a href=\"index.php?action=adminskinedittype&skinid={$current->sdnumber}&type={$type}\" tabindex=\"{$vars['tabindex']}\">"
\r
2050 . Entity::hsc($friendlyName)
\r
2054 $data['skinparts'] .= "</ul>\n";
\r
2057 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
\r
2063 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
\r
2068 return Template::fill($template, $data);
\r
2071 function listplug_table_admintemplatelist($vars, $type, $templateName = '')
\r
2075 $templates = array();
\r
2076 if ( !empty($templateName) )
\r
2078 $templates = Template::read($templateName);
\r
2084 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
\r
2086 $template = "<th><%colname%></th>\n"
\r
2087 . "<th><%coldesc%></th>\n"
\r
2088 . "<th colspan=\"3\"><%colact%></th>\n";
\r
2092 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
\r
2095 'colname' => _LISTS_NAME,
\r
2096 'coldesc' => _LISTS_DESC,
\r
2097 'colact' => _LISTS_ACTIONS,
\r
2101 $current = $vars['current'];
\r
2102 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
\r
2104 $template = "<td><%templatename%></td>\n"
\r
2105 . "<td><%templatedesc%></td>\n"
\r
2106 . "<td style=\"white-space:nowrap\">"
\r
2107 . "<a href=\"index.php?action=admintemplateedit&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>\n"
\r
2109 . "<td style=\"white-space:nowrap\">\n"
\r
2110 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>\n"
\r
2112 . "<td style=\"white-space:nowrap\">\n"
\r
2113 . "<a href=\"index.php?action=admintemplatedelete&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>\n"
\r
2118 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
\r
2120 $url = "index.php?action=admintemplateclone&templateid={$current->tdnumber}";
\r
2122 'templatename' => Entity::hsc($current->tdname),
\r
2123 'templatedesc' => Entity::hsc($current->tddesc),
\r
2124 'templateid' => (integer) $current->tdnumber,
\r
2125 'tabindex' => (integer) $vars['tabindex'],
\r
2126 'cloneurl' => Entity::hsc($manager->addTicketToUrl($url)),
\r
2127 'editbtn' => _LISTS_EDIT,
\r
2128 'clonebtn' => _LISTS_CLONE,
\r
2129 'delbtn' => _LISTS_DELETE,
\r
2133 if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
\r
2139 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
\r
2144 return Template::fill($template, $data);
\r