From: sakamocchi Date: Sat, 26 May 2012 12:31:29 +0000 (+0900) Subject: AdminActionsクラスのコード整理 X-Git-Url: http://git.osdn.net/view?p=nucleus-jp%2Fnucleus-next.git;a=commitdiff_plain;h=32a521409661bb5131049334090c7511094a8d9f AdminActionsクラスのコード整理 IDEのバグを踏んだため、配列の表記を中心として、前回のコミットでコードフォーマットが崩れていた。 --- diff --git a/nucleus/libs/AdminActions.php b/nucleus/libs/AdminActions.php index f81e916..105c6e8 100644 --- a/nucleus/libs/AdminActions.php +++ b/nucleus/libs/AdminActions.php @@ -158,7 +158,7 @@ class AdminActions extends BaseActions { // call constructor of superclass first parent::__construct(); - + /* alias */ if ( $type == 'admntemplateoverview' ) { @@ -181,7 +181,7 @@ class AdminActions extends BaseActions public function getAvailableActions() { $extra_actions = array(); - + switch ( $this->skintype ) { case 'actionlog': @@ -678,9 +678,9 @@ class AdminActions extends BaseActions default: break; } - + $defined_actions = array_merge(self::$default_actions, $extra_actions); - + return array_merge($defined_actions, parent::getAvailableActions()); } @@ -695,7 +695,7 @@ class AdminActions extends BaseActions { $query = "SELECT * FROM %s ORDER BY timestamp DESC;"; $query = sprintf($query, sql_table('actionlog')); - + $resource = DB::getResult($query); if ( $resource->rowCount() > 0 ) { @@ -727,19 +727,19 @@ class AdminActions extends BaseActions { $template =& $manager->getTemplate($template_name); } - + $key = postVar('ackey'); if ( !$key ) { Admin::error(_ERROR_ACTIVATE); } - + $info = MEMBER::getActivationInfo($key); if ( !$info ) { Admin::error(_ERROR_ACTIVATE); } - + $mem =& $manager->getMember($info->vmember); if ( !$mem ) { @@ -803,8 +803,8 @@ class AdminActions extends BaseActions break; } $aVars = array( - 'memberName' => Entity::hsc($mem->getDisplayName()), - 'realName' => Entity::hsc($mem->getRealName()), + 'memberName' => Entity::hsc($mem->getDisplayName()), + 'realName' => Entity::hsc($mem->getRealName()), ); switch ( $type ) { @@ -846,10 +846,10 @@ class AdminActions extends BaseActions public function parse_adminbanlist($template_name = '') { $blogid = intRequestVar('blogid'); - + $query = "SELECT * FROM %s WHERE blogid=%d ORDER BY iprange;"; $query = sprintf($query, sql_table('ban'), (integer) $blogid); - + $resource = DB::getResult($query); if ( $resource->rowCount() > 0 ) { @@ -887,12 +887,12 @@ class AdminActions extends BaseActions { global $manager; $templates = array(); - + if ( !empty($template_name) ) { $templates =& $manager->getTemplate($template_name); } - + if ( !array_key_exists('ADMIN_BATCHLIST', $templates) || empty($templates['ADMIN_BATCHLIST']) ) { $template = '
  • <%text(_BATCH_EXECUTING)%> ' @@ -906,10 +906,10 @@ class AdminActions extends BaseActions { $template = $templates['ADMIN_BATCHLIST']; } - + $selected = requestIntArray('batch'); $action = requestVar('batchaction'); - + switch ( $this->skintype ) { case 'batchitem': @@ -946,7 +946,7 @@ class AdminActions extends BaseActions $destid = intRequestVar('destblogid'); break; } - + // walk over all selectedids and perform action foreach ( $selected as $selectedid ) { @@ -989,10 +989,10 @@ class AdminActions extends BaseActions } $data = array( - 'batchid' => $selectedid, - 'batchlisttype' => Entity::hsc($batchlisttype), - 'adminbatchaction' => Entity::hsc($action), - 'batchlistmsg' => $error ? $error : _BATCH_SUCCESS, + 'batchid' => $selectedid, + 'batchlisttype' => Entity::hsc($batchlisttype), + 'adminbatchaction' => Entity::hsc($action), + 'batchlistmsg' => $error ? $error : _BATCH_SUCCESS, ); $this->parser->parse(Template::fill($template, $data)); @@ -1014,12 +1014,12 @@ class AdminActions extends BaseActions $blogid = intRequestVar('blogid'); $blog =& $manager->getBlog($blogid); $templates = array(); - + if ( !empty($template_name) ) { $templates =& $manager->getTemplate($template_name); } - + if ( !array_key_exists('ADMIN_BLOGLINK', $templates) || empty($templates['ADMIN_BLOGLINK']) ) { $template = '<%blogname%>'; @@ -1028,13 +1028,13 @@ class AdminActions extends BaseActions { $template = $templates['ADMIN_BLOGLINK']; } - + $data = array( - 'url' => Entity::hsc($blog->getURL()), - 'adminbloglinktitle' => _BLOGLIST_TT_VISIT, - 'blogname' => Entity::hsc($blog->getName()) + 'url' => Entity::hsc($blog->getURL()), + 'adminbloglinktitle' => _BLOGLIST_TT_VISIT, + 'blogname' => Entity::hsc($blog->getName()) ); - + echo Template::fill($template, $data); return; } @@ -1050,7 +1050,7 @@ class AdminActions extends BaseActions { global $CONF; $message = ''; - + if ( requestVar('errormessage') ) { $message = requestVar('errormessage'); @@ -1078,7 +1078,7 @@ class AdminActions extends BaseActions { $type = strtolower(trim(requestVar('type'))); $skinid = intRequestVar('skinid'); - + if ( !preg_match('#^admin#', $this->skintype) ) { $skin = new Skin($skinid); @@ -1089,14 +1089,14 @@ class AdminActions extends BaseActions $skin = new Skin($skinid, 'AdminActions'); $tag = 'adminskinvar'; } - + $actions = $skin->getAllowedActionsForType($type); sort($actions); - + while ( $current = array_shift($actions) ) { echo helplink("{$tag}-{$current}") . "$current\n"; - + if ( count($actions) != 0 ) { echo ", "; @@ -1115,13 +1115,13 @@ class AdminActions extends BaseActions public function parse_banlistdeletedlist($template_name = '') { global $manager; - + $templates = array(); if ( $template_name ) { $templates =& $manager->getTemplate($template_name); } - + if ( !array_key_exists('BANLIST_DELETED_LIST', $templates) || empty($templates['BANLIST_DELETED_LIST']) ) { $template = "
  • <%blogname%>
  • \n"; @@ -1130,17 +1130,17 @@ class AdminActions extends BaseActions { $template = $templates['BANLIST_DELETED_LIST']; } - + $deleted = requestArray('delblogs'); foreach ( $deleted as $delblog ) { $blog =& $manager->getBlog($delblog); $data = array( - 'blogname' => Entity::hsc($blog->getName()) + 'blogname' => Entity::hsc($blog->getName()) ); echo Template::fill($template, $data); } - + return; } @@ -1155,7 +1155,7 @@ class AdminActions extends BaseActions { $selected = requestIntArray('batch'); $index = 0; - + foreach ( $selected as $select ) { echo '\n"; @@ -1274,7 +1274,7 @@ class AdminActions extends BaseActions $blogid = intRequestVar('blogid'); $query = "SELECT * FROM %s WHERE cblog = %d ORDER BY cname;"; $query = sprintf($query, sql_table('category'), (integer) $blogid); - + $resource = DB::getResult($query); if ( $resource->rowCount() > 0 ) { @@ -1287,7 +1287,7 @@ class AdminActions extends BaseActions /* TODO: nothing to be shown */ } $resource->closeCursor(); - + return; } @@ -1316,7 +1316,7 @@ class AdminActions extends BaseActions global $manager; $blogid = intRequestVar('blogid'); $blog =& $manager->getBlog($blogid); - + switch ( $type ) { case 'comment': @@ -1469,7 +1469,7 @@ class AdminActions extends BaseActions public function parse_blogtime($type, $format = '%H:%M', $offset = 0) { global $manager; - + if ( $type != 'blogtime' ) { /* return server time */ @@ -1515,11 +1515,11 @@ class AdminActions extends BaseActions public function parse_categories($startidx = 0) { global $manager; - + $item = FALSE; $itemid = intRequestVar('itemid'); $item = &$manager->getItem($itemid, 1, 1); - + $blog = FALSE; if ( !$item ) { @@ -1530,19 +1530,19 @@ class AdminActions extends BaseActions $blogid = $item['blogid']; } $blog = &$manager->getBlog($blogid); - + if ( $item && $blog->convertBreaks() && requestVar('action') == 'itemedit' ) { $item['body'] = removeBreaks($item['body']); $item['more'] = removeBreaks($item['more']); } - + $contents = array(); if ( requestVar('action') == 'itemedit' ) { $contents = $item; } - + if ( !array_key_exists('catid', $contents) || empty($contents['catid']) ) { // on add item @@ -1553,9 +1553,9 @@ class AdminActions extends BaseActions // on edit item $catid = $contents['catid']; } - + $this->selectBlog('catid', 'category', $catid, $startidx, 1, $blog->getID()); - + return; } @@ -1591,7 +1591,7 @@ class AdminActions extends BaseActions $query = "SELECT * FROM %s WHERE cblog = %d AND catid = %d;"; $query = sprintf($query, sql_table('category'), (integer) $blogid, (integer) $catid); $row = DB::getRow($query); - + if ( $type != 'name' ) { echo Entity::hsc($row['cdesc']); @@ -1615,19 +1615,19 @@ class AdminActions extends BaseActions public function parse_checkedonval($value, $name) { global $manager; - + $item = false; $itemid = intRequestVar('itemid'); $item =& $manager->getItem($itemid, 1, 1); - + $blog =& $manager->getBlog(getBlogIDFromItemID($itemid)); - + if ( $item && $blog->convertBreaks() && requestVar('action') == 'itemedit' ) { $item['body'] = removeBreaks($item['body']); $item['more'] = removeBreaks($item['more']); } - + $contents = array(); if ( requestVar('action') == 'itemedit' ) { @@ -1670,7 +1670,7 @@ class AdminActions extends BaseActions public function parse_commentnavlist() { global $CONF, $manager, $member; - + // start index if ( postVar('start') ) { @@ -1680,7 +1680,7 @@ class AdminActions extends BaseActions { $start = 0; } - + // amount of items to show if ( postVar('amount') ) { @@ -1699,7 +1699,7 @@ class AdminActions extends BaseActions . 'LEFT OUTER JOIN %s ON mnumber=cmember ' . 'WHERE '; $query = sprintf($query, sql_table('comment'), sql_table('member')); - + if ( $this->skintype == 'itemcommentlist' ) { $itemid = intRequestVar('itemid'); @@ -1724,15 +1724,15 @@ class AdminActions extends BaseActions $bid = intRequestVar('blogid'); $nonComments = _NOCOMMENTS_BLOG; } - + $search = postVar('search'); if ( !empty($search) ) { $query .= ' and cbody LIKE ' . DB::quoteValue('%'.$search.'%'); } - + $query .= " ORDER BY ctime ASC LIMIT {$start},{$amount}"; - + $resource = DB::getResult($query); if ( $resource->rowCount() > 0 ) { @@ -1754,7 +1754,7 @@ class AdminActions extends BaseActions /* TODO: nothing to be shown */ } $resource->closeCursor(); - + return; } @@ -1893,7 +1893,7 @@ class AdminActions extends BaseActions public function parse_normalskinlist($template_name = '') { global $CONF, $manager; - + if ( !preg_match('#^admin#', $this->skintype) ) { $skin = new Skin($CONF['BaseSkin']); @@ -1906,22 +1906,22 @@ class AdminActions extends BaseActions $template['editaction'] = 'adminskinedittype'; /* TODO: removeaction? */ } - + $temporary = $skin->getDefaultTypes(); $normal_skintype = array(); foreach ( $temporary as $type => $label ) { $normal_skintype[] = array( - 'skintype' => $type, - 'skintypename' => $label + 'skintype' => $type, + 'skintypename' => $label ); } - + $template['tabindex'] = 10; $template['skinid'] = $skin->getID(); $template['skinname'] = $skin->getName(); $this->parser->parse(showlist($normal_skintype, 'list_normalskinlist', $template, $template_name)); - + return; } @@ -1935,15 +1935,15 @@ class AdminActions extends BaseActions public function parse_defblogselect($template_name = '') { global $CONF; - + $query = "SELECT bname as text, bnumber as value FROM %s;"; $query = sprintf($query, sql_table('blog')); - + $template['name'] = 'DefaultBlog'; $template['selected'] = $CONF['DefaultBlog']; $template['tabindex'] = 10; $this->parser->parse(showlist($query, 'select', $template, $template_name)); - + return; } @@ -1957,19 +1957,19 @@ class AdminActions extends BaseActions public function parse_defcatselect($template_name = '') { global $manager; - + $blogid = intRequestVar('blogid'); $blog =& $manager->getBlog($blogid); - + $query = "SELECT cname as text, catid as value FROM %s WHERE cblog=%d;"; $query = sprintf($query, sql_table('category'), (integer) $blog->getID()); - + $template['name'] = 'defcat'; $template['selected'] = $blog->getDefaultCategory(); $template['tabindex'] = 110; - + $this->parser->parse(showlist($query, 'select', $template, $template_name)); - + return; } @@ -1984,7 +1984,7 @@ class AdminActions extends BaseActions public function parse_defskinselect($type = 'blog', $template_name = '') { global $CONF, $manager, $member; - + if ( !preg_match('#^admin#', $this->skintype) ) { $blogid = intRequestVar('blogid'); @@ -2016,12 +2016,12 @@ class AdminActions extends BaseActions $template['name'] = 'AdminSkin'; $query = "SELECT sdname as text, sdnumber as value FROM %s WHERE sdname LIKE 'admin/%%';"; } - + $query = sprintf($query, sql_table('skin_desc')); $template['tabindex'] = 50; - + $this->parser->parse(showlist($query, 'select', $template, $template_name)); - + return; } @@ -2036,7 +2036,7 @@ class AdminActions extends BaseActions { $commentid = intRequestVar('commentid'); $comment = COMMENT::getComment($commentid); - + switch ( $type ) { case 'id': @@ -2069,14 +2069,14 @@ class AdminActions extends BaseActions public function parse_deleteitembody() { global $manager; - + $itemid = intRequestVar('itemid'); $item =& $manager->getItem($itemid, 1, 1); - + $body = strip_tags($item['body']); - + echo Entity::hsc(shorten($body, 300, '...')); - + return; } @@ -2103,12 +2103,12 @@ class AdminActions extends BaseActions public function parse_deleteitemtitle() { global $manager; - + $itemid = intRequestVar('itemid'); $item =& $manager->getItem($itemid, 1, 1); - + echo Entity::hsc(strip_tags($item['title'])); - + return; } @@ -2122,12 +2122,12 @@ class AdminActions extends BaseActions public function parse_editcomment($type = 'id') { global $manager; - + $commentid = intRequestVar('commentid'); $comment = COMMENT::getComment($commentid); - + $manager->notify('PrepareCommentForEdit', array('comment' => &$comment)); - + switch ( $type ) { case 'id': @@ -2219,10 +2219,10 @@ class AdminActions extends BaseActions public function parse_editmember($type = 'id', $template_name = '') { global $CONF, $manager, $member; - + $memberid = intRequestVar('memberid'); $mem =& $manager->getMember($memberid); - + switch ( $type ) { case 'id': @@ -2283,7 +2283,7 @@ class AdminActions extends BaseActions public function parse_editpluginfo($type) { global $manager; - + $pid = intRequestVar('plugid'); switch ( $type ) { @@ -2307,29 +2307,29 @@ class AdminActions extends BaseActions public function parse_editplugoptionslist($template_name = '') { global $manager; - + $pid = intRequestVar('plugid'); $aOptions = array(); $aOIDs = array(); - + $query = "SELECT * FROM %s WHERE ocontext='global' AND opid=%d ORDER BY oid ASC;"; $query = sprintf($query, sql_table('plugin_option_desc'), (integer) $pid); $resource = DB::getResult($query); - + foreach ( $resource as $row ) { $aOIDs[] = $row['oid']; $aOptions[$row['oid']] = array( - 'oid' => $row['oid'], - 'value' => $row['odef'], - 'name' => $row['oname'], - 'description' => $row['odesc'], - 'type' => $row['otype'], - 'typeinfo' => $row['oextra'], - 'contextid' => 0 + 'oid' => $row['oid'], + 'value' => $row['odef'], + 'name' => $row['oname'], + 'description' => $row['odesc'], + 'type' => $row['otype'], + 'typeinfo' => $row['oextra'], + 'contextid' => 0 ); } - + // fill out actual values if ( count($aOIDs) > 0 ) { @@ -2345,12 +2345,12 @@ class AdminActions extends BaseActions // call plugins $data = array( - 'context' => 'global', - 'plugid' => $pid, - 'options' => &$aOptions + 'context' => 'global', + 'plugid' => $pid, + 'options' => &$aOptions ); $manager->notify('PrePluginOptionsEdit', $data); - + if ( sizeof($aOptions) > 0 ) { $template['content'] = 'plugoptionlist'; @@ -2373,7 +2373,7 @@ class AdminActions extends BaseActions public function parse_editskin($type = 'id') { $skinid = intRequestVar('skinid'); - + if ( !preg_match('#^admin#', $this->skintype) ) { $skin = new SKIN($skinid); @@ -2382,7 +2382,7 @@ class AdminActions extends BaseActions { $skin = new SKIN($skinid, 'AdminActions'); } - + switch ( $type ) { case 'id': @@ -2522,24 +2522,24 @@ class AdminActions extends BaseActions static $id = NULL; static $name = NULL; static $desc = NULL; - + if ( $id == NULL ) { $id = intRequestVar('templateid'); } - + if ( $name == NULL ) { $name = Template::getNameFromId($id); } - + if ( $desc == NULL ) { $desc = Template::getDesc($id); } - + $template =& $manager->getTemplate($name); - + switch ( $format ) { case 'id': @@ -2562,7 +2562,7 @@ class AdminActions extends BaseActions { $manager->notify('AdminTemplateExtraFields', array('fields' => &$pluginfields)); } - + foreach ( $pluginfields as $ptkey => $ptvalue ) { $tmplt = array(); @@ -2575,15 +2575,15 @@ class AdminActions extends BaseActions if ( !array_key_exists('TEMPLATE_EDIT_EXPLUGNAME', $tmplt) || empty($tmplt['TEMPLATE_EDIT_EXPLUGNAME']) ) { $base = "\n" - . "\n" - . "<%explugtplname%>\n"; + . "\n" + . "<%explugtplname%>\n"; } else { $base = $tmplt['TEMPLATE_EDIT_EXPLUGNAME']; } $data = array( - 'explugtplname' => Entity::hsc($ptkey) + 'explugtplname' => Entity::hsc($ptkey) ); echo Template::fill($base, $data); @@ -2605,7 +2605,7 @@ class AdminActions extends BaseActions default: $typedesc = defined($typedesc) ? constant($typedesc) : $typedesc; $typename = defined($typename) ? constant($typename) : $typename; - + if ( !array_key_exists($typename, $template) ) { $content = ''; @@ -2617,7 +2617,7 @@ class AdminActions extends BaseActions $this->parser->parse(listplug_templateEditRow($content, $typedesc, $typename, $help, $tabindex, $big, $template_name)); break; } - + return; } @@ -2631,9 +2631,9 @@ class AdminActions extends BaseActions public function parse_eventformextra($type = 'activation') { global $manager; - + $data = array(); - + switch ( $type ) { case 'activation': @@ -2653,8 +2653,8 @@ class AdminActions extends BaseActions Admin::error(_ERROR_ACTIVATE); } $data = array( - 'type' => 'activation', - 'member' => $mem + 'type' => 'activation', + 'member' => $mem ); break; case 'membermailform-notloggedin': @@ -2672,14 +2672,14 @@ class AdminActions extends BaseActions public function parse_extrahead() { global $manager; - + $extrahead = Admin::getAdminextrahead(); - + $data = array( -'extrahead' => &$extrahead, -'action' => Admin::getAdminAction() + 'extrahead' => &$extrahead, + 'action' => Admin::getAdminAction() ); - + $manager->notify('AdminPrePageHead', $data); echo $extrahead; return; @@ -2696,7 +2696,7 @@ class AdminActions extends BaseActions public function parse_member($what) { global $memberinfo, $member, $CONF; - + // 1. only allow the member-details-page specific variables on member pages if ( $this->skintype == 'member' ) { @@ -2722,7 +2722,7 @@ class AdminActions extends BaseActions break; } } - + // 2. the next bunch of options is available everywhere, as long as the user is logged in if ( $member->isLoggedIn() ) { @@ -2826,7 +2826,7 @@ class AdminActions extends BaseActions public function parse_getblogsetting($which) { global $blog, $manager; - + if ( $blog ) { $b =& $blog; @@ -3073,13 +3073,13 @@ class AdminActions extends BaseActions public function parse_init() { global $manager; - + $authorid = ''; if ( requestVar('action') == 'itemedit' ) { $authorid = Admin::$contents['authorid']; } - + Admin::$blog->insertJavaScriptInfo($authorid); return; } @@ -3134,7 +3134,7 @@ class AdminActions extends BaseActions public function parse_insplugoptcontent() { $option = Admin::getAdminaOption(); - + $meta = NucleusPlugin::getOptionMeta($option['typeinfo']); if ( array_key_exists('access', $meta) && $meta['access'] != 'hidden' ) { @@ -3181,13 +3181,13 @@ class AdminActions extends BaseActions public function parse_itemnavlist($template_name) { global $CONF, $manager, $member; - + $query = "SELECT bshortname, cname, mname, ititle, ibody, inumber, idraft, itime" - . " FROM %s, %s, %s, %s" - . " WHERE iblog=bnumber AND iauthor=mnumber AND icat=catid"; - + . " FROM %s, %s, %s, %s" + . " WHERE iblog=bnumber AND iauthor=mnumber AND icat=catid"; + $query = sprintf($query, sql_table('item'), sql_table('blog'), sql_table('member'), sql_table('category')); - + if ( $this->skintype == 'itemlist' ) { $blog = FALSE; @@ -3218,17 +3218,17 @@ class AdminActions extends BaseActions $blogid = 0; $template['now'] = time(); } - + // search through items $search = postVar('search'); - + if ( !empty($search) ) { $query .= ' AND ((ititle LIKE ' . DB::quoteValue('%'.$search.'%') . ') ' . ' OR (ibody LIKE ' . DB::quoteValue('%'.$search.'%') . ') ' . ' OR (imore LIKE ' . DB::quoteValue('%'.$search.'%') . '))'; } - + if ( postVar('start') ) { $start = intPostVar('start'); @@ -3237,7 +3237,7 @@ class AdminActions extends BaseActions { $start = 0; } - + // amount of items to show if ( postVar('amount') ) { @@ -3251,10 +3251,10 @@ class AdminActions extends BaseActions $amount = 10; } } - + $query .= ' ORDER BY itime DESC' - . " LIMIT {$start},{$amount}"; - + . " LIMIT {$start},{$amount}"; + $resource = DB::getResult($query); if ( $resource->rowCount() > 0 ) { @@ -3290,19 +3290,19 @@ class AdminActions extends BaseActions public function parse_itemtime($key) { global $manager; - + $item = false; $itemid = intRequestVar('itemid'); $item =& $manager->getItem($itemid, 1, 1); - + $blog =& $manager->getBlog(getBlogIDFromItemID($itemid)); - + if ( $item && $blog->convertBreaks() && requestVar('action') == 'itemedit' ) { $item['body'] = removeBreaks($item['body']); $item['more'] = removeBreaks($item['more']); } - + $contents = array(); if ( requestVar('action') == 'itemedit' ) { @@ -3311,8 +3311,8 @@ class AdminActions extends BaseActions elseif ( requestVar('action') == 'createitem' ) { $data = array( - 'contents' => &$contents, - 'blog' => &$this->blog + 'contents' => &$contents, + 'blog' => &$this->blog ); $manager->notify('PreAddItemForm', $data); } @@ -3332,11 +3332,11 @@ class AdminActions extends BaseActions { global $CONF; $options = array( - _SETTINGS_JSTOOLBAR_NONE, - _SETTINGS_JSTOOLBAR_SIMPLE, - _SETTINGS_JSTOOLBAR_FULL + _SETTINGS_JSTOOLBAR_NONE, + _SETTINGS_JSTOOLBAR_SIMPLE, + _SETTINGS_JSTOOLBAR_FULL ); - + $i = 1; foreach ( $options as $option ) { @@ -3357,9 +3357,9 @@ class AdminActions extends BaseActions public function parse_localeselectoptions() { global $manager; - + $locales = i18n::get_available_locale_list(); - + $memid = intRequestVar('memberid'); if ( $memid ) { @@ -3505,11 +3505,11 @@ class AdminActions extends BaseActions public function parse_newestcompare() { global $nucleus; - + $newestVersion = getLatestVersion(); $newestCompare = str_replace('/', '.', $newestVersion); $currentVersion = str_replace(array('/', 'v'), array('.', ''), $nucleus['version']); - + if ( $newestVersion && version_compare($newestCompare, $currentVersion, '>') ) { echo '
    '; @@ -3528,24 +3528,24 @@ class AdminActions extends BaseActions public function parse_newmemberselect($template_name = '') { $blogid = intRequestVar('blogid'); - + $query = "SELECT tmember FROM %s WHERE tblog=%d;"; $query = sprintf($query, sql_table('team'), (integer) $blogid); $res = DB::getResult($query); - + $tmem = array(); foreach ( $res as $row ) { $tmem[] = intval($row['tmember']); } - + $query = "SELECT mname as text, mnumber as value FROM %s WHERE mnumber NOT IN (%s);"; $query = sprintf($query, sql_table('member'), implode(', ', $tmem)); - + $template = array( - 'name' => 'memberid', - 'tabindex' => 10000, - 'selected' => 0 + 'name' => 'memberid', + 'tabindex' => 10000, + 'selected' => 0 ); $this->parser->parse(showlist($query, 'select', $template, $template_name)); return; @@ -3578,7 +3578,7 @@ class AdminActions extends BaseActions public function parse_outputspecialdirs($type) { global $DIR_MEDIA, $DIR_NUCLEUS; - + switch ( $type ) { case 'nucleusdir': @@ -3602,7 +3602,7 @@ class AdminActions extends BaseActions { $passvar = Admin::getAdminpassvar(); $oldaction = postVar('oldaction'); - + if ( ($oldaction != 'logout') && ($oldaction != 'login') && $passvar @@ -3623,7 +3623,7 @@ class AdminActions extends BaseActions public function parse_pluginextras($type = 'global') { global $manager; - + switch ( $type ) { case 'member': @@ -3638,14 +3638,14 @@ class AdminActions extends BaseActions break; case 'createaccount': $data = array( - 'type' => 'createaccount.php', - 'prelabel' => '', - 'postlabel' => '
    ', - 'prefield' => '', - 'postfield' => '

    ' - ); - $manager->notify('RegistrationFormExtraFields', $data); - break; + 'type' => 'createaccount.php', + 'prelabel' => '', + 'postlabel' => '
    ', + 'prefield' => '', + 'postfield' => '

    ' + ); + $manager->notify('RegistrationFormExtraFields', $data); + break; default: $manager->notify('GeneralSettingsFormExtras', array()); break; @@ -3663,11 +3663,11 @@ class AdminActions extends BaseActions public function parse_pluginhelp() { global $manager, $DIR_PLUGINS; - + $plugid = intGetVar('plugid'); $plugName = $manager->getPluginNameFromPid($plugid); $plug =& $manager->getPlugin($plugName); - + if ( $plug->supportsFeature('HelpPage') > 0 ) { $helpfile = $DIR_PLUGINS . $plug->getShortName() . '/help.'; @@ -3698,12 +3698,12 @@ class AdminActions extends BaseActions { $query = "SELECT * FROM %s ORDER BY porder ASC;"; $query = sprintf($query, sql_table('plugin')); - + $template['content'] = 'pluginlist'; $template['tabindex'] = 10; - + $this->parser->parse(showlist($query, 'table', $template, $template_name)); - + return; } @@ -3717,7 +3717,7 @@ class AdminActions extends BaseActions public function parse_pluginoptions($context='global', $template_name='') { global $itemid, $manager; - + switch ( $context ) { case 'member': @@ -3733,7 +3733,7 @@ class AdminActions extends BaseActions $contextid = $itemid; break; } - + /* Actually registererd plugin options */ $aIdToValue = array(); $query = "SELECT oid, ovalue FROM %s WHERE ocontextid=%d;"; @@ -3743,12 +3743,12 @@ class AdminActions extends BaseActions { $aIdToValue[$row['oid']] = $row['ovalue']; } - + /* Currently available plugin options */ $query = "SELECT * FROM %s, %s WHERE opid=pid and ocontext= %s ORDER BY porder, oid ASC;"; $query = sprintf($query, sql_table('plugin_option_desc'), sql_table('plugin'), DB::quoteValue($context)); $res = DB::getResult($query); - + $options = array(); foreach ($res as $row ) { @@ -3760,28 +3760,28 @@ class AdminActions extends BaseActions { $value = $aIdToValue[$row['oid']]; } - + $options[] = array( - 'pid' => $row['pid'], - 'pfile' => $row['pfile'], - 'oid' => $row['oid'], - 'value' => $value, - 'name' => $row['oname'], - 'description' => $row['odesc'], - 'type' => $row['otype'], - 'typeinfo' => $row['oextra'], - 'contextid' => $contextid, - 'extra' => '' - ); + 'pid' => $row['pid'], + 'pfile' => $row['pfile'], + 'oid' => $row['oid'], + 'value' => $value, + 'name' => $row['oname'], + 'description' => $row['odesc'], + 'type' => $row['otype'], + 'typeinfo' => $row['oextra'], + 'contextid' => $contextid, + 'extra' => '' + ); } - + $data = array( -'context' => $context, -'contextid' => $contextid, -'options' => &$options + 'context' => $context, + 'contextid' => $contextid, + 'options' => &$options ); $manager->notify('PrePluginOptionsEdit', $data); - + $template = array(); if ( $template_name ) { @@ -3796,7 +3796,7 @@ class AdminActions extends BaseActions { $template['title'] = $templates['INSERT_PLUGOPTION_TITLE']; } - + if ( !array_key_exists('INSERT_PLUGOPTION_BODY', $templates) || empty($templates['INSERT_PLUGOPTION_BODY']) ) { $template['body'] = "" @@ -3808,9 +3808,9 @@ class AdminActions extends BaseActions $template['body'] = $templates['INSERT_PLUGOPTION_BODY']; } } - + $prevPid = -1; - + foreach ( $options as $option ) { // new plugin? @@ -3819,9 +3819,9 @@ class AdminActions extends BaseActions $prevPid = $option['pid']; $this->parser->parse($template['title']); } - + $meta = NucleusPlugin::getOptionMeta($option['typeinfo']); - + if ( @$meta['access'] != 'hidden' ) { $parsed = $this->parser->parse($template['body']); @@ -3853,7 +3853,7 @@ class AdminActions extends BaseActions $query = 'SELECT bnumber as value, bname as text FROM %s, %s WHERE tblog=bnumber and tmember=%d ORDER BY bname;'; $query = sprintf($query, sql_table('blog'), sql_table('team'), (integer) $member->getID()); } - + $template['name'] = 'blogid'; $template['tabindex'] = 15000; $template['extra'] = _QMENU_ADD_SELECT; @@ -3861,9 +3861,9 @@ class AdminActions extends BaseActions $template['shorten'] = 10; $template['shortenel'] = ''; $template['javascript'] = 'onchange="return form.submit()"'; - + $this->parser->parse(showlist($query, 'select', $template, $template_name)); - + return; } @@ -3878,14 +3878,14 @@ class AdminActions extends BaseActions { global $manager; $templates = array(); - + if ( !empty($template_name) ) { $templates = & $manager->getTemplate($template_name); } $pluginExtras = array(); $manager->notify('QuickMenu', array('options' => &$pluginExtras)); - + $template = array(); if ( count($pluginExtras) > 0 ) { @@ -3898,7 +3898,7 @@ class AdminActions extends BaseActions { $template['head'] = $templates['PLUGIN_QUICKMENU_HEAD']; } - + if ( !array_key_exists('PLUGIN_QUICKMENU_BODY', $templates) && empty($templates['PLUGIN_QUICKMENU_BODY']) ) { $template['body'] = "
  • \" title=\"<%plugadmintooltip%>\"><%plugadmintitle%>
  • \n"; @@ -3907,7 +3907,7 @@ class AdminActions extends BaseActions { $template['body'] = $templates['PLUGIN_QUICKMENU_BODY']; } - + if ( !array_key_exists('PLUGIN_QUICKMENU_FOOT', $templates) || empty($templates['PLUGIN_QUICKMENU_FOOT']) ) { $template['foot'] = "\n"; @@ -3916,14 +3916,14 @@ class AdminActions extends BaseActions { $template['foot'] = $templates['PLUGIN_QUICKMENU_FOOT']; } - + $this->parser->parse($template['head']); foreach ( $pluginExtras as $aInfo ) { $data = array( - 'plugadminurl' => Entity::hsc($aInfo['url']), - 'plugadmintooltip' => Entity::hsc($aInfo['tooltip']), - 'plugadmintitle' => Entity::hsc($aInfo['title']), + 'plugadminurl' => Entity::hsc($aInfo['url']), + 'plugadmintooltip' => Entity::hsc($aInfo['tooltip']), + 'plugadmintitle' => Entity::hsc($aInfo['title']), ); $this->parser->parse(Template::fill($template['body'], $data)); } @@ -3975,12 +3975,12 @@ class AdminActions extends BaseActions public function parse_selectlocalskinfiles() { global $DIR_SKINS; - + if ( !class_exists('SkinImport', FALSE) ) { include_libs('skinie.php'); } - + if ( !preg_match('#^admin#', $this->skintype) ) { $skindir = $DIR_SKINS; @@ -3989,7 +3989,7 @@ class AdminActions extends BaseActions { $skindir = "{$DIR_SKINS}admin/"; } - + $candidates = SkinImport::searchForCandidates($skindir); foreach ( $candidates as $skinname => $skinfile ) { @@ -4016,7 +4016,7 @@ class AdminActions extends BaseActions case 'blog': $query = "SELECT bshortname, bname FROM %s;"; $show = array( - 'content' => 'shortblognames' + 'content' => 'shortblognames' ); $query = sprintf($query, sql_table('blog')); break; @@ -4030,7 +4030,7 @@ class AdminActions extends BaseActions $query = "SELECT tdname as name, tddesc as description FROM %s WHERE tdname LIKE 'admin/%%';"; } $show = array( - 'content' => 'shortnames' + 'content' => 'shortnames' ); $query = sprintf($query, sql_table('template_desc')); break; @@ -4051,7 +4051,7 @@ class AdminActions extends BaseActions public function parse_skinielist($type, $template_name = '') { global $manager; - + $templates = array(); if ( $template_name ) { @@ -4071,7 +4071,7 @@ class AdminActions extends BaseActions { $template = $templates['SKINIE_EXPORT_LIST']; } - + switch ( $type ) { case 'skin': @@ -4086,10 +4086,10 @@ class AdminActions extends BaseActions foreach ( $res as $row ) { $data = array( - 'typeid' => 'skin[' . $row['sdnumber'] . ']', - 'expid' => 'skinexp' . $row['sdnumber'], - 'expname' => Entity::hsc($row['sdname']), - 'expdesc' => Entity::hsc($row['sddesc']) + 'typeid' => 'skin[' . $row['sdnumber'] . ']', + 'expid' => 'skinexp' . $row['sdnumber'], + 'expname' => Entity::hsc($row['sdname']), + 'expdesc' => Entity::hsc($row['sddesc']) ); echo Template::fill($template, $data); } @@ -4098,7 +4098,6 @@ class AdminActions extends BaseActions if ( !preg_match('#^admin#', $this->skintype) ) { $res = DB::getResult('SELECT * FROM '.sql_table('template_desc'). " WHERE tdname NOT LIKE 'admin/%%';"); - } else { @@ -4107,10 +4106,10 @@ class AdminActions extends BaseActions foreach ( $res as $row ) { $data = array( - 'typeid' => 'template[' . $row['tdnumber'] . ']', - 'expid' => 'templateexp' . $row['tdnumber'], - 'expname' => Entity::hsc($row['tdname']), - 'expdesc' => Entity::hsc($row['tddesc']) + 'typeid' => 'template[' . $row['tdnumber'] . ']', + 'expid' => 'templateexp' . $row['tdnumber'], + 'expname' => Entity::hsc($row['tdname']), + 'expdesc' => Entity::hsc($row['tddesc']) ); echo Template::fill($template, $data); } @@ -4129,7 +4128,7 @@ class AdminActions extends BaseActions public function parse_skinoverview($template_name = '') { global $CONF; - + $template = array(); if ( !preg_match('#^admin#', $this->skintype) ) { @@ -4150,12 +4149,12 @@ class AdminActions extends BaseActions $template['default'] = $CONF['AdminSkin']; } $query = sprintf($query, sql_table('skin_desc')); - + $template['tabindex'] = 10; $template['content'] = 'skinlist'; - + $this->parser->parse(showlist($query, 'table', $template, $template_name)); - + return; } @@ -4181,17 +4180,17 @@ class AdminActions extends BaseActions { /* TODO: use Skin class */ $regularType = array( - 'index', - 'item', - 'archivelist', - 'archive', - 'search', - 'error', - 'member', - 'imagepopup' - ); + 'index', + 'item', + 'archivelist', + 'archive', + 'search', + 'error', + 'member', + 'imagepopup' + ); } - + if ( in_array($nowSkinType, $regularType) ) { help('skinpart' . $nowSkinType); @@ -4213,11 +4212,11 @@ class AdminActions extends BaseActions public function parse_specialskinlist($template_name = '') { global $CONF, $manager; - + $template = array(); - + $skinid = intRequestVar('skinid'); - + if ( !preg_match('#^admin#', $this->skintype) ) { $skin = new Skin($skinid); @@ -4232,19 +4231,19 @@ class AdminActions extends BaseActions } $normal_types = $skin->getDefaultTypes(); $available_types = $skin->getAvailableTypes(); - + $special_skintypes = array(); foreach( $available_types as $skintype => $skinname ) { if ( !array_key_exists($skintype, $normal_types) ) { $special_skintypes[] = array( - 'skintype' => $skintype, - 'skintypename' => $skinname + 'skintype' => $skintype, + 'skintypename' => $skinname ); } } - + if ( sizeof($special_skintypes) > 0 ) { $template['tabindex'] = 75; @@ -4278,7 +4277,7 @@ class AdminActions extends BaseActions { $base = constant($which); } - + if ( preg_match('#[^<|%].*[^%|>]#', $val, $matchies) ) { if ( !preg_match('#[(].*[^)]#', $matchies[0], $args) ) @@ -4290,13 +4289,13 @@ class AdminActions extends BaseActions $arg = trim($args[0], '()'); $met = 'parse_' . substr($matchies[0], 0, strpos($matchies[0], '(')); } - + if ( method_exists($this, $met) ) { $value = call_user_func(array(&$this, $met), $arg); } } - + if ( !isset($value) || empty($value) ) { $value = $val; @@ -4316,12 +4315,12 @@ class AdminActions extends BaseActions public function parse_systemsettings($type = 'phpinfo', $template_name = '') { global $manager, $member, $CONF, $nucleus; - + $member->isAdmin() or Admin::disallow(); - + $enable = _ADMIN_SYSTEMOVERVIEW_ENABLE; $disable = _ADMIN_SYSTEMOVERVIEW_DISABLE; - + switch ( $type ) { case 'phpversion': @@ -4359,9 +4358,9 @@ class AdminActions extends BaseActions { $template = $templates['SYSTEMINFO_GDSETTINGS']; } - + $gdinfo = gd_info(); - + foreach ( $gdinfo as $key => $value ) { if ( is_bool($value) ) @@ -4373,8 +4372,8 @@ class AdminActions extends BaseActions $value = Entity::hsc($value); } $data = array( - 'key' => $key, - 'value' => $value, + 'key' => $key, + 'value' => $value, ); echo Template::fill($template, $data); } @@ -4438,12 +4437,12 @@ class AdminActions extends BaseActions $template['cloneaction'] = 'admintemplateclone'; } $query = sprintf($query, sql_table('template_desc')); - + $template['tabindex'] = 10; $template['content'] = 'templatelist'; - + $this->parser->parse(showlist($query, 'table', $template, $template_name)); - + return; } @@ -4485,7 +4484,7 @@ class AdminActions extends BaseActions { global $member; $showAll = requestVar('showall'); - + if ( $member->isAdmin() && ($showAll == 'yes') ) { // Super-Admins have access to all blogs! (no add item support though) @@ -4502,7 +4501,7 @@ class AdminActions extends BaseActions . " ORDER BY bnumber;"; $query = sprintf($query, sql_table('blog'), sql_table('team'), (integer) $member->getID()); } - + $resource = DB::getResult($query); if ( ($showAll != 'yes') && $member->isAdmin() ) { @@ -4514,7 +4513,7 @@ class AdminActions extends BaseActions echo '

    ' . _OVERVIEW_SHOWALL . '

    '; } } - + if ( $resource->rowCount() > 0 ) { $template['content'] = 'bloglist'; @@ -4545,7 +4544,7 @@ class AdminActions extends BaseActions echo _OVERVIEW_NOBLOGS; } $resource->closeCursor(); - + return; } @@ -4561,7 +4560,7 @@ class AdminActions extends BaseActions protected function checkCondition($field, $name='', $value = '') { global $CONF, $archiveprevexists, $archivenextexists, $blog, $catid, $itemidnext, $itemidprev, $manager, $member; - + $condition = 0; switch ( $field ) { @@ -4757,16 +4756,16 @@ class AdminActions extends BaseActions private function ifPlugin($name, $key = '', $value = '') { global $manager; - + $plugin =& $manager->getPlugin("NP_{$name}"); if ( !$plugin ) { return; } - + $params = func_get_args(); array_shift($params); - + return call_user_func_array(array(&$plugin, 'doIf'), $params); } @@ -4781,13 +4780,13 @@ class AdminActions extends BaseActions private function ifCategory($key = '', $value='') { global $blog, $catid; - + // when no parameter is defined, just check if a category is selected if (($key != 'catname' && $key != 'catid') || ($value == '')) { return $blog->isValidCategory($catid); } - + // check category name if ( $key == 'catname' ) { @@ -4797,13 +4796,13 @@ class AdminActions extends BaseActions return $blog->isValidCategory($catid); } } - + // check category id if (($key == 'catid') && ($value == $catid)) { return $blog->isValidCategory($catid); } - + return FALSE; } @@ -4817,19 +4816,19 @@ class AdminActions extends BaseActions private function ifOnTeam($blogName = '') { global $blog, $member, $manager; - + // when no blog found if ( ($blogName == '') && !is_object($blog) ) { return 0; } - + // explicit blog selection if ($blogName != '') { $blogid = getBlogIDFromName($blogName); } - + if (($blogName == '') || !$manager->existsBlogID($blogid)) { // use current blog @@ -4848,19 +4847,19 @@ class AdminActions extends BaseActions private function ifAdmin($blogName = '') { global $blog, $member, $manager; - + // when no blog found if (($blogName == '') && (!is_object($blog))) { return 0; } - + // explicit blog selection if ($blogName != '') { $blogid = getBlogIDFromName($blogName); } - + if (($blogName == '') || !$manager->existsBlogID($blogid)) { // use current blog @@ -4939,14 +4938,14 @@ class AdminActions extends BaseActions static function customHelplink($id, $tplName = '', $url = '', $title = '', $onclick = '') { global $CONF, $manager; - + $templates = array(); - + if ( $tplName ) { $templates =& $manager->getTemplate($tplName); } - + if ( !array_key_exists('ADMIN_CUSTOMHELPLINK_ANCHOR', $templates) || empty($templates['ADMIN_CUSTOMHELPLINK_ANCHOR']) ) { $template = "#<%helptarget%>\" title=\"<%title%>\" <%onclick%>>\n"; @@ -4955,12 +4954,12 @@ class AdminActions extends BaseActions { $template = $templates['ADMIN_CUSTOMHELPLINK_ANCHOR']; } - + if ( empty($url) ) { $url = $CONF['AdminURL'] . 'documentation/customHelp.html'; } - + if ( empty($onclick) ) { $onclick = 'onclick="if (event && event.preventDefault) event.preventDefault(); return help(this.href);"'; @@ -4973,12 +4972,12 @@ class AdminActions extends BaseActions { $onclick = 'onclick="' . $onclick . '"'; } - + $data = array( -'helpurl' => $url, -'helptarget' => $id, -'onclick' => $onclick, -'title' => (isset($title) && !empty($title)) ? $title : _HELP_TT, + 'helpurl' => $url, + 'helptarget' => $id, + 'onclick' => $onclick, + 'title' => (isset($title) && !empty($title)) ? $title : _HELP_TT, ); return Template::fill($template, $data); } @@ -4990,9 +4989,9 @@ class AdminActions extends BaseActions private function customHelpHtml($id, $tplName = '', $url = '', $iconURL = '', $alt = '', $title = '', $onclick = '') { global $CONF, $manager; - + $templates = array(); - + if ( $tplName ) { $templates =& $manager->getTemplate($tplName); @@ -5005,30 +5004,30 @@ class AdminActions extends BaseActions { $template = $templates['ADMIN_CUSTOMHELPLINK_ICON']; } - + if ( empty($iconURL) ) { $iconURL = $CONF['AdminURL'] . 'documentation/icon-help.gif'; } - + if ( function_exists('getimagesize') ) { $size = getimagesize($iconURL); $width = 'width="' . $size[0] . '" '; $height = 'height="' . $size[1] . '" '; } - + $data = array( -'iconurl' => $iconURL, -'width' => $width, -'height' => $height, -'alt' => (isset($alt) && !empty($alt)) ? $alt : _HELP_TT, -'title' => (isset($title) && !empty($title)) ? $title : _HELP_TT, + 'iconurl' => $iconURL, + 'width' => $width, + 'height' => $height, + 'alt' => (isset($alt) && !empty($alt)) ? $alt : _HELP_TT, + 'title' => (isset($title) && !empty($title)) ? $title : _HELP_TT, ); - + $icon = Template::fill($template, $data); $help = $this->customHelplink($id, $tplName, $url, $title, $onclick); - + return $help . $icon; } @@ -5042,19 +5041,19 @@ class AdminActions extends BaseActions private function existsNewPlugin() { global $DIR_PLUGINS; - + $query = "SELECT * FROM %s;"; $query = sprintf($query, sql_table('plugin')); $res = DB::getResult($query); - + $installed = array(); foreach( $res as $row ) { $installed[] = $row['pfile']; } - + $files = scandir($DIR_PLUGINS); - + $candidates = array(); foreach ( $files as $file ) { @@ -5080,19 +5079,19 @@ class AdminActions extends BaseActions public function parse_pagehead() { global $member, $nucleus, $CONF, $manager; - + $extrahead = Admin::getAdminextrahead(); $data = array( -'extrahead' => &$extrahead, -'action' => Admin::getAdminAction() + 'extrahead' => &$extrahead, + 'action' => Admin::getAdminAction() ); $manager->notify('AdminPrePageHead', $data); - + $content = $this->parser->skin->getContentFromDB('pagehead'); if ( !$content ) { $baseUrl = Entity::hsc($CONF['SkinsURL']); - + /* * TODO: obsoleted if ( !array_key_exists('AdminCSS', $CONF) ) @@ -5101,11 +5100,11 @@ class AdminActions extends BaseActions $CONF['AdminCSS'] = 'original'; } */ - + /* HTTP 1.1 application for no caching */ header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); - + $root_element = 'html'; $charset = i18n::get_current_charset(); $locale = preg_replace('#_#', '-', i18n::get_current_locale()); @@ -5113,7 +5112,7 @@ class AdminActions extends BaseActions $formal_public_identifier = self::$formal_public_identifier; $system_identifier = self::$system_identifier; $xhtml_namespace = self::$xhtml_namespace; - + echo "\n"; echo "\n"; echo "<{$root_element} xmlns=\"{$xhtml_namespace}\" xml:lang=\"{$locale}\" lang=\"{$locale}\">\n"; @@ -5137,7 +5136,7 @@ class AdminActions extends BaseActions echo "
    \n"; echo "
    \n"; echo "
    \n"; - + if ( !$member->isLoggedIn() ) { echo '' . _NOTLOGGEDIN . "
    \n"; @@ -5147,10 +5146,10 @@ class AdminActions extends BaseActions echo _LOGGEDINAS . ' ' . $member->getDisplayName() ." - " . _LOGOUT. "
    \n"; echo "" . _ADMINHOME . " - "; } - + echo ""._YOURSITE."
    \n"; echo '('; - + if ( !array_key_exists('codename', $nucleus) || empty($nucleus['codename']) ) { $codenamestring = ''; @@ -5159,16 +5158,16 @@ class AdminActions extends BaseActions { $codenamestring = ' "' . $nucleus['codename'].'"'; } - + if ( $member->isLoggedIn() && $member->isAdmin() ) { $checkURL = sprintf(_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_URL, getNucleusVersion(), getNucleusPatchLevel()); echo 'Nucleus CMS ' . $nucleus['version'] . $codenamestring . ''; - + $newestVersion = getLatestVersion(); $newestCompare = str_replace('/', '.', $newestVersion); $currentVersion = str_replace(array('/','v'), array('.',''), $nucleus['version']); - + if ( $newestVersion && version_compare($newestCompare, $currentVersion) > 0 ) { echo "
    \n"; @@ -5188,7 +5187,7 @@ class AdminActions extends BaseActions { $this->parser->parse($content); } - + return; } @@ -5202,12 +5201,12 @@ class AdminActions extends BaseActions public function parse_pagefoot() { global $action, $member, $manager, $blogid; - + $data = array( - 'action' => Admin::getAdminAction() + 'action' => Admin::getAdminAction() ); $manager->notify('AdminPrePageFoot', $data); - + $content = $this->parser->skin->getContentFromDB('pagefoot'); if ( !$content ) { @@ -5219,7 +5218,7 @@ class AdminActions extends BaseActions echo '
  • ' . _LOGOUT . "
  • \n"; echo "\n"; } - + echo "
    \n"; echo 'Nucleus CMS © 2002-' . date('Y') . ' ' . _ADMINPAGEFOOT_COPYRIGHT; echo '-'; @@ -5233,14 +5232,14 @@ class AdminActions extends BaseActions echo "\n"; - + echo '

    ' . _QMENU_ADD . "

    \n"; echo "
    \n"; echo "

    \n"; echo "\n"; - + $showAll = requestVar('showall'); - + if ( ($member->isAdmin()) && ($showAll == 'yes') ) { // Super-Admins have access to all blogs! (no add item support though) @@ -5260,17 +5259,17 @@ class AdminActions extends BaseActions $template['shortenel'] = ''; $template['javascript'] = 'onchange="return form.submit()"'; $this->parser->parse(showlist($query, 'select', $template)); - + echo "

    \n"; echo "
    \n"; - + echo "

    {$member->getDisplayName()}

    \n"; echo "\n"; - + if ( $member->isAdmin() ) { echo '

    ' . _QMENU_MANAGE . "

    \n"; @@ -5291,10 +5290,10 @@ class AdminActions extends BaseActions echo '
  • ' . _QMENU_LAYOUT_IEXPORT . "
  • \n"; echo "\n"; } - + $data = array('options' => array()); $manager->notify('QuickMenu', $data); - + if ( count($data['options']) > 0 ) { echo "

    " . _QMENU_PLUGINS . "

    \n"; @@ -5359,14 +5358,14 @@ class AdminActions extends BaseActions private function selectBlog($name, $mode='blog', $selected = 0, $tabindex = 0, $showNewCat = 0, $iForcedBlogInclude = -1) { global $member, $CONF; - + // 0. get IDs of blogs to which member can post items (+ forced blog) $aBlogIds = array(); if ( $iForcedBlogInclude != -1 ) { $aBlogIds[] = intval($iForcedBlogInclude); } - + if ( $member->isAdmin() && array_key_exists('ShowAllBlogs', $CONF) && $CONF['ShowAllBlogs'] ) { $query = "SELECT bnumber FROM %s ORDER BY bname;"; @@ -5377,7 +5376,7 @@ class AdminActions extends BaseActions $query = "SELECT bnumber FROM %s, %s WHERE tblog=bnumber AND tmember=%d;"; $query = sprintf($query, sql_table('blog'), sql_table('team'), (integer) $member->getID()); } - + $rblogids = DB::getResult($query); foreach ( $rblogids as $row ) {