*
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2009 The Nucleus Group
+<<<<<<< HEAD
+ * @version $Id: showlist.php 1785 2012-04-22 11:25:14Z sakamocchi $
+=======
* @version $Id: showlist.php 1886 2012-06-17 08:27:27Z sakamocchi $
+>>>>>>> skinnable-master
*/
// can take either an array of objects, or an SQL query
+<<<<<<< HEAD
+function showlist($query, $type, $template)
+{
+ if ( is_array($query) )
+ {
+ if ( sizeof($query) == 0 )
+ {
+ return 0;
+ }
+
+ call_user_func("listplug_{$type}", $template, 'HEAD');
+
+ foreach ( $query as $currentObj )
+ {
+ $template['current'] = $currentObj;
+ call_user_func("listplug_{$type}", $template, 'BODY');
+ }
+
+ call_user_func("listplug_{$type}", $template, 'FOOT');
+
+ return sizeof($query);
+ }
+ else
+ {
+ $res = DB::getResult($query);
+
+ // don't do anything if there are no results
+ $numrows = $res->rowCount();
+ if ( $numrows == 0 )
+ {
+ return 0;
+ }
+ call_user_func("listplug_{$type}", $template, 'HEAD');
+
+ foreach ( $res as $row )
+ {
+ $template['current'] = $row;
+ call_user_func("listplug_{$type}", $template, 'BODY');
+ }
+
+ call_user_func("listplug_{$type}", $template, 'FOOT');
+
+ $res->closeCursor();
+
+ // return amount of results
+ return $numrows;
+ }
+}
+
+function listplug_select($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo "<select name=\"{$template['name']}\" tabindex=\"{$template['tabindex']}\"";
+ if ( array_key_exists('javascript', $template) && !empty($template['javascript']) )
+ {
+ echo " {$template['javascript']}";
+ }
+ echo ">\n";
+
+ // add extra row if needed
+ if ( array_key_exists('extra', $template) && !empty($template['extra']) )
+ {
+ echo "<option value=\"{$template['extraval']}\">{$template['extra']}</option>\n";
+ }
+
+ break;
+ case 'BODY':
+ $current = $template['current'];
+
+ echo '<option value="' . Entity::hsc($current['value']) . '"';
+ if ( array_key_exists('selected', $template) && $template['selected'] == $current['value'] )
+ {
+ echo ' selected="selected" ';
+ }
+ if ( isset($template['shorten']) && $template['shorten'] > 0 )
+ {
+ echo ' title="'. Entity::hsc($current['text']).'"';
+ $current['text'] = Entity::hsc(Entity::shorten($current['text'], $template['shorten'], $template['shortenel']));
+ }
+ echo '>' . Entity::hsc($current['text']) . "</option>\n";
+ break;
+ case 'FOOT':
+ echo '</select>';
+ break;
+ }
+ return;
+}
+
+function listplug_table($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo "\n\n";
+ echo "<table frame=\"box\" rules=\"all\" summary=\"{$template['content']}\">\n";
+ echo "<thead>\n";
+ echo "<tr>\n";
+ // print head
+ call_user_func("listplug_table_{$template['content']}" , $template, 'HEAD');
+ echo "</tr>\n";
+ echo "</thead>\n";
+ echo "<tbody>\n";
+ break;
+ case 'BODY':
+ // print tabletype specific thingies
+ echo "<tr>\n";
+ call_user_func("listplug_table_{$template['content']}" , $template, 'BODY');
+ echo "</tr>\n";
+ break;
+ case 'FOOT':
+ call_user_func("listplug_table_{$template['content']}" , $template, 'FOOT');
+ echo "</tbody>\n";
+ echo "</table>\n";
+ echo "\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_memberlist($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LIST_MEMBER_NAME . "</th>\n";
+ echo '<th>' . _LIST_MEMBER_RNAME . "</th>\n";
+ echo '<th>' . _LIST_MEMBER_URL . "</th>\n";
+ echo '<th>' . _LIST_MEMBER_ADMIN;
+ help('superadmin');
+ echo "</th>\n";
+ echo '<th>' . _LIST_MEMBER_LOGIN;
+ help('canlogin');
+ echo "</th>\n";
+ echo '<th colspan="2">' . _LISTS_ACTIONS. "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ echo '<td>';
+ $id = listplug_nextBatchId();
+ echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}]\" value=\"{$current['mnumber']}\" />\n";
+ echo "<label for=\"batch{$id}\">\n";
+ echo '<a href="mailto:' . Entity::hsc($current['memail']) . '" tabindex="' . $template['tabindex'] . '">' . Entity::hsc($current['mname']), "</a>\n";
+ echo "</label>\n";
+ echo "</td>";
+ echo "<td>" . Entity::hsc($current['mrealname']) . "</td>\n";
+ echo '<td><a href="' . Entity::hsc($current['murl']) . '" tabindex="' . $template['tabindex'] . '">' . Entity::hsc($current['murl']) . "</a></td>\n";
+ echo '<td>' . ($current['madmin'] ? _YES : _NO) . "</td>\n";
+ echo '<td>' . ($current['mcanlogin'] ? _YES : _NO) . "</td>\n";
+ echo '<td><a href="index.php?action=memberedit&memberid=' . $current['mnumber'] . '" tabindex="' . $template['tabindex'] . '">' . _LISTS_EDIT . "</a></td>\n";
+ echo '<td><a href="index.php?action=memberdelete&memberid=' . $current['mnumber'] . '" tabindex="' . $template['tabindex'].'">' . _LISTS_DELETE . "</a></td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_teamlist($template, $type)
+{
+ global $manager;
+ switch( $type )
+ {
+ case 'HEAD':
+ echo "<th>" . _LIST_MEMBER_NAME . "</th>\n";
+ echo "<th>" . _LIST_MEMBER_RNAME . "</th>\n";
+ echo "<th>" . _LIST_TEAM_ADMIN;
+ help('teamadmin');
+ echo "</th>\n";
+ echo "<th colspan=\"2\">"._LISTS_ACTIONS."</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+
+ echo '<td>';
+ $id = listplug_nextBatchId();
+ echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}]\" value=\"{$current['tmember']}\" />\n";
+ echo '<label for="batch',$id,'">';
+ echo '<a href="mailto:' . Entity::hsc($current['memail']) . '" tabindex="' . $template['tabindex'] . '">' . Entity::hsc($current['mname']), "</a>\n";
+ echo "</label>\n";
+ echo "</td>";
+ echo '<td>', Entity::hsc($current['mrealname']), "</td>\n";
+ echo '<td>', ($current['tadmin'] ? _YES : _NO) , "</td>\n";
+ echo '<td><a href="index.php?action=teamdelete&memberid=' . $current['tmember'] . '&blogid=' . $current['tblog'] . '" tabindex="' . $template['tabindex'] . '">' . _LISTS_DELETE . "</a></td>\n";
+
+ $url = "index.php?action=teamchangeadmin&memberid={$current['tmember']}&blogid={$current['tblog']}";
+ $url = $manager->addTicketToUrl($url);
+ echo '<td><a href="' . Entity::hsc($url) . '" tabindex="' . $template['tabindex'] . '">' . _LIST_TEAM_CHADMIN . "</a></td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_pluginlist($template, $type)
+{
+ global $manager;
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_INFO . "</th>\n";
+ echo '<th>' . _LISTS_DESC . "</th>\n";
+ echo '<th>' . _LISTS_ACTIONS . "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+=======
function showlist($query, $type, $vars, $template_name = '')
{
$contents = '';
break;
case 'BODY':
$current = $vars['current'];
+>>>>>>> skinnable-master
$plug =& $manager->getPlugin($current['pfile']);
if ( $plug )
{
+<<<<<<< HEAD
+ echo "<td>\n";
+ echo '<h3>' . Entity::hsc($plug->getName()) . "</h3>\n";
+
+ echo "<dl>\n";
+ if ( $plug->getAuthor() )
+ {
+ echo '<dt>' . _LIST_PLUGS_AUTHOR . "</dt>\n";
+ echo '<dd>' . Entity::hsc($plug->getAuthor()) , "</dd>\n";
+ }
+
+ if ( $plug->getVersion() )
+ {
+ echo '<dt>' . _LIST_PLUGS_VER, "</dt>\n";
+ echo '<dd>' . Entity::hsc($plug->getVersion()) . "</dd>\n";
+ }
+
+ if ( $plug->getURL() )
+ {
+ echo '<dt>' . _LIST_PLUGS_SITE . "<dt>\n";
+ echo '<dd><a href="' . Entity::hsc($plug->getURL()) . '" tabindex="' . $template['tabindex'] . '">リンク</a></dd>' . "\n";
+ }
+ echo "</dl>\n";
+ echo "</td>\n";
+
+ echo "<td>\n";
+ echo "<dl>\n";
+ echo '<dt>' . _LIST_PLUGS_DESC ."</dt>\n";
+ echo '<dd>' . Entity::hen($plug->getDescription()) ."</dd>\n";
+ if ( sizeof($plug->getEventList()) > 0 )
+ {
+ echo '<dt>' . _LIST_PLUGS_SUBS ."</dt>\n";
+ echo '<dd>' . Entity::hsc(implode(', ', $plug->getEventList())) ."</dd>\n";
+ }
+
+ if ( sizeof($plug->getPluginDep()) > 0 )
+ {
+ echo '<dt>' . _LIST_PLUGS_DEP ."</dt>\n";
+ echo '<dd>' . Entity::hsc(implode(', ', $plug->getPluginDep())) ."</dd>\n";
+ }
+
+ /* check dependency */
+ $req = array();
+ $res = DB::getResult('SELECT pfile FROM ' . sql_table('plugin'));
+ foreach ( $res as $row )
+ {
+ $preq =& $manager->getPlugin($row['pfile']);
+=======
if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) )
{
$template = "<td>\n"
foreach ( $plugins as $plugin )
{
$preq =& $manager->getPlugin($plugin['pfile']);
+>>>>>>> skinnable-master
if ( $preq )
{
$depList = $preq->getPluginDep();
{
if ( $current['pfile'] == $depName )
{
+<<<<<<< HEAD
+ $req[] = $row['pfile'];
+=======
$req[] = $plugin['pfile'];
+>>>>>>> skinnable-master
}
}
}
if ( count($req) > 0 )
{
+<<<<<<< HEAD
+ echo '<dt>' . _LIST_PLUGS_DEPREQ . "</dt>\n";
+ echo '<dd>' . Entity::hsc(implode(', ', $req)) . "</dd>\n";
+ }
+
+ /* check the database to see if it is up-to-date and notice the user if not */
+ if ( !$plug->subscribtionListIsUptodate() )
+ {
+ echo '<dt>' . 'NOTICE:' . "</dt>\n";
+ echo '<dd>' . _LIST_PLUG_SUBS_NEEDUPDATE . "</dd>\n";
+ }
+
+ echo "</dl>\n";
+ echo "</td>\n";
+ }
+ else
+ {
+ echo '<td colspan="2">' . sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current['pfile'])) . "</td>\n";
+ }
+
+ echo "<td>\n";
+ echo "<ul>\n";
+ $current['pid'] = (integer) $current['pid'];
+
+ $url = Entity::hsc($manager->addTicketToUrl("index.php?plugid={$current['pid']}&action=pluginup"));
+ echo "<li><a href=\"{$url}\" tabindex=\"{$template['tabindex']}\">" , _LIST_PLUGS_UP , "</a></li>\n";
+
+ $url = Entity::hsc($manager->addTicketToUrl("index.php?plugid={$current['pid']}&action=plugindown"));
+ echo "<li><a href=\"{$url}\" tabindex=\"{$template['tabindex']}\">" . _LIST_PLUGS_DOWN , "</a></li>\n";
+ echo "<li><a href=\"index.php?action=plugindelete&plugid={$current['pid']}\" tabindex=\"{$template['tabindex']}\">" . _LIST_PLUGS_UNINSTALL , "</a></li>\n";
+
+ if ( $plug && ($plug->hasAdminArea() > 0) )
+ {
+ echo '<li><a href="' , Entity::hsc($plug->getAdminURL()) , '" tabindex="' , $template['tabindex'] , '">' , _LIST_PLUGS_ADMIN , "</a></li>\n";
+ }
+
+ if ( $plug && ($plug->supportsFeature('HelpPage') > 0) )
+ {
+ echo "<li><a href=\"index.php?action=pluginhelp&plugid={$current['pid']}\" tabindex=\"{$template['tabindex']}\">" . _LIST_PLUGS_HELP , "</a></li>\n";
+ }
+
+ $query = "SELECT COUNT(*) AS result FROM %s WHERE ocontext='global' and opid=%s;";
+ $query = sprintf($query, sql_table('plugin_option_desc'), (integer) $current['pid']);
+ if ( DB::getValue($query) > 0 )
+ {
+ echo "<li><a href=\"index.php?action=pluginoptions&plugid={$current['pid']}\" tabindex=\"{$template['tabindex']}\">" . _LIST_PLUGS_OPTIONS . "</a></li>\n";
+ }
+ echo "</ul>\n";
+ echo "</td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_plugoptionlist($template, $type)
+{
+ global $manager;
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_INFO . "</th>\n";
+ echo '<th>' . _LISTS_VALUE . "</th>\n";
+ break;
+ case 'BODY':
+ listplug_plugOptionRow($template['current']);
+ break;
+ case 'FOOT':
+ echo "<tr>\n";
+ echo '<th colspan="2">' . _PLUGS_SAVE . "</th>\n";
+ echo "</tr>\n";
+ echo "<tr>\n";
+ echo "<td>" . _PLUGS_SAVE . "</td>\n";
+ echo "<td><input type=\"submit\" value=\"". _PLUGS_SAVE . "\" /></td>\n";
+ echo "</tr>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_plugOptionRow($current)
+{
+=======
if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGIN_DEPREQ']) )
{
$subTpl = "<br /><br /><%deprlstlbl%><br /><%depreqlist%>";
$templates =& $manager->getTemplate($template_name);
}
+>>>>>>> skinnable-master
$varname = "plugoption[{$current['oid']}][{$current['contextid']}]";
// retreive the optionmeta
// only if it is not a hidden option write the controls to the page
if ( in_array('access', $meta) && $meta['access'] == 'hidden' )
{
+<<<<<<< HEAD
+ return;
+ }
+
+ if ( !$current['description'] )
+ {
+ echo '<td>' , Entity::hsc($current['name']) . "</td>\n";
+ }
+ else
+ {
+ if ( !defined($current['description']) )
+ {
+ echo '<td>' , Entity::hsc($current['description']) . "</td>\n";
+ }
+ else
+ {
+ echo '<td>' , Entity::hsc(constant($current['description'])) . "</td>\n";
+ }
+ }
+ echo "<td>\n";
+ switch($current['type'])
+ {
+ case 'yesno':
+ Admin::input_yesno($varname, $current['value'], 0, 'yes', 'no');
+ break;
+ case 'password':
+ echo '<input type="password" size="40" maxlength="128" name="',Entity::hsc($varname),'" value="',Entity::hsc($current['value']),"\" />\n";
+ break;
+ case 'select':
+ echo '<select name="'.Entity::hsc($varname)."\">\n";
+ $options = NucleusPlugin::getOptionSelectValues($current['typeinfo']);
+ $options = preg_split('/\|/', $options);
+
+ for ( $i=0; $i<(count($options)-1); $i+=2 )
+ {
+ if ($options[$i+1] == $current['value'])
+ {
+ echo '<option value="' . Entity::hsc($options[$i+1]) . '" selected="selected">';
+ }
+ else
+ {
+ echo '<option value="' . Entity::hsc($options[$i+1]) . '">';
+ }
+ if ( defined($options[$i]) )
+ {
+ echo Entity::hsc(constant($options[$i]));
+ }
+ else
+ {
+ echo Entity::hsc($options[$i]);
+ }
+ echo "</option>\n";
+ }
+ echo "</select>\n";
+
+ break;
+ case 'textarea':
+ //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
+ if ( array_key_exists('access', $meta) && $meta['access'] == 'readonly' )
+ {
+ echo '<textarea class="pluginoption" cols="30" rows="5" name="' . Entity::hsc($varname) . "\" readonly=\"readonly\">\n";
+ }
+ else
+ {
+ echo '<textarea class="pluginoption" cols="30" rows="5" name="' . Entity::hsc($varname) . "\">\n";
+ }
+ echo Entity::hsc($current['value']) . "\n";
+ echo "</textarea>\n";
+ break;
+ case 'text':
+ default:
+ //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
+ echo '<input type="text" size="40" maxlength="128" name="',Entity::hsc($varname),'" value="',Entity::hsc($current['value']),'"';
+ if ( array_key_exists('datatype', $meta) && $meta['datatype'] == 'numerical' )
+ {
+ echo ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
+ }
+ if ( array_key_exists('access', $current) && $meta['access'] == 'readonly')
+ {
+ echo ' readonly="readonly"';
+ }
+ echo " />\n";
+ }
+ if ( array_key_exists('extra', $current) )
+ {
+ echo $current['extra'];
+ }
+ echo "</td>\n";
+
+ return;
+}
+
+function listplug_table_itemlist($template, $type)
+{
+ $cssclass = '';
+=======
return false;
}
else
{
$templates =& $manager->getTemplate($template_name);
}
+>>>>>>> skinnable-master
switch( $type )
{
case 'HEAD':
+<<<<<<< HEAD
+ echo "<th>"._LIST_ITEM_INFO."</th>\n";
+ echo "<th>"._LIST_ITEM_CONTENT."</th>\n";
+ echo "<th colspan='1'>"._LISTS_ACTIONS."</th>";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ // string -> unix timestamp
+ $current['itime'] = strtotime($current['itime']);
+
+ if ( $current['idraft'] == 1 )
+ {
+ $cssclass = " class='draft'";
+ }
+
+ // (can't use offset time since offsets might vary between blogs)
+ if ( $current['itime'] > $template['now'] )
+ {
+ $cssclass = " class='future'";
+ }
+
+ echo "<td{$cssclass}>\n";
+ echo "<dl>\n";
+ echo '<dt>' . _LIST_ITEM_BLOG . "</dt>\n";
+ echo '<dd>' . Entity::hsc($current['bshortname']) . "</dd>\n";
+ echo '<dt>' . _LIST_ITEM_CAT . "</dt>\n";
+ echo '<dd>' . Entity::hsc($current['cname']) . "</dd>\n";
+ echo '<dt>' . _LIST_ITEM_AUTHOR . "</dt>\n";
+ echo '<dd>' . Entity::hsc($current['mname']) . "</dd>\n";
+ echo '<dt>' . _LIST_ITEM_DATE . "</dt>\n";
+ echo '<dd>' . date("Y-m-d",$current['itime']) . "</dd>\n";
+ echo '<dt>' . _LIST_ITEM_TIME . "</dt>\n";
+ echo '<dd>' . date("H:i",$current['itime']) . "</dd>\n";
+ echo "</dl>\n";
+ echo "</td>\n";
+
+ $id = listplug_nextBatchId();
+
+ echo "<td{$cssclass}>\n";
+ echo "<h3>\n";
+ echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}]\" value=\"{$current['inumber']}\" />\n";
+ echo "<label for=\"batch{$id}\">" . Entity::hsc(strip_tags($current['ititle'])) . "</label>\n";
+ echo "</h3>\n";
+
+ $current['ibody'] = strip_tags($current['ibody']);
+ $current['ibody'] = Entity::hsc(Entity::shorten($current['ibody'], 300, '...'));
+ echo "<p>{$current['ibody']}</p>\n";
+ echo "</td>\n";
+
+ echo "<td{$cssclass}>\n";
+ echo "<ul>\n";
+ echo "<li><a href=\"index.php?action=itemedit&itemid={$current['inumber']}\">" . _LISTS_EDIT . "</a></li>\n";
+
+ // evaluate amount of comments for the item
+ $COMMENTS = new Comments($current['inumber']);
+ $camount = $COMMENTS->amountComments();
+ if ( $camount > 0 )
+ {
+ echo "<li><a href=\"index.php?action=itemcommentlist&itemid={$current['inumber']}\">( ";
+ echo sprintf(_LIST_ITEM_COMMENTS, $COMMENTS->amountComments()) . " )</a></li>\n";
+ }
+ else
+ {
+ echo '<li>' . _LIST_ITEM_NOCONTENT . "</li>\n";
+ }
+
+ echo "<li><a href=\"index.php?action=itemmove&itemid={$current['inumber']}\">" . _LISTS_MOVE . "</a></li>\n";
+ echo "<li><a href=\"index.php?action=itemdelete&itemid={$current['inumber']}\">" . _LISTS_DELETE . "</a></li>\n";
+ echo "</ul>\n";
+ echo "</td>\n";
+ break;
+ }
+ return;
+=======
if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_HEAD']) )
{
$template = "<th><%colinfo%></th>\n"
break;
}
return Template::fill($template, $data);
+>>>>>>> skinnable-master
}
// for batch operations: generates the index numbers for checkboxes
return $id++;
}
+<<<<<<< HEAD
+function listplug_table_commentlist($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_INFO . "</th>\n";
+ echo '<th>' . _LIST_COMMENT . "</th>\n";
+ echo '<th colspan="3">' . _LISTS_ACTIONS . "</th>";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['ctime'] = strtotime($current['ctime']); // string -> unix timestamp
+
+ echo "<td>\n";
+ echo "<ul>\n";
+ echo '<li>' . date("Y-m-d@H:i",$current['ctime']) . "</li>\n";
+ if ( isset($current['mname']) )
+ {
+ echo '<li>' . Entity::hsc($current['mname']) ,' ', _LIST_COMMENTS_MEMBER . "</li>\n";
+ }
+ else
+ {
+ echo '<li>' . Entity::hsc($current['cuser']) . "</li>\n";
+ }
+ if ( isset($current['cmail']) && $current['cmail'] )
+ {
+ echo '<li>' . Entity::hsc($current['cmail']) . "</li>\n";
+ }
+ if ( isset($current['cemail']) && $current['cemail'] )
+ {
+ echo '<li>' . Entity::hsc($current['cemail']) . "</li>\n";
+ }
+ echo "</ul>\n";
+ echo "</td>\n";
+
+ $id = listplug_nextBatchId();
+
+ echo '<td>';
+ echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}\" value=\"{$current['cnumber']}\" />\n";
+ echo "<label for=\"batch{$id}\">\n";
+ $current['cbody'] = strip_tags($current['cbody']);
+ $current['cbody'] = Entity::hsc(Entity::shorten($current['cbody'], 300, '...'));
+ echo $current['cbody'];
+ echo '</label>';
+ echo '</td>';
+
+ echo '<td><a href="index.php?action=commentedit&commentid=' . $current['cnumber'] . '">' . _LISTS_EDIT . "</a></td>\n";
+ echo '<td><a href="index.php?action=commentdelete&commentid=' . $current['cnumber'] . '">' . _LISTS_DELETE . "</a></td>\n";
+ if ( $template['canAddBan'] )
+ {
+ echo '<td><a href="index.php?action=banlistnewfromitem&itemid=' . $current['citem'] . '&ip=' . Entity::hsc($current['cip']), '" title="' . Entity::hsc($current['chost']) . '">' . _LIST_COMMENT_BANIP . "</a></td>\n";
+ }
+ break;
+ }
+ return;
+}
+
+function listplug_table_bloglist($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _NAME . "</th>\n";
+ echo '<th colspan="7">' . _LISTS_ACTIONS . "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['bname'] = Entity::hsc($current['bname']);
+
+ echo "<td title=\"blogid:{$current['bnumber']} shortname:{$current['bshortname']}\"><a href=\"{$current['burl']}\"><img src=\"images/globe.gif\" width=\"13\" height=\"13\" alt=\"". _BLOGLIST_TT_VISIT."\" /></a>{$current['bname']}</td>\n";
+ echo "<td><a href=\"index.php?action=createitem&blogid={$current['bnumber']}\" title=\"" . _BLOGLIST_TT_ADD ."\">" . _BLOGLIST_ADD . "</a></td>\n";
+ echo "<td><a href=\"index.php?action=itemlist&blogid={$current['bnumber']}\" title=\"". _BLOGLIST_TT_EDIT."\">". _BLOGLIST_EDIT."</a></td>\n";
+ echo "<td><a href=\"index.php?action=blogcommentlist&blogid={$current['bnumber']}\" title=\"". _BLOGLIST_TT_COMMENTS."\">". _BLOGLIST_COMMENTS."</a></td>\n";
+ echo "<td><a href=\"index.php?action=bookmarklet&blogid={$current['bnumber']}\" title=\"". _BLOGLIST_TT_BMLET."\">". _BLOGLIST_BMLET . "</a></td>\n";
+
+ if ( $current['tadmin'] == 1 )
+ {
+ echo "<td><a href=\"index.php?action=blogsettings&blogid={$current['bnumber']}\" title=\"" . _BLOGLIST_TT_SETTINGS . "\">" . _BLOGLIST_SETTINGS . "</a></td>\n";
+ echo "<td><a href=\"index.php?action=banlist&blogid={$current['bnumber']}\" title=\"" . _BLOGLIST_TT_BANS . "\">" . _BLOGLIST_BANS . "</a></td>\n";
+ }
+
+ if ( $template['superadmin'] )
+ {
+ echo "<td><a href=\"index.php?action=deleteblog&blogid={$current['bnumber']}\" title=\"". _BLOGLIST_TT_DELETE."\">" ._BLOGLIST_DELETE. "</a></td>\n";
+ }
+ break;
+ }
+ return;
+}
+
+function listplug_table_shortblognames($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _EBLOG_SHORTNAME . "</th>\n";
+ echo '<th>' . _EBLOG_NAME. "</th>";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['bshortname'] = Entity::hsc($current['bshortname']);
+ $current['bname'] = Entity::hsc($current['bname']);
+
+ echo "<td>{$current['bshortname']}</td>\n";
+ echo "<td>{$current['bname']}</td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_shortnames($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _NAME . "</th>\n";
+ echo '<th>' . _LISTS_DESC. "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['name'] = Entity::hsc($current['name']);
+ $current['description'] = Entity::hsc($current['description']);
+
+ echo "<td>{$current['name']}</td>\n";
+ echo "<td>{$current['description']}</td>\n";
+ break;
+ }
+ return;
+}
+
+
+function listplug_table_categorylist($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_NAME . "</th>";
+ echo '<th>' . _LISTS_DESC."</th>\n";
+ echo '<th colspan="2">' . _LISTS_ACTIONS . "</th>\n";
+ break;
+ case 'BODY':
+ $id = listplug_nextBatchId();
+
+ $current = $template['current'];
+ $current['cname'] = Entity::hsc($current['cname']);
+ $current['cdesc'] = Entity::hsc($current['cdesc']);
+
+ echo "<td>\n";
+ echo "<input type=\"checkbox\" id=\"batch{$id}\" name=\"batch[{$id}]\" value=\"{$current['catid']}\" />\n";
+ echo "<label for=\"batch{$id}\">{$current['cname']}</label>\n";
+ echo "</td>\n";
+ echo "<td>{$current['cdesc']}</td>\n";
+ echo "<td><a href=\"index.php?action=categoryedit&blogid={$current['cblog']}&catid={$current['catid']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_EDIT . "</a></td>\n";
+ echo "<td><a href=\"index.php?action=categorydelete&blogid={$current['cblog']}&catid={$current['catid']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . "</a></td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_templatelist($template, $type)
+{
+ global $manager;
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_NAME . "</th>\n";
+ echo '<th>' . _LISTS_DESC . "</th>\n";
+ echo '<th colspan="3">' . _LISTS_ACTIONS . "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['tdnumber'] = (integer) $current['tdnumber'];
+ $current['tdname'] = Entity::hsc($current['tdname']);
+ $current['tddesc'] = Entity::hsc($current['tddesc']);
+
+ $url = "index.php?action=templateclone&templateid={$current['tdnumber']}";
+ $url = Entity::hsc($manager->addTicketToUrl($url));
+
+ echo "<td>{$current['tdname']}</td>\n";
+ echo "<td>{$current['tddesc']}</td>\n";
+ echo "<td>\n";
+ echo "<a href=\"index.php?action=templateedit&templateid={$current['tdnumber']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_EDIT . "</a>\n";
+ echo "</td>\n";
+ echo "<td>\n";
+ echo "<a href=\"{$url}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_CLONE . "</a>\n";
+ echo "</td>\n";
+ echo "<td>\n";
+ echo "<a href=\"index.php?action=templatedelete&templateid={$current['tdnumber']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . "</a>\n";
+ echo "</td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_skinlist($template, $type)
+{
+ global $CONF, $DIR_SKINS, $manager;
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_NAME . "</th>\n";
+ echo '<th>' . _LISTS_DESC . "</th>\n";
+ echo '<th colspan="3">' . _LISTS_ACTIONS . "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['sdnumber'] = (integer) $current['sdnumber'];
+ $current['sdname'] = Entity::hsc($current['sdname']);
+ $current['sdtype'] = Entity::hsc($current['sdtype']);
+
+ echo "<td>\n";
+
+ // use a special style for the default skin
+ if ( $current['sdnumber'] == $CONF['BaseSkin'] )
+ {
+ echo '<h3 id="base_skin">' . $current['sdname'] . "</h3>\n";
+ }
+ else
+ {
+ echo '<h3>' . $current['sdname'] . "</h3>\n";
+ }
+
+ echo "<dl>\n";
+ echo '<dt>' . _LISTS_TYPE . "</dt>\n";
+ echo '<dd>' . $current['sdtype'] . "</dd>\n";
+
+ echo '<dt>' . _LIST_SKINS_INCMODE . "</dt>\n";
+
+ if ( $current['sdincmode'] == 'skindir' )
+ {
+ echo '<dd>' . _PARSER_INCMODE_SKINDIR . "</dd>\n";
+ }
+ else
+ {
+ echo '<dd>' . _PARSER_INCMODE_NORMAL . "</dd>\n";
+ }
+
+ if ( $current['sdincpref'] )
+ {
+ echo '<dt>' . _LIST_SKINS_INCPREFIX . "</dt>\n";
+ echo '<dd>' . Entity::hsc($current['sdincpref']) . "</dd>\n";
+ }
+ echo "</dl>\n";
+=======
function listplug_table_commentlist($vars, $type, $template_name = '')
{
global $manager;
{
$data['skinname'] = '<strong>' . Entity::hsc($current['sdname']) . '</strong>';
}
+>>>>>>> skinnable-master
// add preview image when present
if ( $current['sdincpref'] && @file_exists("{$DIR_SKINS}{$current['sdincpref']}preview.png") )
{
+<<<<<<< HEAD
+ echo "<p>\n";
+=======
$data['skinthumb'] = "<p>\n";
+>>>>>>> skinnable-master
$alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current['sdname']);
$has_enlargement = @file_exists($DIR_SKINS . $current['sdincpref'] . 'preview-large.png');
if ( $has_enlargement )
{
+<<<<<<< HEAD
+ echo '<a href="',$CONF['SkinsURL'], Entity::hsc($current['sdincpref']),'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
+ echo '<img class="skinpreview" src="',$CONF['SkinsURL'], Entity::hsc($current['sdincpref']),'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
+ echo "</a><br />\n";
+ }
+ else
+ {
+ echo '<img class="skinpreview" src="',$CONF['SkinsURL'], Entity::hsc($current['sdincpref']),'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" /><br />\n";
+=======
$data['skinthumb'] .= '<a href="' . $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";
}
$data['skinthumb'] .= '<img class="skinpreview" src="' . $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";
if ( $has_enlargement )
{
$data['skinthumb'] .= "</a><br />\n";
+>>>>>>> skinnable-master
}
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']);
+<<<<<<< HEAD
+ echo "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
+ }
+
+ echo "</p>\n";
+ }
+
+ echo "</td>\n";
+
+ echo "<td>\n";
+ echo '<p>' . Entity::hsc($current['sddesc']) . "</p>\n";
+
+ /* make list of defined skins */
+ $skin = new Skin($current['sdnumber']);
+ $available_skin_types = $skin->getAvailableTypes();
+
+ echo _LIST_SKINS_DEFINED;
+ echo "<ul>\n";
+ foreach ( $available_skin_types as $type => $friendlyName )
+ {
+ if ( $friendlyName === FALSE )
+ {
+ $friendlyName = ucfirst($type);
+=======
$data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";
}
else
if ( $label === FALSE )
{
$label = ucfirst($type);
+>>>>>>> skinnable-master
$article = 'skinpartspecial';
}
else
{
$article = "skinpart{$type}";
}
+<<<<<<< HEAD
+ echo "<li>\n";
+ echo helpHtml($article) . "\n";
+ echo "<a href=\"index.php?action=skinedittype&skinid={$current['sdnumber']}&type={$type}\" tabindex=\"{$template['tabindex']}\">";
+ echo Entity::hsc($friendlyName);
+ echo "</a>\n";
+ echo "</li>\n";
+ }
+ echo "</ul>\n";
+
+ echo "</td>";
+ echo "<td>\n";
+ echo "<a href=\nindex.php?action=skinedit&skinid={$current['sdnumber']}\n tabindex=\n{$template['tabindex']}>" . _LISTS_EDIT . "</a>\n";
+ echo "</td>\n";
+
+ $url = "index.php?action=skinclone&skinid={$current['sdnumber']}";
+ $url = Entity::hsc($manager->addTicketToUrl($url));
+ echo "<td>\n";
+ echo "<a href=\"{$url}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_CLONE . "</a>\n";
+ echo "</td>\n";
+ echo "<td>\n";
+ echo "<a href=\"index.php?action=skindelete&skinid={$current['sdnumber']}\" tabindex=\"{$template['tabindex']}\">" . _LISTS_DELETE . "</a></td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_draftlist($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_BLOG . "</th>\n";
+ echo '<th>' . _LISTS_TITLE . "</th>\n";
+ echo '<th colspan="2">' . _LISTS_ACTIONS . "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['bshortname'] = Entity::hsc($current['bshortname']);
+ $current['ititle'] = Entity::hsc(strip_tags($current['ititle']));
+
+ echo "<td>{$current['bshortname']}</td>\n";
+ echo "<td>{$current['ititle']}</td>\n";
+ echo "<td><a href=\"index.php?action=itemedit&itemid={$current['inumber']}\">" . _LISTS_EDIT . "</a></td>\n";
+ echo "<td><a href=\"index.php?action=itemdelete&itemid={$current['inumber']}\">" . _LISTS_DELETE . "</a></td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_otherdraftlist($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_BLOG . "</th>\n";
+ echo '<th>' . _LISTS_TITLE . "</th>\n";
+ echo '<th>' . _LISTS_AUTHOR . "</th>\n";
+ echo '<th colspan="2">' . _LISTS_ACTIONS . "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['bshortname'] = Entity::hsc($current['bshortname']);
+ $current['ititle'] = Entity::hsc(strip_tags($current['ititle']));
+ $current['mname'] = Entity::hsc($current['mname']);
+
+ echo "<td>{$current['bshortname']}</td>\n";
+ echo "<td>{$current['ititle']}</td>\n";
+ echo "<td>{$current['mname']}</td>\n";
+ echo "<td><a href=\"index.php?action=itemedit&itemid={$current['inumber']}\">" . _LISTS_EDIT . "</a></td>\n";
+ echo "<td><a href=\"index.php?action=itemdelete&itemid={$current['inumber']}\">" . _LISTS_DELETE . "</a></td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_actionlist($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LISTS_TIME . "</th>\n";
+ echo '<th>' . _LIST_ACTION_MSG . "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['timestamp'] = Entity::hsc($current['timestamp']);
+ $current['message'] = Entity::hsc($current['message']);
+
+ echo "<td>{$current['timestamp']}</td>\n";
+ echo "<td>{$current['message']}</td>\n";
+ break;
+ }
+ return;
+}
+
+function listplug_table_banlist($template, $type)
+{
+ switch( $type )
+ {
+ case 'HEAD':
+ echo '<th>' . _LIST_BAN_IPRANGE . "</th>\n";
+ echo '<th>' . _LIST_BAN_REASON."</th>\n";
+ echo '<th>' . _LISTS_ACTIONS . "</th>\n";
+ break;
+ case 'BODY':
+ $current = $template['current'];
+ $current['blogid'] = (integer) $current['blogid'];
+ $current['iprange'] = Entity::hsc($current['iprange']);
+ $current['reason'] = Entity::hsc($current['reason']);
+
+ echo "<td>{$current['iprange']}</td>\n";
+ echo "<td>{$current['reason']}</td>\n";
+ echo '<td><a href="index.php?action=banlistdelete&blogid=' . $current['blogid'] . '&iprange=' . Entity::hsc($current['iprange']) . '">' . _LISTS_DELETE . "</a></td>\n";
+ break;
+ }
+ return;
+=======
$data['skinparts'] .= "<li>\n"
. helpHtml($article) . "\n"
. "<a href=\"{$CONF['AdminURL']}index.php?action={$vars['edittypeaction']}&skinid={$current['sdnumber']}&type={$type}\" tabindex=\"{$vars['tabindex']}\">"
$template .= Template::fill($navi, $dat);
return $template;
+>>>>>>> skinnable-master
}