%tabindex%><%javascript%>>\n<%extraoption%>\n";
}
$data = array(
'name' => isset($vars['name']) ? ' name="' . $vars['name'] . '"' : '',
'tabindex' => isset($vars['tabindex']) ? ' tabindex="' . $vars['tabindex'] . '"' : '',
'javascript' => isset($vars['javascript']) ? ' ' . $vars['javascript'] : '',
);
$data ['extraoption'] = isset($vars['extra']) ?
'" :
'';
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_SELECT_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_SELECT_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_SELECT_BODY'];
}
else
{
$template = '' . "\n";
}
$data = array(
'value' => Entity::hsc($current->value),
'selected' => ($vars['selected'] == $current->value) ? ' selected="selected"' : '',
);
if ( isset($vars['shorten']) && $vars['shorten'] > 0 )
{
$data['title'] = ' title="' . Entity::hsc($current->text) . '"';
$current->text = Entity::hsc(Entity::shorten($current->text, $vars['shorten'], $vars['shortenel']));
}
else
{
$data['title'] = '';
}
$data['option'] = Entity::hsc($current->text);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_SELECT_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_SELECT_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_SELECT_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
if ( !class_exists('Actions') )
{
global $DIR_LIBS;
include $DIR_LIBS . 'ACTIONS.php';
}
$template = Template::fill($template, $data);
$handler = new Actions('template', $template, $data);
$parser = new PARSER(Actions::getDefinedActions(), $handler);
$parser->parse($template);
return;
}
function listplug_table($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_HEAD'];
}
else
{
$template = "
\n<%typehead%>\n
\n";
}
$data = array(
'typehead' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'HEAD', $templateName)
);
break;
case 'BODY':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_BODY'];
}
else
{
$template = "<%typebody%>\n
\n";
}
// tabletype specific thingies
$data = array(
'typebody' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'BODY', $templateName)
);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_FOOT'];
}
else
{
$template = "<%typefoot%>\n
\n";
}
// tabletype specific thingies
$data = array(
'typefoot' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'FOOT', $templateName)
);
break;
}
$template = Template::fill($template, $data);
if ( !class_exists('Actions') )
{
global $DIR_LIBS;
include $DIR_LIBS . 'ACTIONS.php';
}
$handler = new Actions('template', $template, $data);
$parser = new PARSER(Actions::getDefinedActions(), $handler);
$parser->parse($template);
return;
}
function listplug_table_memberlist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_HEAD'];
}
else
{
$template = "<%colmembername%> | \n"
. "<%colmemberrname%> | \n"
. "<%colmemberurl%> | \n"
. "<%colmemberadmin%><%helplink(superadmin)%> | \n"
. "<%colmemberlogin%><%helplink(canlogin)%> | \n"
. "<%colactions%> | \n";
}
$data = array(
'colmembername' => _LIST_MEMBER_NAME,
'colmemberrname' => _LIST_MEMBER_RNAME,
'colmemberurl' => _LIST_MEMBER_URL,
'colmemberadmin' => _LIST_MEMBER_ADMIN,
'colmemberlogin' => _LIST_MEMBER_LOGIN,
'colactions' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_BODY'];
}
else
{
$template = "\n"
. "\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
. "\n | \n"
. "<%realname%> | \n"
. "\" tabindex=\"<%tabindex%>\"><%url%> | \n"
. "<%admin%> | \n"
. "<%login%> | \n"
. "\" tabindex=\"<%tabindex%>\"><%editbtn%> | \n"
. "\" tabindex=\"<%tabindex%>\"><%deletebtn%> | \n";
}
$data = array(
'id' => listplug_nextBatchId(),
'memberid' => $current->mnumber,
'mailaddress' => Entity::hsc($current->memail),
'tabindex' => $vars['tabindex'],
'name' => Entity::hsc($current->mname),
'realname' => Entity::hsc($current->mrealname),
'url' => Entity::hsc($current->murl),
'admin' => ($current->madmin ? _YES : _NO),
'login' => ($current->mcanlogin ? _YES : _NO),
'editbtn' => _LISTS_EDIT,
'deletebtn' => _LISTS_DELETE,
);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_MEMBLIST_FOOT'];
}
else
{
$template = "";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_teamlist($vars, $type, $templateName = '')
{
global $manager;
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_HEAD'];
}
else
{
$template = "<%colmembername%> | \n"
. "<%colmemberrname%> | \n"
. "<%colteamadmin%><%helplink(teamadmin)%> | \n"
. "<%colactions%> | \n";
}
$data = array(
'colmembername' => _LIST_MEMBER_NAME,
'colmemberrname' => _LIST_MEMBER_RNAME,
'colteamadmin' => _LIST_TEAM_ADMIN,
'colactions' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY'];
}
else
{
$template = "\n"
. "\" name=\"batch[<%id%>]\" value=\"<%memberid%>\" />\n"
. "\n | \n"
. "<%realname%> | \n"
. "<%admin%> | \n"
. "&blogid=<%blogid%>\" tabindex=\"<%tabindex%>\"><%deletebtn%> | \n"
. "\" tabindex=\"<%tabindex%>\"><%chadminbtn%> | \n";
}
$url = 'index.php?action=teamchangeadmin&memberid=' . intval($current->tmember) . '&blogid=' . intval($current->tblog);
$url = $manager->addTicketToUrl($url);
$data = array(
'id' => listplug_nextBatchId(),
'memberid' => $current->tmember,
'mailaddress' => Entity::hsc($current->memail),
'tabindex' => $vars['tabindex'],
'name' => Entity::hsc($current->mname),
'realname' => Entity::hsc($current->mrealname),
'admin' => ($current->tadmin ? _YES : _NO),
'blogid' => $current->tblog,
'deletebtn' => _LISTS_DELETE,
'chadminurl' => Entity::hsc($url),
);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_FOOT'];
}
else
{
$template = "";
}
break;
}
return Template::fill($template, $data);
}
function listplug_table_pluginlist($vars, $type, $templateName = '')
{
global $manager;
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HEAD'];
}
else
{
$template = "<%colinfo%> | \n"
. "<%coldesc%> | \n"
. "<%colactions%> | \n";
}
$data = array(
'colinfo' => _LISTS_INFO,
'coldesc' => _LISTS_DESC,
'colactions' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
$plug =& $manager->getPlugin($current->pfile);
if ( $plug )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY'];
}
else
{
$template = "\n"
. "<%plugname%> \n"
. "<%autherlabel%> <%plugauther%> \n"
. "<%versionlabel%> <%plugversion%> \n"
. "<%pluggeturl%> \n"
. " | \n"
. "\n"
. "<%desclabel%> <%plugdesc%>\n"
. "<%eventlist%>\n"
. "<%needupdate%>\n"
. "<%dependlist%>\n"
. "<%depreqlist%>\n"
. " | \n";
}
$data = array(
'plugname' => Entity::hsc($plug->getName()),
'autherlabel' => _LIST_PLUGS_AUTHOR,
'plugauther' => Entity::hsc($plug->getAuthor()),
'versionlabel' => _LIST_PLUGS_VER,
'plugversion' => Entity::hsc($plug->getVersion()),
'tabindex' => $vars['tabindex'],
'desclabel' => _LIST_PLUGS_DESC,
'plugdesc' => Entity::hen($plug->getDescription()),
);
if ( $plug->getURL() )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_GURL'];
}
else
{
$subTpl = "\" tabindex=\"<%tabindex%>\"><%plugsite%>";
}
$subData = array(
'plugurl' => Entity::hsc($plug->getURL()),
'tabindex' => $vars['tabindex'],
'plugsite' => _LIST_PLUGS_SITE,
);
$data['pluggeturl'] = Template::fill($subTpl, $subData);
}
else
{
$data['pluggeturl'] = '';
}
if ( count($plug->getEventList()) > 0 )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGEVENTLIST'];
}
else
{
$subTpl = "
<%evntlstlbl%>
<%eventlist%>";
}
$subData = array(
'evntlstlbl' => _LIST_PLUGS_SUBS,
'eventlist' => Entity::hsc(implode(', ', $plug->getEventList())),
);
$data['eventlist'] = Template::fill($subTpl, $subData);
}
else
{
$data['eventlist'] = '';
}
if ( !$plug->subscribtionListIsUptodate() )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGNEDUPDATE'];
}
else
{
$subTpl = "
<%updatealert%>";
}
$subData = array(
'updatealert' => _LIST_PLUG_SUBS_NEEDUPDATE,
);
$data['needupdate'] = Template::fill($subTpl, $subData);
}
else
{
$data['needupdate'] = '';
}
if ( count($plug->getPluginDep() ) > 0)
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPEND'];
}
else
{
$subTpl = "
<%deplistlbl%>
<%dependlist%>";
}
$subData = array(
'deplistlbl' => _LIST_PLUGS_DEP,
'dependlist' => Entity::hsc(implode(', ', $plug->getPluginDep())),
);
$data['dependlist'] = Template::fill($subTpl, $subData);
}
else
{
$data['dependlist'] = '';
}
/* check dependency */
$req = array();
$res = sql_query('SELECT pfile FROM ' . sql_table('plugin'));
while( $o = sql_fetch_object($res) )
{
$preq =& $manager->getPlugin($o->pfile);
if ( $preq )
{
$depList = $preq->getPluginDep();
foreach ( $depList as $depName )
{
if ( $current->pfile == $depName )
{
$req[] = $o->pfile;
}
}
}
}
if ( count($req) > 0 )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ'];
}
else
{
$subTpl = "
<%deprlstlbl%>
<%depreqlist%>";
}
$subData = array(
'deprlstlbl' => _LIST_PLUGS_DEPREQ,
'depreqlist' => Entity::hsc(implode(', ', $req)),
);
$data['depreqlist'] = Template::fill($subTpl, $subData);
}
else
{
$data['depreqlist'] = '';
}
}
else
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE'];
}
else
{
$template = "<%noplugalert%> | \n";
}
$data = array(
'noplugalert' => sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current->pfile)),
);
}
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) )
{
$template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN'];
}
else
{
$template .= "\n"
. "\" tabindex=\"<%tabindex%>\"><%actionuptxt%> \n"
. "\" tabindex=\"<%tabindex%>\"><%actiondowntxt%> \n"
. "\" tabindex=\"<%tabindex%>\"><%actuninsttxt%> "
. "<%plugadminurl%>\n"
. "<%plughelpurl%>\n"
. "<%plugoptsetting%>\n"
. " | \n";
}
$baseUrl = 'index.php?plugid=' . $current->pid . '&action=';
$upUrl = $manager->addTicketToUrl($baseUrl . 'pluginup');
$downUrl = $manager->addTicketToUrl($baseUrl . 'plugindown');
$data['actionuptxt'] = _LIST_PLUGS_UP;
$data['actionupurl'] = Entity::hsc($upUrl);
$data['actiondowntxt'] = _LIST_PLUGS_DOWN;
$data['actiondownurl'] = Entity::hsc($downUrl);
$data['actuninsttxt'] = _LIST_PLUGS_UNINSTALL;
$data['actuninsturl'] = 'index.php?action=plugindelete&plugid=' . $current->pid;
if ( $plug && ($plug->hasAdminArea() > 0) )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ADMN'];
}
else
{
$subTpl = "\" tabindex=\"<%tabindex%>\"><%actadmintxt%>
\n";
}
$subData = array(
'actadminurl' => Entity::hsc($plug->getAdminURL()),
'tabindex' => $vars['tabindex'],
'actadmintxt' => _LIST_PLUGS_ADMIN,
);
$data['plugadminurl'] = Template::fill($subTpl, $subData);
}
else
{
$data['plugadminurl'] = '';
}
if ( $plug && ($plug->supportsFeature('HelpPage') > 0) )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP'];
}
else
{
$subTpl = "\" tabindex=\"<%tabindex%>\"><%acthelptxt%>
\n";
}
$subData = array(
'acthelpurl' => 'index.php?action=pluginhelp&plugid=' . $current->pid,
'tabindex' => $vars['tabindex'],
'acthelptxt' => _LIST_PLUGS_HELP,
);
$data['plughelpurl'] = Template::fill($subTpl, $subData);
}
else
{
$data['plughelpurl'] = '';
}
$optQuery = 'SELECT '
. ' COUNT(*) AS result '
. 'FROM '
. sql_table('plugin_option_desc') . ' '
. 'WHERE '
. ' ocontext = "global" '
. 'AND opid = %d';
$pOptions = quickQuery(sprintf($optQuery, $current->pid));
if ( $pOptions > 0 )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL'];
}
else
{
$subTpl = "\" tabindex=\"<%tabindex%>\"><%actoptiontxt%>\n";
}
$subData = array(
'actoptionurl' => 'index.php?action=pluginoptions&plugid=' . $current->pid,
'tabindex' => $vars['tabindex'],
'actoptiontxt' => _LIST_PLUGS_OPTIONS,
);
$data['plugoptsetting'] = Template::fill($subTpl, $subData);
}
else
{
$data['plugoptsetting'] = '';
}
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_FOOT'];
}
else
{
$subTpl = "";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_plugoptionlist($vars, $type, $templateName = '')
{
global $manager;
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_HEAD'];
}
else
{
$template = "<%colinfo%> | <%colvalue%> | \n";
}
$data = array(
'colinfo' => _LISTS_INFO,
'colvalue' => _LISTS_VALUE,
);
break;
case 'BODY':
$current = $vars['current'];
$template = listplug_plugOptionRow($current, $templateName);
$data = array();
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_FOOT'];
}
else
{
$template = "\n"
. "<%savetext%> | "
. "<%savetext%> | "
. "\" /> | "
. "
\n";
}
$data = array(
'savetext' => _PLUGS_SAVE,
);
break;
}
return Template::fill($template, $data);
}
function listplug_plugOptionRow($current, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
$varname = "plugoption[{$current['oid']}][{$current['contextid']}]";
// retreive the optionmeta
$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
// only if it is not a hidden option write the controls to the page
if ( in_array('access', $meta) && $meta['access'] == 'hidden' )
{
return false;
}
else
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_POPTLIST_BODY'];
}
else
{
$template = "<%description%> | \n\n";
}
$data = array();
switch($current['type'])
{
case 'yesno':
$template .= AdminActions::input_yesno($varname, $current['value'], 0, 'yes', 'no', _YES, _NO, 0, $templateName, 1);
break;
case 'password':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) )
{
$template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD'];
}
else
{
$template .= "\" value=\"<%value%>\" />\n";
}
$data = array(
'varname' => Entity::hsc($varname),
'value' => Entity::hsc($current['value']),
);
break;
case 'select':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP']) )
{
$template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OSELEP'];
}
else
{
$template .= "\n";
}
$data['varname'] = Entity::hsc($varname);
break;
case 'textarea':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA']) )
{
$template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OTAREA'];
}
else
{
$template .= "";
}
$data = array(
'varname' => Entity::hsc($varname),
'value' => Entity::hsc($current['value'])
);
if ( array_key_exists('access', $current) && $current['access'] == 'readonly')
{
$data['readonly'] = ' readonly="readonly"';
}
else
{
$data['readonly'] = '';
}
break;
case 'text':
default:
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT']) )
{
$template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OITEXT'];
}
else
{
$template .= "\" value=\"<%value%>\"<%datatype%><%readonly%> />\n";
}
$data = array(
'varname' => Entity::hsc($varname),
'value' => Entity::hsc($current['value'])
);
if ( array_key_exists('datatype', $current) && $current['datatype'] == 'numerical')
{
$data['datatype'] = ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
}
else
{
$data['datatype'] = '';
}
if ( array_key_exists('access', $current) && $current['access'] == 'readonly')
{
$data['readonly'] = ' readonly="readonly"';
}
else
{
$data['readonly'] = '';
}
}
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT']) )
{
$template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTN_FOOT'];
}
else
{
$template .= "<%extra%> | \n";
}
$data['extra'] = isset($current['extra']) ? $current['extra'] : '';
$data['description'] = $current['description'] ? Entity::hsc($current['description']) : Entity::hsc($current['name']);
}
return Template::fill($template, $data, 1);
}
function listplug_table_itemlist($vars, $type, $templateName = '')
{
$cssclass = '';
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD'];
}
else
{
$template = "<%colinfo%> | <%colcontent%> | <%colaction%> | \n";
}
$data = array(
'colinfo' => _LIST_ITEM_INFO,
'colcontent' => _LIST_ITEM_CONTENT,
'colaction' => _LISTS_ACTIONS
);
break;
case 'BODY':
$current = $vars['current'];
// string -> unix timestamp
$current->itime = strtotime($current->itime);
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY'];
}
else
{
$template = ">\n"
. "<%bshortlabel%> <%bshortnameval%> \n"
. "<%categorylabel%> <%categorynameval%> \n"
. "<%authorlabel%> <%authornameval%> \n"
. "<%itemdatelabel%> <%itemdateval%> \n"
. "<%itemtimelabel%> <%itemtimeval%>\n"
. " | \n"
. "\" name=\"batch<%batchid%>\" value=\"<%itemid%>\" />\n"
. " \n"
. "<%itembody%>\n"
. " | "
. "\"><%editbtn%> \n"
. "<%camount%>\n"
. "\"><%movebtn%> \n"
. "\"><%delbtn%> \n"
. " | \n";
}
$cssclass = '';
if ( $current->idraft == 1 )
{
$cssclass = ' class="draft"';
}
// (can't use offset time since offsets might vary between blogs)
if ( $current->itime > $vars['now'] )
{
$cssclass = ' class="future"';
}
$body = strip_tags($current->ibody);
$data = array(
'cssclass' => $cssclass,
'bshortlabel' => _LIST_ITEM_BLOG,
'bshortnameval' => Entity::hsc($current->bshortname),
'categorylabel' => _LIST_ITEM_CAT,
'categorynameval' => Entity::hsc($current->cname),
'authorlabel' => _LIST_ITEM_AUTHOR,
'authornameval' => Entity::hsc($current->mname),
'itemdatelabel' => _LIST_ITEM_DATE,
'itemdateval' => date("Y-m-d",$current->itime),
'itemdatelabel' => _LIST_ITEM_TIME,
'itemdateval' => date("H:i",$current->itime),
'batchid' => listplug_nextBatchId(),
'itemid' => $current->inumber,
'itemtitle' => Entity::hsc(strip_tags($current->ititle)),
'itembody' => Entity::hsc(Entity::shorten($body, 300, '...')),
'editbtn' => _LISTS_EDIT,
'movebtn' => _LISTS_MOVE,
'delbtn' => _LISTS_DELETE,
);
// evaluate amount of comments for the item
$comment = new Comments($current->inumber);
$camount = $comment->amountComments();
if ( $camount > 0 )
{
$data['camount'] = "inumber}\">(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")
\n";
}
else
{
$data['camount'] = "" . _LIST_ITEM_NOCONTENT . "\n";
}
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
// for batch operations: generates the index numbers for checkboxes
function listplug_nextBatchId()
{
static $id = 0;
return $id++;
}
function listplug_table_commentlist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_HEAD'];
}
else
{
$template = "<%colinfo%> | \n<%colcontent%> | \n<%colaction%> | \n";
}
$data = array(
'colinfo' => _LISTS_INFO,
'colcontent' => _LIST_COMMENT,
'colaction' => _LISTS_ACTIONS
);
break;
case 'BODY':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY'];
}
else
{
$template = "<%commentdate%> <%commentator%> <%commentsite%> <%commentmail%>
| \n"
. "\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />"
. " | \n"
. ""
. "\"><%editbtn%> | \n"
. ""
. "\"><%delbtn%> | \n"
. "<%addbanlist%>";
}
$current = $vars['current'];
$body = strip_tags($current->cbody);
$data = array(
'commentdate' => date("Y-m-d@H:i", strtotime($current->ctime)),
'batchid' => listplug_nextBatchId(),
'commentid' => $current->cnumber,
'commentbody' => Entity::hsc(Entity::shorten($current->cbody, 300, '...')),
'editbtn' => _LISTS_EDIT,
'delbtn' => _LISTS_DELETE,
);
if ( isset($current->mname) )
{
$data['commentator'] = Entity::hsc($current->mname) . ' ' . _LIST_COMMENTS_MEMBER;
}
else
{
$data['commentator'] = Entity::hsc($current->cuser);
}
if ( isset($current->cmail) && $current->cmail )
{
$data['commentsite'] = Entity::hsc($current->cmail);
}
else
{
$data['commentsite'] = '';
}
if ( isset($current->cemail) && $current->cemail )
{
$data['commentmail'] = Entity::hsc($current->cemail);
}
else
{
$data['commentmail'] = '';
}
if ( $vars['canAddBan'] )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) )
{
$subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN'];
}
else
{
$subTpl = "&ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%> | \n";
}
$subData = array(
'itemid' => $current->citem,
'banip' => Entity::hsc($current->cip),
'banbtn' => _LIST_COMMENT_BANIP,
);
$data['addbanlist'] = Template::fill($subTpl, $subData);
}
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_FOOT'];
}
else
{
$template = "";
}
$subData = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_bloglist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_HEAD'];
}
else
{
$template = "<%blognames%> | \n<%actionshead%> | \n";
}
$data = array(
'blognames' => _NAME,
'actionshead' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY'];
}
else
{
$template = " shortname:<%shortname%>\">\n"
. "\"> \" /><%blogname%> | \n"
. "\" title=\"<%ttaddtext%>\"><%addtext%> | \n"
. "\" title=\"<%ttedittext%>\"><%edittext%> | \n"
. "\" title=\"<%ttcommenttext%>\"><%commenttext%> | \n"
. "\" title=\"<%ttbmlettext%>\"><%bmlettext%> | \n";
}
$data = array(
'blogid' => $current->bnumber,
'shortname' => Entity::hsc($current->bshortname),
'blogurl' => $current->burl,
'blogname' => Entity::hsc($current->bname),
'ttaddtext' => _BLOGLIST_TT_ADD,
'addtext' => _BLOGLIST_ADD,
'ttedittext' => _BLOGLIST_TT_EDIT,
'edittext' => _BLOGLIST_EDIT,
'ttcommenttext' => _BLOGLIST_TT_COMMENTS,
'commenttext' => _BLOGLIST_COMMENTS,
'ttbmlettext' => _BLOGLIST_TT_BMLET,
'bmlettext' => _BLOGLIST_BMLET,
);
if ( $current->tadmin == 1 )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
{
$template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
}
else
{
$template .= "\" title=\"<%ttsettingtext%>\"><%settingtext%> | \n"
. "\" title=\"<%ttbanstext%>\"><%banstext%> | \n";
}
$data['ttsettingtext'] = _BLOGLIST_TT_SETTINGS;
$data['settingtext'] = _BLOGLIST_SETTINGS;
$data['ttbanstext'] = _BLOGLIST_TT_BANS;
$data['banstext'] = _BLOGLIST_BANS;
}
if ( $vars['superadmin'] )
{
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )
{
$template .= $templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM'];
}
else
{
$template .= "\" title=\"<%ttdeletetext%>\"><%deletetext%> | \n";
}
$data['ttdeletetext'] = _BLOGLIST_TT_DELETE;
$data['deletetext'] = _BLOGLIST_DELETE;
}
break;
case 'FOOT':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_shortblognames($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_HEAD'];
}
else
{
$template = "<%colshortname%> | \n<%colblogname%> | \n";
}
$data = array(
'colshortname' => _EBLOG_SHORTNAME,
'colblogname' => _EBLOG_NAME,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY'];
}
else
{
$template = "<%bshortname%> | \n<%blogname%> | \n";
}
$data = array(
'bshortname' => Entity::hsc($current->bshortname),
'blogname' => Entity::hsc($current->bname),
);
break;
case 'FOOT':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_shortnames($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_HEAD'];
}
else
{
$template = "<%colname%> | <%coldesc%> | \n";
}
$data = array(
'colname' => _NAME,
'coldesc' => _LISTS_DESC,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY'];
}
else
{
$template = "<%name%> | <%desc%> | \n";
}
$data = array(
'name' => Entity::hsc($current->name),
'desc' => Entity::hsc($current->description),
);
break;
case 'FOOT':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_categorylist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_HEAD'];
}
else
{
$template = "<%colname%> | <%coldesc%> | <%colact%> | \n";
}
$data = array(
'colname' => _LISTS_NAME,
'coldesc' => _LISTS_DESC,
'colact' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_BODY'];
}
else
{
$template = "\n"
. "\" name=\"batch[<%batchid%>]\" value=\"<%catid%>\" />\n"
. "\n"
. " | \n"
. "<%catdesc%> | \n"
. "&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%editbtn%> | \n"
. "&catid=<%catid%>\" tabindex=\"<%tabindex%>\"><%delbtn%> | \n";
}
$data = array(
'batchid' => listplug_nextBatchId(),
'catid' => intval($current->catid),
'catname' => Entity::hsc($current->cname),
'catdesc' => Entity::hsc($current->cdesc),
'blogid' => intval($current->catcblogid),
'tabindex' => intval($vars['tabindex']),
'editbtn' => _LISTS_EDIT,
'delbtn' => _LISTS_DELETE,
);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_CATELIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_templatelist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
global $manager;
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
}
else
{
$template = "<%colname%> | <%coldesc%> | <%colact%> | \n";
}
$data = array(
'colname' => _LISTS_NAME,
'coldesc' => _LISTS_DESC,
'colact' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
}
else
{
$template = "<%templatename%> | \n"
. "<%templatedesc%> | \n"
. ""
. "\" tabindex=\"<%tabindex%>\"><%editbtn%>\n"
. " | \n"
. "\n"
. "\" tabindex=\"<%tabindex%>\"><%clonebtn%>\n"
. " | \n"
. "\n"
. "\" tabindex=\"<%tabindex%>\"><%delbtn%>\n"
. " | \n";
}
$url = "index.php?action=templateclone&templateid={$current->tdnumber}";
$data = array(
'templatename' => Entity::hsc($current->tdname),
'templatedesc' => Entity::hsc($current->tddesc),
'templateid' => (integer) $current->tdnumber,
'tabindex' => (integer) $vars['tabindex'],
'cloneurl' => Entity::hsc($manager->addTicketToUrl($url)),
'editbtn' => _LISTS_EDIT,
'clonebtn' => _LISTS_CLONE,
'delbtn' => _LISTS_DELETE,
);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_skinlist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
global $CONF, $DIR_SKINS, $manager;
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
}
else
{
$template = "<%colname%> | <%coldesc%> | <%colact%> | \n";
}
$data = array(
'colname' => _LISTS_NAME,
'coldesc' => _LISTS_DESC,
'colact' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
}
else
{
$template = "<%skinname%>
\n"
. "<%skintypelabel%> <%skintype%> \n"
. "<%incmodelabel%> <%incmode%> \n"
. "<%incpreflabel%> <%incpref%> \n"
. "<%skinthumb%>"
. "<%readme%> | \n"
. "<%skindesc%><%skinparts%> | \n"
. ""
. "\" tabindex=\"<%tabindex%>\"><%editbtn%>"
. " | \n"
. ""
. "\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
. " | \n"
. ""
. "\" tabindex=\"<%tabindex%>\"><%delbtn%>"
. " | \n";
}
$url = $manager->addTicketToUrl('index.php?action=skinclone&skinid=' . intval($current->sdnumber));
$data = array(
'skintypelabel' => _LISTS_TYPE,
'skintype' => Entity::hsc($current->sdtype),
'incmodelabel' => _LIST_SKINS_INCMODE,
'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',
'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',
'skindesc' => Entity::hsc($current->sddesc),
'skinid' => (integer) $current->sdnumber,
'tabindex' => $vars['tabindex'],
'cloneurl' => Entity::hsc($url),
'editbtn' => _LISTS_EDIT,
'clonebtn' => _LISTS_CLONE,
'delbtn' => _LISTS_DELETE,
);
// use a special style for the default skin
if ( $current->sdnumber == $CONF['BaseSkin'] )
{
$data['skinname'] = '' . Entity::hsc($current->sdname) . '';
}
else
{
$data['skinname'] = Entity::hsc($current->sdname);
}
// add preview image when present
if ( $current->sdincpref && @file_exists("{$DIR_SKINS}{$current->sdincpref}preview.png") )
{
$data['skinthumb'] = "\n";
$alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
$has_enlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');
if ( $has_enlargement )
{
$data['skinthumb'] .= '\n";
}
$data['skinthumb'] .= '
\n";
if ( $has_enlargement )
{
$data['skinthumb'] .= "
\n";
}
if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
{
$url = $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'readme.html';
$title = sprintf(_LIST_SKIN_README, $current->sdname);
$data['readme'] = "" . _LIST_SKIN_README_TXT . "\n";
}
else
{
$data['readme'] ="";
}
$data['skinthumb'] .= "
\n";
}
/* show list of defined parts */
$query = "SELECT stype FROM %s WHERE sdesc=%d ORDER BY stype";
$query = sprintf($query, sql_table('skin'), $current->sdnumber);
$r = sql_query($query);
$types = array();
while ( $o = sql_fetch_object($r) )
{
array_push($types, $o->stype);
}
if ( sizeof($types) > 0 )
{
for ( $i = 0; $i < sizeof($types); $i++ )
{
$type = $types[$i];
if ( !array_key_exists($type, $template['friendly_names']) || $type == strtolower($template['friendly_names'][$type]) )
{
$article = 'skinpartspecial';
}
else
{
$article = "skinpart{$type}";
}
$types[$i] = "\n"
. helpHtml($article) . "\n"
. "sdnumber}&type={$type}\" tabindex=\"{$template['tabindex']}\">"
. Entity::hsc($template['friendly_names'][$type])
. "\n"
. "\n";
}
$data['skinparts'] = '
' . _LIST_SKINS_DEFINED . "\n" . implode($types, '') . "
\n";
}
else
{
$data['skinparts'] = '';
}
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
}
else
{
$template = "";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_draftlist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_HEAD'];
}
else
{
$template = "<%colblog%> | <%coldesc%> | <%colact%> | \n";
}
$data = array(
'colblog' => _LISTS_BLOG,
'coldesc' => _LISTS_TITLE,
'colact' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY'];
}
else
{
$template = "<%bshortname%> | \n"
. "<%ititle%> | \n"
. "\"><%editbtn%> | \n"
. "\"><%delbtn%> | \n";
}
$data = array(
'bshortname' => Entity::hsc($current->bshortname),
'ititle' => Entity::hsc(strip_tags($current->ititle)),
'itemid' => intval($current->inumber),
'editbtn' => _LISTS_EDIT,
'delbtn' => _LISTS_DELETE,
);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_otherdraftlist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_HEAD'];
}
else
{
$template = "<%colblog%> | <%coldesc%> | <%colautr%> | <%colact%> | \n";
}
$data = array(
'colblog' => _LISTS_BLOG,
'coldesc' => _LISTS_TITLE,
'colautr' => _LISTS_AUTHOR,
'colact' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY'];
}
else
{
$template = "<%bshortname%> | \n"
. "<%ititle%> | \n"
. "<%iauthor%> | \n"
. "\"><%editbtn%> | \n"
. "\"><%delbtn%> | \n";
}
$data = array(
'bshortname' => Entity::hsc($current->bshortname),
'ititle' => Entity::hsc(strip_tags($current->ititle)),
'iauthor' => Entity::hsc(strip_tags($current->mname)),
'itemid' => intval($current->inumber),
'editbtn' => _LISTS_EDIT,
'delbtn' => _LISTS_DELETE,
);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_actionlist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_HEAD'];
}
else
{
$template = "<%coltime%> | <%colmesg%> | \n";
}
$data = array(
'coltime' => _LISTS_TIME,
'colmesg' => _LIST_ACTION_MSG,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY'];
}
else
{
$template = "<%timestamp%> | <%message%> | \n";
}
$data = array(
'timestamp' => Entity::hsc($current->timestamp),
'message' => Entity::hsc($current->message),
);
break;
case 'FOOT':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_banlist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_HEAD'];
}
else
{
$template = "<%iprange%> | <%reason%> | <%colact%> | \n";
}
$data = array(
'iprange' => _LIST_BAN_IPRANGE,
'reason' => _LIST_BAN_REASON,
'colact' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY'];
}
else
{
$template = "<%iprange%> | \n"
. "<%reason%> | \n"
. "&iprange=<%iprange%>\"><%delbtn%> | \n";
}
$data = array(
'iprange' => Entity::hsc($current->iprange),
'reason' => Entity::hsc($current->reason),
'blogid' => intval($current->blogid),
'delbtn' => _LISTS_DELETE,
);
break;
case 'FOOT':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_adminskinlist($vars, $type, $templateName = '')
{
global $CONF, $DIR_SKINS, $DIR_NUCLEUS, $manager;
$adminSkinURL = $CONF['SkinURL'] . 'admin/';
$adminSkinDir = $DIR_NUCLEUS . 'admin/';
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];
}
else
{
$template = "<%colname%> | <%coldesc%> | <%colact%> | \n";
}
$data = array(
'colname' => _LISTS_NAME,
'coldesc' => _LISTS_DESC,
'colact' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];
}
else
{
$template = "<%skinname%>
\n"
. "<%skintypelabel%> <%skintype%> \n"
. "<%incmodelabel%> <%incmode%> \n"
. "<%incpreflabel%> <%incpref%> \n"
. "<%skinthumb%>"
. "<%readme%> | \n"
. "<%skindesc%><%skinparts%> | \n"
. ""
. "\" tabindex=\"<%tabindex%>\"><%editbtn%>"
. " | \n"
. ""
. "\" tabindex=\"<%tabindex%>\"><%clonebtn%>"
. " | \n"
. ""
. "\" tabindex=\"<%tabindex%>\"><%delbtn%>"
. " | \n";
}
$url = $manager->addTicketToUrl('index.php?action=adminskinclone&skinid=' . intval($current->sdnumber));
$data = array(
'skintypelabel' => _LISTS_TYPE,
'skintype' => Entity::hsc($current->sdtype),
'incmodelabel' => _LIST_SKINS_INCMODE,
'incmode' => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,
'incpreflabel' => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',
'incpref' => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',
'skindesc' => Entity::hsc($current->sddesc),
'skinid' => (integer) $current->sdnumber,
'tabindex' => $vars['tabindex'],
'cloneurl' => Entity::hsc($url),
'editbtn' => _LISTS_EDIT,
'clonebtn' => _LISTS_CLONE,
'delbtn' => _LISTS_DELETE,
);
// use a special style for the default skin
if ( $current->sdnumber == $CONF['DefaultAdminSkin'] )
{
$data['skinname'] = '' . Entity::hsc($current->sdname) . '';
}
else
{
$data['skinname'] = Entity::hsc($current->sdname);
}
// add preview image when present
if ( $current->sdincpref && @file_exists("{$adminSkinDir}{$current->sdincpref}preview.png") )
{
$data['skinthumb'] = "\n";
$alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);
$has_enlargement = @file_exists($adminSkinDir . $current->sdincpref . 'preview-large.png');
if ( $has_enlargement )
{
$data['skinthumb'] .= '\n";
}
$data['skinthumb'] .= '
\n";
if ( $has_enlargement )
{
$data['skinthumb'] .= "
\n";
}
if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )
{
$url = $adminSkinURL . Entity::hsc($current->sdincpref) . 'readme.html';
$title = sprintf(_LIST_SKIN_README, $current->sdname);
$data['readme'] = "" . _LIST_SKIN_README_TXT . "\n";
}
else
{
$data['readme'] ="";
}
$data['skinthumb'] .= "
\n";
}
/* show list of defined parts */
$query = "SELECT stype FROM %s WHERE sdesc=%d ORDER BY stype";
$query = sprintf($query, sql_table('skin'), $current->sdnumber);
$r = sql_query($query);
$types = array();
while ( $o = sql_fetch_object($r) )
{
array_push($types, $o->stype);
}
if ( sizeof($types) > 0 )
{
for ( $i = 0; $i < sizeof($types); $i++ )
{
$type = $types[$i];
if ( !array_key_exists($type, $template['friendly_names']) || $type == strtolower($template['friendly_names'][$type]) )
{
$article = 'skinpartspecial';
}
else
{
$article = "skinpart{$type}";
}
$types[$i] = "\n"
. helpHtml($article) . "\n"
. "sdnumber}&type={$type}\" tabindex=\"{$vars['tabindex']}\">"
. Entity::hsc($template['friendly_names'][$type])
. "\n"
. "\n";
}
$data['skinparts'] = '
' . _LIST_SKINS_DEFINED . "\n" . implode($types, '') . "
\n";
}
else
{
$data['skinparts'] = '';
}
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];
}
else
{
$template = "";
}
$data = array();
break;
}
return Template::fill($template, $data);
}
function listplug_table_admintemplatelist($vars, $type, $templateName = '')
{
$templates = array();
if ( !empty($templateName) )
{
$templates = Template::read($templateName);
}
global $manager;
switch( $type )
{
case 'HEAD':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];
}
else
{
$template = "<%colname%> | <%coldesc%> | <%colact%> | \n";
}
$data = array(
'colname' => _LISTS_NAME,
'coldesc' => _LISTS_DESC,
'colact' => _LISTS_ACTIONS,
);
break;
case 'BODY':
$current = $vars['current'];
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];
}
else
{
$template = "<%templatename%> | \n"
. "<%templatedesc%> | \n"
. ""
. "\" tabindex=\"<%tabindex%>\"><%editbtn%>\n"
. " | \n"
. "\n"
. "\" tabindex=\"<%tabindex%>\"><%clonebtn%>\n"
. " | \n"
. "\n"
. "\" tabindex=\"<%tabindex%>\"><%delbtn%>\n"
. " | \n";
}
$url = "index.php?action=admintemplateclone&templateid={$current->tdnumber}";
$data = array(
'templatename' => Entity::hsc($current->tdname),
'templatedesc' => Entity::hsc($current->tddesc),
'templateid' => (integer) $current->tdnumber,
'tabindex' => (integer) $vars['tabindex'],
'cloneurl' => Entity::hsc($manager->addTicketToUrl($url)),
'editbtn' => _LISTS_EDIT,
'clonebtn' => _LISTS_CLONE,
'delbtn' => _LISTS_DELETE,
);
break;
case 'FOOT':
if ( isset($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) || !empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )
{
$template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];
}
else
{
$template = "\n";
}
$data = array();
break;
}
return Template::fill($template, $data);
}