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, $template, $templateName = '')
\r
24 if ( is_array($query) )
\r
26 if ( sizeof($query) == 0 )
\r
31 call_user_func("listplug_{$type}", $template, 'HEAD', $templateName);
\r
33 foreach ( $query as $currentObj )
\r
35 $template['current'] = $currentObj;
\r
36 call_user_func("listplug_{$type}", $template, 'BODY', $templateName);
\r
39 call_user_func("listplug_{$type}", $template, '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}", $template, 'HEAD', $templateName);
\r
55 while( $template['current'] = sql_fetch_object($res) )
\r
57 call_user_func("listplug_{$type}", $template, 'BODY', $templateName);
\r
60 call_user_func("listplug_{$type}", $template, 'FOOT', $templateName);
\r
62 sql_free_result($res);
\r
64 // return amount of results
\r
69 function listplug_select($vars, $type, $templateName = '')
\r
71 $templates = array();
\r
72 if ( !empty($templateName) )
\r
74 $templates = Template::read($templateName);
\r
79 if ( isset($templates['SHOWLIST_LISTPLUG_SELECT_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_SELECT_HEAD']) )
\r
81 $template = $templates['SHOWLIST_LISTPLUG_SELECT_HEAD'];
\r
85 $template = "<select<%name%><%tabindex%><%javascript%>>\n<%extraoption%>\n";
\r
88 'name' => isset($vars['name']) ? ' name="' . $vars['name'] . '"' : '',
\r
89 'tabindex' => isset($vars['tabindex']) ? ' tabindex="' . $vars['tabindex'] . '"' : '',
\r
90 'javascript' => isset($vars['javascript']) ? ' ' . $vars['javascript'] : '',
\r
92 $data ['extraoption'] = isset($vars['extra']) ?
\r
93 '<option value="' . $vars['extra'] . '">' . $vars['extra'] . "</option>" :
\r
97 $current = $vars['current'];
\r
98 if ( isset($templates['SHOWLIST_LISTPLUG_SELECT_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_SELECT_BODY']) )
\r
100 $template = $templates['SHOWLIST_LISTPLUG_SELECT_BODY'];
\r
104 $template = '<option value="<%value%>"<%selected%><%title%>><%option%></option>' . "\n";
\r
107 'value' => Entity::hsc($current->value),
\r
108 'selected' => ($vars['selected'] == $current->value) ? ' selected="selected"' : '',
\r
110 if ( isset($vars['shorten']) && $vars['shorten'] > 0 )
\r
112 $data['title'] = ' title="' . Entity::hsc($current->text) . '"';
\r
113 $current->text = Entity::hsc(Entity::shorten($current->text, $vars['shorten'], $vars['shortenel']));
\r
117 $data['title'] = '';
\r
119 $data['option'] = Entity::hsc($current->text);
\r
122 if ( isset($templates['SHOWLIST_LISTPLUG_SELECT_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_SELECT_FOOT']) )
\r
124 $template = $templates['SHOWLIST_LISTPLUG_SELECT_FOOT'];
\r
128 $template = "</select>\n";
\r
133 if ( !class_exists('Actions') )
\r
136 include $DIR_LIBS . 'ACTIONS.php';
\r
138 $template = Template::fill($template, $data);
\r
139 $handler = new Actions('template', $template, $data);
\r
140 $parser = new PARSER(Actions::getDefinedActions(), $handler);
\r
141 $parser->parse($template);
\r
145 function listplug_table($vars, $type, $templateName = '')
\r
147 $templates = array();
\r
148 if ( !empty($templateName) )
\r
150 $templates = Template::read($templateName);
\r
155 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_HEAD']) )
\r
157 $template = $templates['SHOWLIST_LISTPLUG_TABLE_HEAD'];
\r
161 $template = "<table><thead><tr>\n<%typehead%>\n</tr></thead><tbody>\n";
\r
164 'typehead' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'HEAD', $templateName)
\r
168 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BODY']) )
\r
170 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BODY'];
\r
174 $template = "<tr onmouseover=\"focusRow(this);\" onmouseout=\"blurRow(this);\"><%typebody%>\n</tr>\n";
\r
176 // tabletype specific thingies
\r
178 'typebody' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'BODY', $templateName)
\r
182 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_FOOT']) )
\r
184 $template = $templates['SHOWLIST_LISTPLUG_TABLE_FOOT'];
\r
188 $template = "<%typefoot%>\n</tbody></table>\n";
\r
190 // tabletype specific thingies
\r
192 'typefoot' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'FOOT', $templateName)
\r
196 $template = Template::fill($template, $data);
\r
197 if ( !class_exists('Actions') )
\r
200 include $DIR_LIBS . 'ACTIONS.php';
\r
202 $handler = new Actions('template', $template, $data);
\r
203 $parser = new PARSER(Actions::getDefinedActions(), $handler);
\r
204 $parser->parse($template);
\r
208 function listplug_table_memberlist($vars, $type, $templateName = '')
\r
210 $templates = array();
\r
211 if ( !empty($templateName) )
\r
213 $templates = Template::read($templateName);
\r
218 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD']) )
\r
220 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD'];
\r
224 $template = "<th><%colmembername%></th>\n"
\r
225 . "<th><%colmemberrname%></th>\n"
\r
226 . "<th><%colmemberurl%></th>\n"
\r
227 . "<th><%colmemberadmin%><%helplink(superadmin)%></th>\n"
\r
228 . "<th><%colmemberlogin%><%helplink(canlogin)%></th>\n"
\r
229 . "<th colspan=\"2\"><%colactions%></th>\n";
\r
232 'colmembername' => _LIST_MEMBER_NAME,
\r
233 'colmemberrname' => _LIST_MEMBER_RNAME,
\r
234 'colmemberurl' => _LIST_MEMBER_URL,
\r
235 'colmemberadmin' => _LIST_MEMBER_ADMIN,
\r
236 'colmemberlogin' => _LIST_MEMBER_LOGIN,
\r
237 'colactions' => _LISTS_ACTIONS,
\r
241 $current = $vars['current'];
\r
242 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY']) )
\r
244 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY'];
\r
248 $template = "<td>\n"
\r
249 . "<input type=\"checkbox\" id=\"batch<%id%>\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
\r
250 . "<label for=\"batch<%id%>\">\n"
\r
251 . "<a href=\"mailto:<%mailaddress%>\" tabindex=\"<%tabindex%>\"><%name%></a>\n"
\r
252 . "</label>\n</td>\n"
\r
253 . "<td><%realname%></td>\n"
\r
254 . "<td><a href=\"<%url%>\" tabindex=\"<%tabindex%>\"><%url%></a></td>\n"
\r
255 . "<td><%admin%></td>\n"
\r
256 . "<td><%login%></td>\n"
\r
257 . "<td><a href=\"index.php?action=memberedit&memberid=<%memberid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a></td>\n"
\r
258 . "<td><a href=\"index.php?action=memberdelete&memberid=<%memberid%>\" tabindex=\"<%tabindex%>\"><%deletebtn%></a></td>\n";
\r
261 'id' => listplug_nextBatchId(),
\r
262 'memberid' => $current->mnumber,
\r
263 'mailaddress' => Entity::hsc($current->memail),
\r
264 'tabindex' => $vars['tabindex'],
\r
265 'name' => Entity::hsc($current->mname),
\r
266 'realname' => Entity::hsc($current->mrealname),
\r
267 'url' => Entity::hsc($current->murl),
\r
268 'admin' => ($current->madmin ? _YES : _NO),
\r
269 'login' => ($current->mcanlogin ? _YES : _NO),
\r
270 'editbtn' => _LISTS_EDIT,
\r
271 'deletebtn' => _LISTS_DELETE,
\r
275 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT']) )
\r
277 $template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT'];
\r
286 return Template::fill($template, $data);
\r
289 function listplug_table_teamlist($vars, $type, $templateName = '')
\r
292 $templates = array();
\r
293 if ( !empty($templateName) )
\r
295 $templates = Template::read($templateName);
\r
300 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD']) )
\r
302 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD'];
\r
306 $template = "<th><%colmembername%></th>\n"
\r
307 . "<th><%colmemberrname%></th>\n"
\r
308 . "<th><%colteamadmin%><%helplink(teamadmin)%></th>\n"
\r
309 . "<th colspan=\"2\"><%colactions%></th>\n";
\r
312 'colmembername' => _LIST_MEMBER_NAME,
\r
313 'colmemberrname' => _LIST_MEMBER_RNAME,
\r
314 'colteamadmin' => _LIST_TEAM_ADMIN,
\r
315 'colactions' => _LISTS_ACTIONS,
\r
319 $current = $vars['current'];
\r
320 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY']) )
\r
322 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY'];
\r
326 $template = "<td>\n"
\r
327 . "<input type=\"checkbox\" id=\"batch<%id%>\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
\r
328 . "<label for=\"batch<%id%>\">\n"
\r
329 . "<a href=\"mailto:<%mailaddress%>\" tabindex=\"<%tabindex%>\"><%name%></a>\n"
\r
330 . "</label>\n</td>\n"
\r
331 . "<td><%realname%></td>\n"
\r
332 . "<td><%admin%></td>\n"
\r
333 . "<td><a href=\"index.php?action=teamdelete&memberid=<%memberid%>&blogid=<%blogid%>\" tabindex=\"<%tabindex%>\"><%deletebtn%></a></td>\n"
\r
334 . "<td><a href=\"<%chadminurl%>\" tabindex=\"<%tabindex%>\"><%chadminbtn%></a></td>\n";
\r
336 $url = 'index.php?action=teamchangeadmin&memberid=' . intval($current->tmember) . '&blogid=' . intval($current->tblog);
\r
337 $url = $manager->addTicketToUrl($url);
\r
339 'id' => listplug_nextBatchId(),
\r
340 'memberid' => $current->tmember,
\r
341 'mailaddress' => Entity::hsc($current->memail),
\r
342 'tabindex' => $vars['tabindex'],
\r
343 'name' => Entity::hsc($current->mname),
\r
344 'realname' => Entity::hsc($current->mrealname),
\r
345 'admin' => ($current->tadmin ? _YES : _NO),
\r
346 'blogid' => $current->tblog,
\r
347 'deletebtn' => _LISTS_DELETE,
\r
348 'chadminurl' => Entity::hsc($url),
\r
352 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT']) )
\r
354 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT'];
\r
362 return Template::fill($template, $data);
\r
365 function listplug_table_pluginlist($vars, $type, $templateName = '')
\r
368 $templates = array();
\r
369 if ( !empty($templateName) )
\r
371 $templates = Template::read($templateName);
\r
376 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD']) )
\r
378 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD'];
\r
382 $template = "<th><%colinfo%></th>\n"
\r
383 . "<th><%coldesc%></th>\n"
\r
384 . "<th colspan=\"2\"><%colactions%></th>\n";
\r
387 'colinfo' => _LISTS_INFO,
\r
388 'coldesc' => _LISTS_DESC,
\r
389 'colactions' => _LISTS_ACTIONS,
\r
393 $current = $vars['current'];
\r
395 $plug =& $manager->getPlugin($current->pfile);
\r
398 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) )
\r
400 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY'];
\r
404 $template = "<td>\n"
\r
405 . "<strong><%plugname%></strong><br />\n"
\r
406 . "<%autherlabel%> <%plugauther%><br />\n"
\r
407 . "<%versionlabel%> <%plugversion%><br />\n"
\r
408 . "<%pluggeturl%><br />\n"
\r
411 . "<%desclabel%><br /><%plugdesc%>\n"
\r
412 . "<%eventlist%>\n"
\r
413 . "<%needupdate%>\n"
\r
414 . "<%dependlist%>\n"
\r
415 . "<%depreqlist%>\n"
\r
419 'plugname' => Entity::hsc($plug->getName()),
\r
420 'autherlabel' => _LIST_PLUGS_AUTHOR,
\r
421 'plugauther' => Entity::hsc($plug->getAuthor()),
\r
422 'versionlabel' => _LIST_PLUGS_VER,
\r
423 'plugversion' => Entity::hsc($plug->getVersion()),
\r
424 'tabindex' => $vars['tabindex'],
\r
425 'desclabel' => _LIST_PLUGS_DESC,
\r
426 'plugdesc' => Entity::hen($plug->getDescription()),
\r
428 if ( $plug->getURL() )
\r
430 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL']) )
\r
432 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL'];
\r
436 $subTpl = "<a href=\"<%plugurl%>\" tabindex=\"<%tabindex%>\"><%plugsite%></a>";
\r
439 'plugurl' => Entity::hsc($plug->getURL()),
\r
440 'tabindex' => $vars['tabindex'],
\r
441 'plugsite' => _LIST_PLUGS_SITE,
\r
443 $data['pluggeturl'] = Template::fill($subTpl, $subData);
\r
447 $data['pluggeturl'] = '';
\r
449 if ( count($plug->getEventList()) > 0 )
\r
451 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST']) )
\r
453 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST'];
\r
457 $subTpl = "<br /><br /><%evntlstlbl%><br /><%eventlist%>";
\r
460 'evntlstlbl' => _LIST_PLUGS_SUBS,
\r
461 'eventlist' => Entity::hsc(implode(', ', $plug->getEventList())),
\r
463 $data['eventlist'] = Template::fill($subTpl, $subData);
\r
467 $data['eventlist'] = '';
\r
469 if ( !$plug->subscribtionListIsUptodate() )
\r
471 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE']) )
\r
473 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE'];
\r
477 $subTpl = "<br /><br /><strong><%updatealert%></strong>";
\r
480 'updatealert' => _LIST_PLUG_SUBS_NEEDUPDATE,
\r
482 $data['needupdate'] = Template::fill($subTpl, $subData);
\r
486 $data['needupdate'] = '';
\r
488 if ( count($plug->getPluginDep() ) > 0)
\r
490 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND']) )
\r
492 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND'];
\r
496 $subTpl = "<br /><br /><%deplistlbl%><br /><%dependlist%>";
\r
499 'deplistlbl' => _LIST_PLUGS_DEP,
\r
500 'dependlist' => Entity::hsc(implode(', ', $plug->getPluginDep())),
\r
502 $data['dependlist'] = Template::fill($subTpl, $subData);
\r
506 $data['dependlist'] = '';
\r
508 /* check dependency */
\r
510 $res = sql_query('SELECT pfile FROM ' . sql_table('plugin'));
\r
511 while( $o = sql_fetch_object($res) )
\r
513 $preq =& $manager->getPlugin($o->pfile);
\r
516 $depList = $preq->getPluginDep();
\r
517 foreach ( $depList as $depName )
\r
519 if ( $current->pfile == $depName )
\r
521 $req[] = $o->pfile;
\r
527 if ( count($req) > 0 )
\r
529 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) )
\r
531 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ'];
\r
535 $subTpl = "<br /><br /><%deprlstlbl%><br /><%depreqlist%>";
\r
538 'deprlstlbl' => _LIST_PLUGS_DEPREQ,
\r
539 'depreqlist' => Entity::hsc(implode(', ', $req)),
\r
541 $data['depreqlist'] = Template::fill($subTpl, $subData);
\r
545 $data['depreqlist'] = '';
\r
550 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE']) )
\r
552 $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE'];
\r
556 $template = "<td colspan=\"2\"><%noplugalert%></td>\n";
\r
559 'noplugalert' => sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current->pfile)),
\r
562 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) )
\r
564 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN'];
\r
568 $template .= "<td>\n"
\r
569 . "<a href=\"<%actionupurl%>\" tabindex=\"<%tabindex%>\"><%actionuptxt%></a><br />\n"
\r
570 . "<a href=\"<%actiondownurl%>\" tabindex=\"<%tabindex%>\"><%actiondowntxt%></a><br />\n"
\r
571 . "<a href=\"<%actuninsturl%>\" tabindex=\"<%tabindex%>\"><%actuninsttxt%></a><br />"
\r
572 . "<%plugadminurl%>\n"
\r
573 . "<%plughelpurl%>\n"
\r
574 . "<%plugoptsetting%>\n"
\r
577 $baseUrl = 'index.php?plugid=' . $current->pid . '&action=';
\r
578 $upUrl = $manager->addTicketToUrl($baseUrl . 'pluginup');
\r
579 $downUrl = $manager->addTicketToUrl($baseUrl . 'plugindown');
\r
580 $data['actionuptxt'] = _LIST_PLUGS_UP;
\r
581 $data['actionupurl'] = Entity::hsc($upUrl);
\r
582 $data['actiondowntxt'] = _LIST_PLUGS_DOWN;
\r
583 $data['actiondownurl'] = Entity::hsc($downUrl);
\r
584 $data['actuninsttxt'] = _LIST_PLUGS_UNINSTALL;
\r
585 $data['actuninsturl'] = 'index.php?action=plugindelete&plugid=' . $current->pid;
\r
586 if ( $plug && ($plug->hasAdminArea() > 0) )
\r
588 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN']) )
\r
590 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN'];
\r
594 $subTpl = "<a href=\"<%actadminurl%>\" tabindex=\"<%tabindex%>\"><%actadmintxt%></a><br />\n";
\r
597 'actadminurl' => Entity::hsc($plug->getAdminURL()),
\r
598 'tabindex' => $vars['tabindex'],
\r
599 'actadmintxt' => _LIST_PLUGS_ADMIN,
\r
601 $data['plugadminurl'] = Template::fill($subTpl, $subData);
\r
605 $data['plugadminurl'] = '';
\r
607 if ( $plug && ($plug->supportsFeature('HelpPage') > 0) )
\r
609 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP']) )
\r
611 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP'];
\r
615 $subTpl = "<a href=\"<%acthelpurl%>\" tabindex=\"<%tabindex%>\"><%acthelptxt%></a><br />\n";
\r
618 'acthelpurl' => 'index.php?action=pluginhelp&plugid=' . $current->pid,
\r
619 'tabindex' => $vars['tabindex'],
\r
620 'acthelptxt' => _LIST_PLUGS_HELP,
\r
622 $data['plughelpurl'] = Template::fill($subTpl, $subData);
\r
626 $data['plughelpurl'] = '';
\r
628 $optQuery = 'SELECT '
\r
629 . ' COUNT(*) AS result '
\r
631 . sql_table('plugin_option_desc') . ' '
\r
633 . ' ocontext = "global" '
\r
635 $pOptions = quickQuery(sprintf($optQuery, $current->pid));
\r
636 if ( $pOptions > 0 )
\r
638 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) )
\r
640 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL'];
\r
644 $subTpl = "<a href=\"<%actoptionurl%>\" tabindex=\"<%tabindex%>\"><%actoptiontxt%></a>\n";
\r
647 'actoptionurl' => 'index.php?action=pluginoptions&plugid=' . $current->pid,
\r
648 'tabindex' => $vars['tabindex'],
\r
649 'actoptiontxt' => _LIST_PLUGS_OPTIONS,
\r
651 $data['plugoptsetting'] = Template::fill($subTpl, $subData);
\r
655 $data['plugoptsetting'] = '';
\r
659 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT']) )
\r
661 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT'];
\r
670 return Template::fill($template, $data);
\r
673 function listplug_table_plugoptionlist($vars, $type, $templateName = '')
\r
676 $templates = array();
\r
677 if ( !empty($templateName) )
\r
679 $templates = Template::read($templateName);
\r
684 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD']) )
\r
686 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD'];
\r
690 $template = "<th><%colinfo%></th><th><%colvalue%></th>\n";
\r
693 'colinfo' => _LISTS_INFO,
\r
694 'colvalue' => _LISTS_VALUE,
\r
698 $current = $vars['current'];
\r
699 $template = listplug_plugOptionRow($current, $templateName);
\r
703 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT']) )
\r
705 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT'];
\r
709 $template = "<tr>\n"
\r
710 . "<th colspan=\"2\"><%savetext%></th>"
\r
711 . "<th colspan=\"2\"><%savetext%></th>"
\r
712 . "<td><input type=\"submit\" value=\"<%savetext%>\" /></td>"
\r
716 'savetext' => _PLUGS_SAVE,
\r
720 return Template::fill($template, $data);
\r
723 function listplug_plugOptionRow($current, $templateName = '')
\r
725 $templates = array();
\r
726 if ( !empty($templateName) )
\r
728 $templates = Template::read($templateName);
\r
730 $varname = "plugoption[{$current['oid']}][{$current['contextid']}]";
\r
732 // retreive the optionmeta
\r
733 $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
\r
735 // only if it is not a hidden option write the controls to the page
\r
736 if ( in_array('access', $meta) && $meta['access'] == 'hidden' )
\r
742 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY']) )
\r
744 $template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY'];
\r
748 $template = "<td><%description%></td>\n<td>\n";
\r
751 switch($current['type'])
\r
754 $template .= AdminActions::input_yesno($varname, $current['value'], 0, 'yes', 'no', _YES, _NO, 0, $templateName, 1);
\r
757 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) )
\r
759 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD'];
\r
763 $template .= "<input type=\"password\" size=\"40\" maxlength=\"128\" name=\"<%varname%>\" value=\"<%value%>\" />\n";
\r
766 'varname' => Entity::hsc($varname),
\r
767 'value' => Entity::hsc($current['value']),
\r
771 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP']) )
\r
773 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP'];
\r
777 $template .= "<select name=\"<%varname%>\">\n";
\r
779 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO']) )
\r
781 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEO'];
\r
785 $subTpl = "<option value=\"<%value%>\"<%selected%>><%optname%></option>\n";
\r
787 $options = NucleusPlugin::getOptionSelectValues($current['typeinfo']);
\r
788 $options = i18n::explode('|', $options);
\r
790 for ( $i=0; $i<(count($options)-1); $i+=2 )
\r
793 'optname' => Entity::hsc($options[$i]),
\r
794 'value' => Entity::hsc($options[$i+1])
\r
796 if ($options[$i+1] == $current['value'])
\r
798 $subData['selected'] = ' selected="selected"';
\r
802 $subData['selected'] = '';
\r
804 $template .= Template::fill($subTpl, $subData);
\r
806 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC']) )
\r
808 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEC'];
\r
812 $template .= "</select>\n";
\r
814 $data['varname'] = Entity::hsc($varname);
\r
817 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA']) )
\r
819 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA'];
\r
823 $template .= "<textarea class=\"pluginoption\" cols=\"30\" rows=\"5\" name=\"<%varname%>\"<%readonly%>><%value%></textarea>";
\r
826 'varname' => Entity::hsc($varname),
\r
827 'value' => Entity::hsc($current['value'])
\r
829 if ( array_key_exists('access', $current) && $current['access'] == 'readonly')
\r
831 $data['readonly'] = ' readonly="readonly"';
\r
835 $data['readonly'] = '';
\r
840 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT']) )
\r
842 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT'];
\r
846 $template .= "<input type=\"text\" size=\"40\" maxlength=\"128\" name=\"<%varname%>\" value=\"<%value%>\"<%datatype%><%readonly%> />\n";
\r
849 'varname' => Entity::hsc($varname),
\r
850 'value' => Entity::hsc($current['value'])
\r
852 if ( array_key_exists('datatype', $current) && $current['datatype'] == 'numerical')
\r
854 $data['datatype'] = ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
\r
858 $data['datatype'] = '';
\r
860 if ( array_key_exists('access', $current) && $current['access'] == 'readonly')
\r
862 $data['readonly'] = ' readonly="readonly"';
\r
866 $data['readonly'] = '';
\r
869 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT']) )
\r
871 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT'];
\r
875 $template .= "<%extra%></td>\n";
\r
877 $data['extra'] = isset($current['extra']) ? $current['extra'] : '';
\r
878 $data['description'] = $current['description'] ? Entity::hsc($current['description']) : Entity::hsc($current['name']);
\r
880 return Template::fill($template, $data, 1);
\r
883 function listplug_table_itemlist($vars, $type, $templateName = '')
\r
886 $templates = array();
\r
887 if ( !empty($templateName) )
\r
889 $templates = Template::read($templateName);
\r
895 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) )
\r
897 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD'];
\r
901 $template = "<th><%colinfo%></th><th><%colcontent%></th><th style=\"white-space:nowrap\"><%colaction%></th>\n";
\r
904 'colinfo' => _LIST_ITEM_INFO,
\r
905 'colcontent' => _LIST_ITEM_CONTENT,
\r
906 'colaction' => _LISTS_ACTIONS
\r
910 $current = $vars['current'];
\r
911 // string -> unix timestamp
\r
912 $current->itime = strtotime($current->itime);
\r
913 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) )
\r
915 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY'];
\r
919 $template = "<td<%cssclass%>>\n"
\r
920 . "<%bshortlabel%> <%bshortnameval%><br />\n"
\r
921 . "<%categorylabel%> <%categorynameval%><br />\n"
\r
922 . "<%authorlabel%> <%authornameval%><br />\n"
\r
923 . "<%itemdatelabel%> <%itemdateval%><br />\n"
\r
924 . "<%itemtimelabel%> <%itemtimeval%>\n"
\r
926 . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch<%batchid%>\" value=\"<%itemid%>\" />\n"
\r
927 . "<label for=\"batch<%batchid%>\"><b><%itemtitle%></b></label><br />\n"
\r
930 . "<a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a><br />\n"
\r
932 . "<a href=\"index.php?action=itemmove&itemid=<%itemid%>\"><%movebtn%></a><br />\n"
\r
933 . "<a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a><br />\n"
\r
938 if ( $current->idraft == 1 )
\r
940 $cssclass = ' class="draft"';
\r
943 // (can't use offset time since offsets might vary between blogs)
\r
944 if ( $current->itime > $vars['now'] )
\r
946 $cssclass = ' class="future"';
\r
948 $body = strip_tags($current->ibody);
\r
950 'cssclass' => $cssclass,
\r
951 'bshortlabel' => _LIST_ITEM_BLOG,
\r
952 'bshortnameval' => Entity::hsc($current->bshortname),
\r
953 'categorylabel' => _LIST_ITEM_CAT,
\r
954 'categorynameval' => Entity::hsc($current->cname),
\r
955 'authorlabel' => _LIST_ITEM_AUTHOR,
\r
956 'authornameval' => Entity::hsc($current->mname),
\r
957 'itemdatelabel' => _LIST_ITEM_DATE,
\r
958 'itemdateval' => date("Y-m-d",$current->itime),
\r
959 'itemdatelabel' => _LIST_ITEM_TIME,
\r
960 'itemdateval' => date("H:i",$current->itime),
\r
961 'batchid' => listplug_nextBatchId(),
\r
962 'itemid' => $current->inumber,
\r
963 'itemtitle' => Entity::hsc(strip_tags($current->ititle)),
\r
964 'itembody' => Entity::hsc(Entity::shorten($body, 300, '...')),
\r
965 'editbtn' => _LISTS_EDIT,
\r
966 'movebtn' => _LISTS_MOVE,
\r
967 'delbtn' => _LISTS_DELETE,
\r
969 // evaluate amount of comments for the item
\r
970 $comment = new Comments($current->inumber);
\r
971 $camount = $comment->amountComments();
\r
972 if ( $camount > 0 )
\r
974 $data['camount'] = "<a href=\"index.php?action=itemcommentlist&itemid=\"{$current->inumber}\">(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")</a><br />\n";
\r
978 $data['camount'] = "<li>" . _LIST_ITEM_NOCONTENT . "</li>\n";
\r
982 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT']) )
\r
984 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT'];
\r
993 return Template::fill($template, $data);
\r
996 // for batch operations: generates the index numbers for checkboxes
\r
997 function listplug_nextBatchId()
\r
1003 function listplug_table_commentlist($vars, $type, $templateName = '')
\r
1005 $templates = array();
\r
1006 if ( !empty($templateName) )
\r
1008 $templates = Template::read($templateName);
\r
1013 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD']) )
\r
1015 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD'];
\r
1019 $template = "<th><%colinfo%></th>\n<th><%colcontent%></th>\n<th colspan=\"3\"><%colaction%></th>\n";
\r
1022 'colinfo' => _LISTS_INFO,
\r
1023 'colcontent' => _LIST_COMMENT,
\r
1024 'colaction' => _LISTS_ACTIONS
\r
1028 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) )
\r
1030 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY'];
\r
1034 $template = "<td><%commentdate%><br /><%commentator%><br /><%commentsite%><br /><%commentmail%><br /></td>\n"
\r
1035 . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />"
\r
1036 . "<label for=\"batch<%batchid%>\"><%commentbody%></label></td>\n"
\r
1037 . "<td style=\"white-space:nowrap\">"
\r
1038 . "<a href=\"index.php?action=commentedit&commentid=<%commentid%>\"><%editbtn%></a></td>\n"
\r
1039 . "<td style=\"white-space:nowrap\">"
\r
1040 . "<a href=\"index.php?action=commentdelete&commentid=<%commentid%>\"><%delbtn%></a></td>\n"
\r
1041 . "<%addbanlist%>";
\r
1043 $current = $vars['current'];
\r
1044 $body = strip_tags($current->cbody);
\r
1046 'commentdate' => date("Y-m-d@H:i", strtotime($current->ctime)),
\r
1047 'batchid' => listplug_nextBatchId(),
\r
1048 'commentid' => $current->cnumber,
\r
1049 'commentbody' => Entity::hsc(Entity::shorten($current->cbody, 300, '...')),
\r
1050 'editbtn' => _LISTS_EDIT,
\r
1051 'delbtn' => _LISTS_DELETE,
\r
1053 if ( isset($current->mname) )
\r
1055 $data['commentator'] = Entity::hsc($current->mname) . ' ' . _LIST_COMMENTS_MEMBER;
\r
1059 $data['commentator'] = Entity::hsc($current->cuser);
\r
1061 if ( isset($current->cmail) && $current->cmail )
\r
1063 $data['commentsite'] = Entity::hsc($current->cmail);
\r
1067 $data['commentsite'] = '';
\r
1069 if ( isset($current->cemail) && $current->cemail )
\r
1071 $data['commentmail'] = Entity::hsc($current->cemail);
\r
1075 $data['commentmail'] = '';
\r
1077 if ( $vars['canAddBan'] )
\r
1079 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) )
\r
1081 $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN'];
\r
1085 $subTpl = "<td style=\"white-space:nowrap\"><a href=\"index.php?action=banlistnewfromitem&itemid=<%itemid%>&ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%></a></td>\n";
\r
1088 'itemid' => $current->citem,
\r
1089 'banip' => Entity::hsc($current->cip),
\r
1090 'banbtn' => _LIST_COMMENT_BANIP,
\r
1092 $data['addbanlist'] = Template::fill($subTpl, $subData);
\r
1096 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT']) )
\r
1098 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT'];
\r
1104 $subData = array();
\r
1107 return Template::fill($template, $data);
\r
1110 function listplug_table_bloglist($vars, $type, $templateName = '')
\r
1112 $templates = array();
\r
1113 if ( !empty($templateName) )
\r
1115 $templates = Template::read($templateName);
\r
1120 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD']) )
\r
1122 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD'];
\r
1126 $template = "<th><%blognames%></th>\n<th colspan=\"7\"><%actionshead%></th>\n";
\r
1129 'blognames' => _NAME,
\r
1130 'actionshead' => _LISTS_ACTIONS,
\r
1134 $current = $vars['current'];
\r
1135 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY']) )
\r
1137 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY'];
\r
1141 $template = "<td title=\"blogid:<%blogid%> shortname:<%shortname%>\">\n"
\r
1142 . "<a href=\"<%blogurl%>\"><img src=\"images/globe.gif\" width=\"13\" height=\"13\" alt=\"<%iconalt%>\" /></a><%blogname%></td>\n"
\r
1143 . "<td><a href=\"index.php?action=createitem&blogid=<%blogid%>\" title=\"<%ttaddtext%>\"><%addtext%></a></td>\n"
\r
1144 . "<td><a href=\"index.php?action=itemlist&blogid=<%blogid%>\" title=\"<%ttedittext%>\"><%edittext%></a></td>\n"
\r
1145 . "<td><a href=\"index.php?action=blogcommentlist&blogid=<%blogid%>\" title=\"<%ttcommenttext%>\"><%commenttext%></a></td>\n"
\r
1146 . "<td><a href=\"index.php?action=bookmarklet&blogid=<%blogid%>\" title=\"<%ttbmlettext%>\"><%bmlettext%></a></td>\n";
\r
1149 'blogid' => $current->bnumber,
\r
1150 'shortname' => Entity::hsc($current->bshortname),
\r
1151 'blogurl' => $current->burl,
\r
1152 'blogname' => Entity::hsc($current->bname),
\r
1153 'ttaddtext' => _BLOGLIST_TT_ADD,
\r
1154 'addtext' => _BLOGLIST_ADD,
\r
1155 'ttedittext' => _BLOGLIST_TT_EDIT,
\r
1156 'edittext' => _BLOGLIST_EDIT,
\r
1157 'ttcommenttext' => _BLOGLIST_TT_COMMENTS,
\r
1158 'commenttext' => _BLOGLIST_COMMENTS,
\r
1159 'ttbmlettext' => _BLOGLIST_TT_BMLET,
\r
1160 'bmlettext' => _BLOGLIST_BMLET,
\r
1162 if ( $current->tadmin == 1 )
\r
1164 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
\r
1166 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
\r
1170 $template .= "<td><a href=\"index.php?action=blogsettings&blogid=<%blogid%>\" title=\"<%ttsettingtext%>\"><%settingtext%></a></td>\n"
\r
1171 . "<td><a href=\"index.php?action=banlist&blogid=<%blogid%>\" title=\"<%ttbanstext%>\"><%banstext%></a></td>\n";
\r
1173 $data['ttsettingtext'] = _BLOGLIST_TT_SETTINGS;
\r
1174 $data['settingtext'] = _BLOGLIST_SETTINGS;
\r
1175 $data['ttbanstext'] = _BLOGLIST_TT_BANS;
\r
1176 $data['banstext'] = _BLOGLIST_BANS;
\r
1179 if ( $vars['superadmin'] )
\r
1181 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
\r
1183 $template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
\r
1187 $template .= "<td><a href=\"index.php?action=deleteblog&blogid=<%blogid%>\" title=\"<%ttdeletetext%>\"></a><%deletetext%></td>\n";
\r
1189 $data['ttdeletetext'] = _BLOGLIST_TT_DELETE;
\r
1190 $data['deletetext'] = _BLOGLIST_DELETE;
\r
1194 $current = $vars['current'];
\r
1195 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) )
\r
1197 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT'];
\r
1206 return Template::fill($template, $data);
\r
1209 function listplug_table_shortblognames($vars, $type, $templateName = '')
\r
1211 $templates = array();
\r
1212 if ( !empty($templateName) )
\r
1214 $templates = Template::read($templateName);
\r
1219 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD']) )
\r
1221 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD'];
\r
1225 $template = "<th><%colshortname%></th>\n<th><%colblogname%></th>\n";
\r
1228 'colshortname' => _EBLOG_SHORTNAME,
\r
1229 'colblogname' => _EBLOG_NAME,
\r
1233 $current = $vars['current'];
\r
1234 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']) )
\r
1236 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY'];
\r
1240 $template = "<td><%bshortname%></td>\n<td><%blogname%></td>\n";
\r
1243 'bshortname' => Entity::hsc($current->bshortname),
\r
1244 'blogname' => Entity::hsc($current->bname),
\r
1248 $current = $vars['current'];
\r
1249 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT']) )
\r
1251 $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT'];
\r
1260 return Template::fill($template, $data);
\r
1263 function listplug_table_shortnames($vars, $type, $templateName = '')
\r
1265 $templates = array();
\r
1266 if ( !empty($templateName) )
\r
1268 $templates = Template::read($templateName);
\r
1273 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD']) )
\r
1275 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD'];
\r
1279 $template = "<th><%colname%></th><th><%coldesc%></th>\n";
\r
1282 'colname' => _NAME,
\r
1283 'coldesc' => _LISTS_DESC,
\r
1287 $current = $vars['current'];
\r
1288 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']) )
\r
1290 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY'];
\r
1294 $template = "<td><%name%></td><td><%desc%></td>\n";
\r
1297 'name' => Entity::hsc($current->name),
\r
1298 'desc' => Entity::hsc($current->description),
\r
1302 $current = $vars['current'];
\r
1303 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT']) )
\r
1305 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT'];
\r
1314 return Template::fill($template, $data);
\r
1317 function listplug_table_categorylist($vars, $type, $templateName = '')
\r
1319 $templates = array();
\r
1320 if ( !empty($templateName) )
\r
1322 $templates = Template::read($templateName);
\r
1327 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD']) )
\r
1329 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD'];
\r
1333 $template = "<th><%colname%></th><th><%coldesc%></th><th colspan=\"2\"><%colact%></th>\n";
\r
1336 'colname' => _LISTS_NAME,
\r
1337 'coldesc' => _LISTS_DESC,
\r
1338 'colact' => _LISTS_ACTIONS,
\r
1342 $current = $vars['current'];
\r
1343 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY']) )
\r
1345 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY'];
\r
1349 $template = "<td>\n"
\r
1350 . "<input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%catid%>\" />\n"
\r
1351 . "<label for=\"batch<%batchid%>\"><%catname%></label>\n"
\r
1353 . "<td><%catdesc%></td>\n"
\r
1354 . "<td><a href=\"index.php?action=categoryedit&blogid=<%blogid%>&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a></td>\n"
\r
1355 . "<td><a href=\"index.php?action=categorydelete&blogid=<%blogid%>&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a></td>\n";
\r
1358 'batchid' => listplug_nextBatchId(),
\r
1359 'catid' => intval($current->catid),
\r
1360 'catname' => Entity::hsc($current->cname),
\r
1361 'catdesc' => Entity::hsc($current->cdesc),
\r
1362 'blogid' => intval($current->catcblogid),
\r
1363 'tabindex' => intval($vars['tabindex']),
\r
1364 'editbtn' => _LISTS_EDIT,
\r
1365 'delbtn' => _LISTS_DELETE,
\r
1369 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT']) )
\r
1371 $template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT'];
\r
1380 return Template::fill($template, $data);
\r
1383 function listplug_table_templatelist($vars, $type, $templateName = '')
\r
1385 $templates = array();
\r
1386 if ( !empty($templateName) )
\r
1388 $templates = Template::read($templateName);
\r
1394 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
\r
1396 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
\r
1400 $template = "<th><%colname%></th><th><%coldesc%></th><th colspan=\"3\"><%colact%></th>\n";
\r
1403 'colname' => _LISTS_NAME,
\r
1404 'coldesc' => _LISTS_DESC,
\r
1405 'colact' => _LISTS_ACTIONS,
\r
1409 $current = $vars['current'];
\r
1410 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
\r
1412 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
\r
1416 $template = "<td><%templatename%></td>\n"
\r
1417 . "<td><%templatedesc%></td>\n"
\r
1418 . "<td style=\"white-space:nowrap\">"
\r
1419 . "<a href=\"index.php?action=templateedit&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>\n"
\r
1421 . "<td style=\"white-space:nowrap\">\n"
\r
1422 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>\n"
\r
1424 . "<td style=\"white-space:nowrap\">\n"
\r
1425 . "<a href=\"index.php?action=templatedelete&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>\n"
\r
1428 $url = "index.php?action=templateclone&templateid={$current->tdnumber}";
\r
1430 'templatename' => Entity::hsc($current->tdname),
\r
1431 'templatedesc' => Entity::hsc($current->tddesc),
\r
1432 'templateid' => (integer) $current->tdnumber,
\r
1433 'tabindex' => (integer) $vars['tabindex'],
\r
1434 'cloneurl' => Entity::hsc($manager->addTicketToUrl($url)),
\r
1435 'editbtn' => _LISTS_EDIT,
\r
1436 'clonebtn' => _LISTS_CLONE,
\r
1437 'delbtn' => _LISTS_DELETE,
\r
1441 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
\r
1443 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
\r
1452 return Template::fill($template, $data);
\r
1455 function listplug_table_skinlist($vars, $type, $templateName = '')
\r
1457 $templates = array();
\r
1458 if ( !empty($templateName) )
\r
1460 $templates = Template::read($templateName);
\r
1462 global $CONF, $DIR_SKINS, $manager;
\r
1466 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
\r
1468 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
\r
1472 $template = "<th><%colname%></th><th><%coldesc%></th><th colspan=\"3\"><%colact%></th>\n";
\r
1475 'colname' => _LISTS_NAME,
\r
1476 'coldesc' => _LISTS_DESC,
\r
1477 'colact' => _LISTS_ACTIONS,
\r
1481 $current = $vars['current'];
\r
1482 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
\r
1484 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
\r
1488 $template = "<td><%skinname%><br /><br />\n"
\r
1489 . "<%skintypelabel%> <%skintype%><br />\n"
\r
1490 . "<%incmodelabel%> <%incmode%><br />\n"
\r
1491 . "<%incpreflabel%> <%incpref%><br />\n"
\r
1493 . "<%readme%></td>\n"
\r
1494 . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"
\r
1495 . "<td style=\"white-space:nowrap\">"
\r
1496 . "<a href=\"index.php?action=skinedit&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%>"
\r
1498 . "<td style=\"white-space:nowrap\">"
\r
1499 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
\r
1501 . "<td style=\"white-space:nowrap\">"
\r
1502 . "<a href=\"index.php?action=skindelete&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%>"
\r
1505 $url = $manager->addTicketToUrl('index.php?action=skinclone&skinid=' . intval($current->sdnumber));
\r
1507 'skintypelabel' => _LISTS_TYPE,
\r
1508 'skintype' => Entity::hsc($current->sdtype),
\r
1509 'incmodelabel' => _LIST_SKINS_INCMODE,
\r
1510 'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
\r
1511 'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',
\r
1512 'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',
\r
1513 'skindesc' => Entity::hsc($current->sddesc),
\r
1514 'skinid' => (integer) $current->sdnumber,
\r
1515 'tabindex' => $vars['tabindex'],
\r
1516 'cloneurl' => Entity::hsc($url),
\r
1517 'editbtn' => _LISTS_EDIT,
\r
1518 'clonebtn' => _LISTS_CLONE,
\r
1519 'delbtn' => _LISTS_DELETE,
\r
1521 // use a special style for the default skin
\r
1522 if ( $current->sdnumber == $CONF['BaseSkin'] )
\r
1524 $data['skinname'] = '<strong>' . Entity::hsc($current->sdname) . '</strong>';
\r
1528 $data['skinname'] = Entity::hsc($current->sdname);
\r
1531 // add preview image when present
\r
1532 if ( $current->sdincpref && @file_exists("{$DIR_SKINS}{$current->sdincpref}preview.png") )
\r
1534 $data['skinthumb'] = "<p>\n";
\r
1536 $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
\r
1537 $has_enlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');
\r
1538 if ( $has_enlargement )
\r
1540 $data['skinthumb'] .= '<a href="' . $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
\r
1542 $data['skinthumb'] .= '<img class="skinpreview" src="' . $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
\r
1543 if ( $has_enlargement )
\r
1545 $data['skinthumb'] .= "</a><br />\n";
\r
1548 if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
\r
1550 $url = $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'readme.html';
\r
1551 $title = sprintf(_LIST_SKIN_README, $current->sdname);
\r
1552 $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
\r
1556 $data['readme'] ="";
\r
1559 $data['skinthumb'] .= "</p>\n";
\r
1561 /* show list of defined parts */
\r
1562 $query = "SELECT stype FROM %s WHERE sdesc=%d ORDER BY stype";
\r
1563 $query = sprintf($query, sql_table('skin'), $current->sdnumber);
\r
1564 $r = sql_query($query);
\r
1567 while ( $o = sql_fetch_object($r) )
\r
1569 array_push($types, $o->stype);
\r
1571 if ( sizeof($types) > 0 )
\r
1573 for ( $i = 0; $i < sizeof($types); $i++ )
\r
1575 $type = $types[$i];
\r
1576 if ( !array_key_exists($type, $template['friendly_names']) || $type == strtolower($template['friendly_names'][$type]) )
\r
1578 $article = 'skinpartspecial';
\r
1582 $article = "skinpart{$type}";
\r
1584 $types[$i] = "<li>\n"
\r
1585 . helpHtml($article) . "\n"
\r
1586 . "<a href=\"index.php?action=skinedittype&skinid={$current->sdnumber}&type={$type}\" tabindex=\"{$template['tabindex']}\">"
\r
1587 . Entity::hsc($template['friendly_names'][$type])
\r
1591 $data['skinparts'] = '<br /><br />' . _LIST_SKINS_DEFINED . "<ul>\n" . implode($types, '') . "</ul>\n";
\r
1595 $data['skinparts'] = '';
\r
1599 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
\r
1601 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
\r
1610 return Template::fill($template, $data);
\r
1613 function listplug_table_draftlist($vars, $type, $templateName = '')
\r
1615 $templates = array();
\r
1616 if ( !empty($templateName) )
\r
1618 $templates = Template::read($templateName);
\r
1623 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD']) )
\r
1625 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD'];
\r
1629 $template = "<th><%colblog%></th><th><%coldesc%></th><th colspan=\"2\"><%colact%></th>\n";
\r
1632 'colblog' => _LISTS_BLOG,
\r
1633 'coldesc' => _LISTS_TITLE,
\r
1634 'colact' => _LISTS_ACTIONS,
\r
1638 $current = $vars['current'];
\r
1639 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY']) )
\r
1641 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY'];
\r
1645 $template = "<td><%bshortname%></td>\n"
\r
1646 . "<td><%ititle%></td>\n"
\r
1647 . "<td><a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a></td>\n"
\r
1648 . "<td><a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a></td>\n";
\r
1651 'bshortname' => Entity::hsc($current->bshortname),
\r
1652 'ititle' => Entity::hsc(strip_tags($current->ititle)),
\r
1653 'itemid' => intval($current->inumber),
\r
1654 'editbtn' => _LISTS_EDIT,
\r
1655 'delbtn' => _LISTS_DELETE,
\r
1659 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT']) )
\r
1661 $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT'];
\r
1670 return Template::fill($template, $data);
\r
1673 function listplug_table_otherdraftlist($vars, $type, $templateName = '')
\r
1675 $templates = array();
\r
1676 if ( !empty($templateName) )
\r
1678 $templates = Template::read($templateName);
\r
1683 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD']) )
\r
1685 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD'];
\r
1689 $template = "<th><%colblog%></th><th><%coldesc%></th><th><%colautr%></th><th colspan=\"2\"><%colact%></th>\n";
\r
1692 'colblog' => _LISTS_BLOG,
\r
1693 'coldesc' => _LISTS_TITLE,
\r
1694 'colautr' => _LISTS_AUTHOR,
\r
1695 'colact' => _LISTS_ACTIONS,
\r
1699 $current = $vars['current'];
\r
1700 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY']) )
\r
1702 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY'];
\r
1706 $template = "<td><%bshortname%></td>\n"
\r
1707 . "<td><%ititle%></td>\n"
\r
1708 . "<td><%iauthor%></td>\n"
\r
1709 . "<td><a href=\"index.php?action=itemedit&itemid=<%itemid%>\"><%editbtn%></a></td>\n"
\r
1710 . "<td><a href=\"index.php?action=itemdelete&itemid=<%itemid%>\"><%delbtn%></a></td>\n";
\r
1713 'bshortname' => Entity::hsc($current->bshortname),
\r
1714 'ititle' => Entity::hsc(strip_tags($current->ititle)),
\r
1715 'iauthor' => Entity::hsc(strip_tags($current->mname)),
\r
1716 'itemid' => intval($current->inumber),
\r
1717 'editbtn' => _LISTS_EDIT,
\r
1718 'delbtn' => _LISTS_DELETE,
\r
1722 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT']) )
\r
1724 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT'];
\r
1733 return Template::fill($template, $data);
\r
1736 function listplug_table_actionlist($vars, $type, $templateName = '')
\r
1738 $templates = array();
\r
1739 if ( !empty($templateName) )
\r
1741 $templates = Template::read($templateName);
\r
1746 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD']) )
\r
1748 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD'];
\r
1752 $template = "<th><%coltime%></th><th><%colmesg%></th>\n";
\r
1755 'coltime' => _LISTS_TIME,
\r
1756 'colmesg' => _LIST_ACTION_MSG,
\r
1760 $current = $vars['current'];
\r
1761 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']) )
\r
1763 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY'];
\r
1767 $template = "<td><%timestamp%></td><td><%message%></td>\n";
\r
1770 'timestamp' => Entity::hsc($current->timestamp),
\r
1771 'message' => Entity::hsc($current->message),
\r
1775 $current = $vars['current'];
\r
1776 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT']) )
\r
1778 $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT'];
\r
1787 return Template::fill($template, $data);
\r
1790 function listplug_table_banlist($vars, $type, $templateName = '')
\r
1792 $templates = array();
\r
1793 if ( !empty($templateName) )
\r
1795 $templates = Template::read($templateName);
\r
1800 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD']) )
\r
1802 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD'];
\r
1806 $template = "<th><%iprange%></th><th><%reason%></th><th><%colact%></th>\n";
\r
1809 'iprange' => _LIST_BAN_IPRANGE,
\r
1810 'reason' => _LIST_BAN_REASON,
\r
1811 'colact' => _LISTS_ACTIONS,
\r
1815 $current = $vars['current'];
\r
1816 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']) )
\r
1818 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY'];
\r
1822 $template = "<td><%iprange%></td>\n"
\r
1823 . "<td><%reason%></td>\n"
\r
1824 . "<td><a href=\"index.php?action=banlistdelete&blogid=<%blogid%>&iprange=<%iprange%>\"><%delbtn%></a></td>\n";
\r
1827 'iprange' => Entity::hsc($current->iprange),
\r
1828 'reason' => Entity::hsc($current->reason),
\r
1829 'blogid' => intval($current->blogid),
\r
1830 'delbtn' => _LISTS_DELETE,
\r
1834 $current = $vars['current'];
\r
1835 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT']) )
\r
1837 $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT'];
\r
1846 return Template::fill($template, $data);
\r
1849 function listplug_table_adminskinlist($vars, $type, $templateName = '')
\r
1851 global $CONF, $DIR_SKINS, $DIR_NUCLEUS, $manager;
\r
1852 $adminSkinURL = $CONF['SkinURL'] . 'admin/';
\r
1853 $adminSkinDir = $DIR_NUCLEUS . 'admin/';
\r
1854 $templates = array();
\r
1855 if ( !empty($templateName) )
\r
1857 $templates = Template::read($templateName);
\r
1862 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
\r
1864 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
\r
1868 $template = "<th><%colname%></th><th><%coldesc%></th><th colspan=\"3\"><%colact%></th>\n";
\r
1871 'colname' => _LISTS_NAME,
\r
1872 'coldesc' => _LISTS_DESC,
\r
1873 'colact' => _LISTS_ACTIONS,
\r
1877 $current = $vars['current'];
\r
1878 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
\r
1880 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
\r
1884 $template = "<td><%skinname%><br /><br />\n"
\r
1885 . "<%skintypelabel%> <%skintype%><br />\n"
\r
1886 . "<%incmodelabel%> <%incmode%><br />\n"
\r
1887 . "<%incpreflabel%> <%incpref%><br />\n"
\r
1889 . "<%readme%></td>\n"
\r
1890 . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"
\r
1891 . "<td style=\"white-space:nowrap\">"
\r
1892 . "<a href=\"index.php?action=skinedit&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%>"
\r
1894 . "<td style=\"white-space:nowrap\">"
\r
1895 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
\r
1897 . "<td style=\"white-space:nowrap\">"
\r
1898 . "<a href=\"index.php?action=skindelete&skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%>"
\r
1901 $url = $manager->addTicketToUrl('index.php?action=adminskinclone&skinid=' . intval($current->sdnumber));
\r
1903 'skintypelabel' => _LISTS_TYPE,
\r
1904 'skintype' => Entity::hsc($current->sdtype),
\r
1905 'incmodelabel' => _LIST_SKINS_INCMODE,
\r
1906 'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
\r
1907 'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',
\r
1908 'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',
\r
1909 'skindesc' => Entity::hsc($current->sddesc),
\r
1910 'skinid' => (integer) $current->sdnumber,
\r
1911 'tabindex' => $vars['tabindex'],
\r
1912 'cloneurl' => Entity::hsc($url),
\r
1913 'editbtn' => _LISTS_EDIT,
\r
1914 'clonebtn' => _LISTS_CLONE,
\r
1915 'delbtn' => _LISTS_DELETE,
\r
1917 // use a special style for the default skin
\r
1918 if ( $current->sdnumber == $CONF['DefaultAdminSkin'] )
\r
1920 $data['skinname'] = '<strong>' . Entity::hsc($current->sdname) . '</strong>';
\r
1924 $data['skinname'] = Entity::hsc($current->sdname);
\r
1927 // add preview image when present
\r
1928 if ( $current->sdincpref && @file_exists("{$adminSkinDir}{$current->sdincpref}preview.png") )
\r
1930 $data['skinthumb'] = "<p>\n";
\r
1932 $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
\r
1933 $has_enlargement = @file_exists($adminSkinDir . $current->sdincpref . 'preview-large.png');
\r
1934 if ( $has_enlargement )
\r
1936 $data['skinthumb'] .= '<a href="' . $adminSkinURL . Entity::hsc($current->sdincpref) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
\r
1938 $data['skinthumb'] .= '<img class="skinpreview" src="' . $adminSkinURL . Entity::hsc($current->sdincpref) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
\r
1939 if ( $has_enlargement )
\r
1941 $data['skinthumb'] .= "</a><br />\n";
\r
1944 if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
\r
1946 $url = $adminSkinURL . Entity::hsc($current->sdincpref) . 'readme.html';
\r
1947 $title = sprintf(_LIST_SKIN_README, $current->sdname);
\r
1948 $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
\r
1952 $data['readme'] ="";
\r
1955 $data['skinthumb'] .= "</p>\n";
\r
1957 /* show list of defined parts */
\r
1958 $query = "SELECT stype FROM %s WHERE sdesc=%d ORDER BY stype";
\r
1959 $query = sprintf($query, sql_table('skin'), $current->sdnumber);
\r
1960 $r = sql_query($query);
\r
1963 while ( $o = sql_fetch_object($r) )
\r
1965 array_push($types, $o->stype);
\r
1967 if ( sizeof($types) > 0 )
\r
1969 for ( $i = 0; $i < sizeof($types); $i++ )
\r
1971 $type = $types[$i];
\r
1972 if ( !array_key_exists($type, $template['friendly_names']) || $type == strtolower($template['friendly_names'][$type]) )
\r
1974 $article = 'skinpartspecial';
\r
1978 $article = "skinpart{$type}";
\r
1980 $types[$i] = "<li>\n"
\r
1981 . helpHtml($article) . "\n"
\r
1982 . "<a href=\"index.php?action=adminskinedittype&skinid={$current->sdnumber}&type={$type}\" tabindex=\"{$vars['tabindex']}\">"
\r
1983 . Entity::hsc($template['friendly_names'][$type])
\r
1987 $data['skinparts'] = '<br /><br />' . _LIST_SKINS_DEFINED . "<ul>\n" . implode($types, '') . "</ul>\n";
\r
1991 $data['skinparts'] = '';
\r
1995 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
\r
1997 $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
\r
2006 return Template::fill($template, $data);
\r
2009 function listplug_table_admintemplatelist($vars, $type, $templateName = '')
\r
2011 $templates = array();
\r
2012 if ( !empty($templateName) )
\r
2014 $templates = Template::read($templateName);
\r
2020 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
\r
2022 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
\r
2026 $template = "<th><%colname%></th><th><%coldesc%></th><th colspan=\"3\"><%colact%></th>\n";
\r
2029 'colname' => _LISTS_NAME,
\r
2030 'coldesc' => _LISTS_DESC,
\r
2031 'colact' => _LISTS_ACTIONS,
\r
2035 $current = $vars['current'];
\r
2036 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
\r
2038 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
\r
2042 $template = "<td><%templatename%></td>\n"
\r
2043 . "<td><%templatedesc%></td>\n"
\r
2044 . "<td style=\"white-space:nowrap\">"
\r
2045 . "<a href=\"index.php?action=admintemplateedit&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>\n"
\r
2047 . "<td style=\"white-space:nowrap\">\n"
\r
2048 . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>\n"
\r
2050 . "<td style=\"white-space:nowrap\">\n"
\r
2051 . "<a href=\"index.php?action=admintemplatedelete&templateid=<%templateid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>\n"
\r
2054 $url = "index.php?action=admintemplateclone&templateid={$current->tdnumber}";
\r
2056 'templatename' => Entity::hsc($current->tdname),
\r
2057 'templatedesc' => Entity::hsc($current->tddesc),
\r
2058 'templateid' => (integer) $current->tdnumber,
\r
2059 'tabindex' => (integer) $vars['tabindex'],
\r
2060 'cloneurl' => Entity::hsc($manager->addTicketToUrl($url)),
\r
2061 'editbtn' => _LISTS_EDIT,
\r
2062 'clonebtn' => _LISTS_CLONE,
\r
2063 'delbtn' => _LISTS_DELETE,
\r
2067 if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
\r
2069 $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
\r
2078 return Template::fill($template, $data);
\r