'iprangeinput',
'itemnavlist',
'jstoolbaroptions',
- 'languageselectoptions',
'listplugplugoptionrow',
+ 'localeselectoptions',
'mediadirwarning',
'movedistselect',
'moveitemid',
*/
static private $default_actions = array(
'addtickettourl',
+ 'adminurl',
+ 'customhelplink',
'headmessage',
- 'ticket',
- 'sprinttext',
'helplink',
- 'customhelplink',
- 'adminurl'
+ 'sprinttext',
+ 'ticket'
);
/**
'editadminskintype',
);
break;
+ case 'admintemplatedelete':
+ $extra_actions = array(
+ 'editadmintemplateinfo',
+ );
case 'admintemplateedit':
$extra_actions = array(
'editadmintemplateinfo',
case 'blogsettings':
$extra_actions = array(
'adminbloglink',
- 'blogteammembers',
- 'requestblogid',
- 'blogsetting',
+ 'blogcatlist',
'blognotifysetting',
- 'defcatselect',
- 'blogtime',
+ 'blogsetting',
'blogsettingyesno',
- 'pluginoptions',
- 'blogcatlist',
+ 'blogteammembers',
+ 'blogtime',
+ 'defcatselect',
+ 'defskinselect',
'pluginextras',
+ 'pluginoptions',
+ 'requestblogid',
);
break;
case 'bookmarklet':
'requestblogid',
'categorysetting',
'editdesturl',
+ 'pluginoptions'
);
break;
case 'commentdelete':
'contents',
'categories',
'currenttime',
- 'pluginextras',
- 'itemoptions'
+ 'init',
+ 'itemoptions',
+ 'pluginextras'
);
break;
case 'createnewlog':
break;
case 'editmembersettings':
$extra_actions = array(
- 'editmember',
- 'languageselectoptions',
'adminskinselectoptions',
+ 'editmember',
+ 'localeselectoptions',
'pluginoptions',
);
break;
'defblogselect',
'defskinselect',
'configsettingsedit',
- 'languageselectoptions',
'configsettingsyesno',
'outputspecialdirs',
'jstoolbaroptions',
+ 'localeselectoptions',
'mediadirwarning',
'pluginextras',
);
$show = array(
'content' => 'shortblognames'
);
+ Showlist($query, 'table', $show, $templateName);
break;
case 'template':
$query = "SELECT tdname as name, tddesc as description FROM %s WHERE tdname LIKE 'admin/%%'";
$show = array(
'content' => 'shortnames'
);
+ Showlist($query, 'table', $show, $templateName);
break;
}
- Showlist($query, 'table', $show, $templateName);
return;
}
*
* @param void
* @return void
- */
+ */
public function parse_adminskinselectoptions()
{
global $CONF;
public function parse_banlistdeletedlist($templateName = '')
{
global $manager;
- $templates = array();
+ $templates = array();
if ( $templateName )
{
$templates = Template::read($templateName);
}
+
if ( !array_key_exists('BANLIST_DELETED_LIST', $templates) || empty($templates['BANLIST_DELETED_LIST']) )
{
$template = "<li><%blogname%></li>\n";
{
$blog =& $manager->getBlog($delblog);
$data = array(
- Entity::hsc($blog->getName())
+ 'blogname' => Entity::hsc($blog->getName())
);
- Template::fill($template, $data);
+ echo Template::fill($template, $data);
}
+
return;
}
$template['content'] = 'categorylist';
$template['tabindex'] = 200;
- $batch = new Batch('member');
+ $batch = new Batch('category');
$batch->showlist($query, 'table', $template);
return;
}
{
if ( isset($multipleBlogs) && !empty($multipleBlogs) )
{
- echo '<optgroup label="' . Entity::hsc($oBlog->bname) . "\>\n";
+ echo '<optgroup label="' . Entity::hsc($oBlog->bname) . "\">\n";
}
// show selection to create new category when allowed/wanted
{
global $manager;
- $item = false;
- $itemid = intRequestVar('itemid');
+ $item = FALSE;
+ $itemid = intRequestVar('itemid');
+ $item = &$manager->getItem($itemid, 1, 1);
- $item =& $manager->getItem($itemid, 1, 1);
- $blog =& $manager->getBlog(getBlogIDFromItemID($itemid));
+ $blog = FALSE;
+ if ( !$item )
+ {
+ $blogid = intRequestVar('blogid');
+ }
+ else
+ {
+ $blogid = $item['blogid'];
+ }
+ $blog = &$manager->getBlog($blogid);
if ( $item && $blog->convertBreaks() && requestVar('action') == 'itemedit' )
{
{
$contents = $item;
}
- if ( isset($contents['catid']) && $contents['catid'] )
+
+ if ( !array_key_exists('catid', $contents) || empty($contents['catid']) )
{
- $catid = $contents['catid']; // on edit item
+ // on add item
+ $catid = $blog->getDefaultCategory();
}
else
{
- $catid = $blog->getDefaultCategory(); // on add item
+ // on edit item
+ $catid = $contents['catid'];
}
+
Admin::selectBlogCategory('catid', $catid, $startidx, 1, $blog->getID());
+
return;
}
$res = sql_query($query);
$obj = sql_fetch_object($res);
- if ( $type != desc )
+ if ( $type != 'name' )
{
echo Entity::hsc($obj->cdesc);
}
*/
public function parse_defskinselect($type = 'blog', $templateName = '')
{
- global $manager;
+ global $CONF, $manager;
- $query = "SELECT sdname as text, sdnumber as value FROM %s;";
+ $query = "SELECT sdname as text, sdnumber as value FROM %s WHERE sdname NOT LIKE 'admin/%%';";
$query = sprintf($query, sql_table('skin_desc'));
$blogid = intRequestVar('blogid');
if ( !$blogid )
{
- global $CONF;
$template['selected'] = $CONF['BaseSkin'];
}
else
$comment['body'] = str_replace('<br />', '', $comment['body']);
$comment['body'] = preg_replace("#<a href=['\"]([^'\"]+)['\"]( rel=\"nofollow\")?>[^<]*</a>#", "\\1", $comment['body']);
echo $comment['body'];
+ break;
+ case 'cmail':
+ echo $comment['userid'];
+ break;
+ case 'url':
+ echo $comment['userid'];
+ break;
default:
echo $comment[$type];
break;
* @param string $tplt name of template
* @return boolean
*/
- public function parse_edittemplateinfo($type, $description = '', $name = '', $help = '', $tabindex = 0, $big = 0, $tplt = '')
+ public function parse_edittemplateinfo($type, $desc = '', $name = '', $help = '', $tabindex = 0, $big = 0, $tplt = '')
{
global $manager;
*/
public function parse_getblogsetting($which)
{
- global $blog;
+ global $blog, $manager;
if ( $blog )
{
}
elseif ( $bid = intRequestVar('blogid') )
{
- global $manager;
$b = $manager->getBlog($bid);
}
else
* some init stuff for all forms
*
* @param void
+ * @return void
*/
function parse_init()
{
global $manager;
- $item = false;
+
+ $item = false;
if ( requestVar('action') == 'itemedit' )
{
$itemid = intRequestVar('itemid');
}
elseif ( requestVar('action') == 'createitem' )
{
- $blog =& $manager->getBlog(intRequestVar($blogid));
+ $blogid = intRequestVar('blogid');
+ $blog =& $manager->getBlog($blogid);
$authorid = '';
}
$blog->insertJavaScriptInfo($authorid);
+ return;
}
/**
$prevPid = -1;
+ include_libs('ACTIONS.php');
$handler = new Actions($this->skintype);
$parser = new PARSER($handler);
public function parse_itemnavlist()
{
global $CONF, $manager, $member;
- if ( $this->skintype == 'itemlist' )
- {
- $blogid = intRequestVar('blogid');
- $blog =& $manager->getBlog($blogid);
- }
- if ( postVar('start') )
- {
- $start = intPostVar('start');
- }
- else
- {
- $start = 0;
- }
- // amount of items to show
- if ( postVar('amount') )
- {
- $amount = intPostVar('amount');
- }
- else
- {
- $amount = intval($CONF['DefaultListSize']);
- if ( $amount < 1 )
- {
- $amount = 10;
- }
- }
$query = "SELECT bshortname, cname, mname, ititle, ibody, inumber, idraft, itime"
. " FROM %s, %s, %s, %s"
. " WHERE iblog=bnumber AND iauthor=mnumber AND icat=catid";
if ( $this->skintype == 'itemlist' )
{
- $query .= ' AND iblog = ' . $blogid;
+ $blog = FALSE;
+ if ( array_key_exists('blogid', $_REQUEST) )
+ {
+ $blogid = intRequestVar('blogid');
+ }
+ else if ( array_key_exists('itemid', $_REQUEST) )
+ {
+ $itemid = intRequestVar('itemid');
+ $item = &$manager->getItem($itemid, 1, 1);
+ $blogid = (integer) $item['blogid'];
+ }
+ $blog =& $manager->getBlog($blogid);
+
+ $query .= " AND iblog={$blogid}";
$template['now'] = $blog->getCorrectTime(time());
// non-blog-admins can only edit/delete their own items
. ' OR (ibody LIKE "%' . sql_real_escape_string($search) . '%") '
. ' OR (imore LIKE "%' . sql_real_escape_string($search) . '%"))';
}
+
+ if ( postVar('start') )
+ {
+ $start = intPostVar('start');
+ }
+ else
+ {
+ $start = 0;
+ }
+
+ // amount of items to show
+ if ( postVar('amount') )
+ {
+ $amount = intPostVar('amount');
+ }
+ else
+ {
+ $amount = (integer) $CONF['DefaultListSize'];
+ if ( $amount < 1 )
+ {
+ $amount = 10;
+ }
+ }
+
$query .= ' ORDER BY itime DESC'
. " LIMIT {$start},{$amount}";
return;
}
/**
- * Parse skinvar languageselectoptions
- */
- function parse_languageselectoptions()
- {
- $locales = i18n::get_available_locale_list();
- $memid = intRequestVar('memberid');
-
- if ($memid)
- {
- $mem = MEMBER::createFromID($memid);
- if ( !$mem->getLocale() || !in_array($mem->getLocale(), $locales) )
- {
- echo "<option value=\"\" selected=\"selected\">" . ENTITY::hsc(_MEMBERS_USESITELANG) . "</option>\n";
- }
- else
- {
- echo "<option value=\"\">" . ENTITY::hsc(_MEMBERS_USESITELANG) . "</option>\n";
- }
- }
- else
- {
- if ( !i18n::get_current_locale() || !in_array(i18n::get_current_locale(), $locales) )
- {
- echo "<option value=\"\" selected=\"selected\">en_Latn_US</option>\n";
- }
- }
- foreach ( $locales as $locale )
- {
- if ($memid)
- {
- if ( $locale == $mem->getLocale() )
- {
- echo "<option value=\"{$locale}\" selected=\"selected\">{$locale}</option>\n";
- }
- else
- {
- echo "<option value=\"{$locale}\">{$locale}</option>\n";
- }
- }
- else
- {
- if ( $locale == i18n::get_current_locale() )
- {
- echo "<option value=\"{$locale}\" selected=\"selected\">{$locale}</option>\n";
- }
- else
- {
- echo "<option value=\"{$locale}\">{$locale}</option>\n";
- }
- }
- }
- return;
- }
-
- /**
* AdminActions::parse_localeselectoptions()
* Parse skinvar localeselectoptions
*
{
echo "<option value=\"\" selected=\"selected\">en_Latn_US</option>\n";
}
+ else
+ {
+ echo "<option value=\"\">en_Latn_US</option>\n";
+ }
}
foreach ( $locales as $locale )
{
- if ($memid)
+ if ( $locale == 'en_Latn_US' )
+ {
+ continue;
+ }
+ else if ($memid)
{
if ( $locale == $mem->getLocale() )
{
if ( $this->skintype == 'itemmove' )
{
$query = "SELECT icat as result FROM %s WHERE inumber=%d;";
- $query = spriintf($query, sql_table('item'), intRequestVar('itemid'));
+ $query = sprintf($query, sql_table('item'), intRequestVar('itemid'));
$catid = quickQuery(sprintf($query, intRequestVar('itemid')));
Admin::selectBlogCategory('catid', $catid, 10, 1);
}
{
$template['body'] = $templates['PLUGIN_QUICKMENU_BODY'];
}
- if ( array_key_exists('PLUGIN_QUICKMENU_FOOT', $templates) || !empty($templates['PLUGIN_QUICKMENU_FOOT']) )
+ if ( !array_key_exists('PLUGIN_QUICKMENU_FOOT', $templates) || empty($templates['PLUGIN_QUICKMENU_FOOT']) )
{
$template['foot'] = "</ul>\n";
}
}
break;
case 'template':
- $res = sql_query('SELECT * FROM '.sql_table('template_desc'). " WHERE tdname NOT LIKE 'admin/%';");
+ $res = sql_query('SELECT * FROM '.sql_table('template_desc'). " WHERE tdname NOT LIKE 'admin/%%';");
while ($templateObj = sql_fetch_object($res)) {
$data = array(
'typeid' => 'template[' . $templateObj->tdnumber . ']',
public function parse_skinoverview($templateName = '')
{
global $CONF;
- $query = "SELECT * FROM %s WHERE sdincmode != 'admin' ORDER BY sdname;";
+ $query = "SELECT * FROM %s WHERE sdname NOT LIKE 'admin/%%';";
$query = sprintf($query, sql_table('skin_desc'));
$template['content'] = 'skinlist';
$template['tabindex'] = 10;
- $template['friendly_names'] = $this->skin->getDefaultTypes();
Showlist($query, 'table', $template, $templateName);
return;
$templates = Template::read($tplName);
}
- if ( !array_key_exists($templates['ADMIN_CUSTOMHELPLINK_ANCHOR']) || empty($templates['ADMIN_CUSTOMHELPLINK_ANCHOR']) )
+ if ( !array_key_exists('ADMIN_CUSTOMHELPLINK_ANCHOR', $templates) || empty($templates['ADMIN_CUSTOMHELPLINK_ANCHOR']) )
{
$template = "<a href=\"<%helpurl%>#<%helptarget%>\" title=\"<%title%>\" <%onclick%>>\n";
}