OSDN Git Service

「メンバーの編集(editmembersettings)」画面でスキン変数<%pluginextras%>がパースされていなかった不具合を修正
[nucleus-jp/nucleus-next.git] / nucleus / libs / AdminActions.php
index 630bcb2..15e62ad 100644 (file)
@@ -1,9 +1,19 @@
 <?php
-if ( !class_exists('BaseActions') )
-{
-       include $DIR_LIBS . 'BaseActions.php';
-}
-
+/**
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2012 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2012 The Nucleus Group
+ * @version $Id: AdminActions.php 1661 2012-02-12 11:55:39Z sakamocchi $
+ */
 
 class AdminActions extends BaseActions
 {
@@ -37,10 +47,10 @@ class AdminActions extends BaseActions
        );
        
        /**
-        * AdminActions::$skin_type_friendly_names
+        * AdminActions::$normal_skin_types
         * friendly name for wrapped page types
         */
-       static private $default_skin_types = array(
+       static private $normal_skin_types = array(
                'actionlog'                             => _ADM_SKPRT_ACTIONLOG,
                'activate'                              => _ADM_SKPRT_ACTIVATE,
                'activatesetpwd'                => _ADM_SKPRT_ACTIVATESETPWD,
@@ -82,22 +92,20 @@ class AdminActions extends BaseActions
                'commentedit'                   => _ADM_SKPRT_COMMENTEDIT,
                'createitem'                    => _ADM_SKPRT_CREATEITEM,
                'createnewlog'                  => _ADM_SKPRT_CREATENEWLOG,
-               'createaccountinput'    => _ADM_SKPRT_CREATEACCOUNTINPUT,                       /* not yet */
-               'createaccountsuccess'  => _ADM_SKPRT_CREATEACCOUNTSUCCESS,                     /* not yet */
-               'createaccountdisable'  => _ADM_SKPRT_CREATEACCOUNTDISALLOWED,          /* not yet */
+               'createaccountinput'    => _ADM_SKPRT_CREATEACCOUNTINPUT,
+               'createaccountsuccess'  => _ADM_SKPRT_CREATEACCOUNTSUCCESS,
+               'createaccountdisable'  => _ADM_SKPRT_CREATEACCOUNTDISALLOWED,
                'deleteblog'                    => _ADM_SKPRT_DELETEBLOG,
                'editmembersettings'    => _ADM_SKPRT_EDITMEMBERSETTINGS,
-               'forgotpassword'                => _ADM_SKPRT_FORGOTPASSWORD,                           /* not yet */
+               'forgotpassword'                => _ADM_SKPRT_FORGOTPASSWORD,
                'itemcommentlist'               => _ADM_SKPRT_ITEMCOMMENTLIST,
                'itemdelete'                    => _ADM_SKPRT_ITEMDELETE,
                'itemedit'                              => _ADM_SKPRT_ITEMEDIT,
                'itemlist'                              => _ADM_SKPRT_ITEMLIST,
                'itemmove'                              => _ADM_SKPRT_ITEMMOVE,
-               'login'                                 => FALSE,       //missing
                'manage'                                => _ADM_SKPRT_MANAGE,
                'manageteam'                    => _ADM_SKPRT_MANAGETEAM,
                'memberdelete'                  => _ADM_SKPRT_MEMBERDELETE,
-               'memberedit'                    => FALSE,       //missing
                'overview'                              => _ADM_SKPRT_OVERVIEW,
                'pagefoot'                              => _ADM_SKPRT_PAGEFOOT,
                'pagehead'                              => _ADM_SKPRT_PAGEHEAD,
@@ -120,31 +128,19 @@ class AdminActions extends BaseActions
                'templatedelete'                => _ADM_SKPRT_TEMPLATEDELETE,
                'templateedit'                  => _ADM_SKPRT_TEMPLATEEDIT,
                'templateoverview'              => _ADM_SKPRT_TEMPLATEOVERVIEW,
-               'usermanagement'                => _ADM_SKPRT_USERMANAGEMENT,
+               'usermanagement'                => _ADM_SKPRT_USERMANAGEMENT
        );
        
        /**
-        * AdminActions::getAvailableSkinTypes()
+        * AdminActions::getNormalSkinTypes()
         *
         * @static
         * @param       void
         * @return      array   list of friendly names for page actions
         */
-       static public function getAvailableSkinTypes()
+       static public function getNormalSkinTypes()
        {
-               return self::$default_skin_types;
-       }
-       
-       /**
-        * AdminActions::getDefaultTypes()
-        *
-        * @static
-        * @param       void
-        * @return      array   list of friendly names for page actions
-        */
-       static public function getDefaultTypes()
-       {
-               return self::$default_skin_types;
+               return self::$normal_skin_types;
        }
        
        /**
@@ -430,17 +426,17 @@ class AdminActions extends BaseActions
                                'contents',
                                'pluginextras',
                                'eventformextra',
-                               );\r
+                               );
                                break;
                        case 'createaccountsuccess':
-                               $extra_actions = array(\r
+                               $extra_actions = array(
                                'contents',
-                               );\r
+                               );
                                break;
                        case 'createaccountdisable':
                                $extra_actions = array(
                                /* nothing special */
-                               );\r
+                               );
                                break;
                        case 'createitem':
                                $extra_actions = array(
@@ -474,6 +470,7 @@ class AdminActions extends BaseActions
                                'pluginoptions',
                                'defadminskinselect',
                                'defbookmarkletselect',
+                               'pluginextras',
                                );
                                break;
                        case 'forgotpassword':
@@ -704,7 +701,8 @@ class AdminActions extends BaseActions
                if ( $resource->rowCount() > 0 )
                {
                        $template['content'] = 'actionlist';
-                       $this->parser->parse(showlist($resource, 'table', $template, $template_name));
+                       $action_list = showlist($resource, 'table', $template, $template_name);
+                       $this->parser->parse($action_list);
                }
                else
                {
@@ -858,7 +856,8 @@ class AdminActions extends BaseActions
                if ( $resource->rowCount() > 0 )
                {
                        $template['content'] = 'banlist';
-                       $this->parser-parse(showlist($resource, 'table', $template, $template_name));
+                       $ban_list = showlist($resource, 'table', $template, $template_name);
+                       $this->parser-parse($ban_list);
                }
                else
                {
@@ -1085,7 +1084,7 @@ class AdminActions extends BaseActions
                $type = strtolower(trim(requestVar('type')));
                $skinid = intRequestVar('skinid');
                
-               if ( !preg_match('#^admin#', $this->skintype) )
+               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                {
                        $skin =& $manager->getSkin($skinid);
                        $tag = 'skinvar';
@@ -1187,7 +1186,7 @@ class AdminActions extends BaseActions
         */
        public function parse_defadminskinselect($template_name)
        {
-               global $CONF, $action;
+               global $CONF, $action, $manager;
                
                if ( $action == 'editmembersettings' )
                {
@@ -1196,7 +1195,6 @@ class AdminActions extends BaseActions
                }
                elseif ( $action == 'memberedit' )
                {
-                       global $manager;
                        $mem = $manager->getMember(intRequestVar('memberid'));
                        $default = $mem->adminskin;
                }
@@ -1218,7 +1216,8 @@ class AdminActions extends BaseActions
                        $template['extra'] = Entity::hsc(_MEMBERS_USESITELANG);
                }
                
-               $this->parser->parse(showlist($query, 'select', $template, $template_name));
+               $skin_select = showlist($query, 'select', $template, $template_name);
+               $this->parser->parse($skin_select);
                return;
        }
        
@@ -1231,7 +1230,7 @@ class AdminActions extends BaseActions
         */
        public function parse_defbookmarkletselect($template_name)
        {
-               global $CONF, $action;
+               global $CONF, $action, $manager;
                
                if ( $action == 'editmembersettings' )
                {
@@ -1240,7 +1239,6 @@ class AdminActions extends BaseActions
                }
                elseif ( $action == 'memberedit' )
                {
-                       global $manager;
                        $mem = $manager->getMember(intRequestVar('memberid'));
                        $default = $mem->bookmarklet;
                }
@@ -1263,7 +1261,8 @@ class AdminActions extends BaseActions
                        $template['extra'] = Entity::hsc(_MEMBERS_USESITELANG);
                }
                
-               $this->parser->parse(showlist($query, 'select', $template, $template_name));
+               $bookmarklet_select = showlist($query, 'select', $template, $template_name);
+               $this->parser->parse($bookmarklet_select);
                return;
        }
        
@@ -1375,7 +1374,8 @@ class AdminActions extends BaseActions
                {
                        $template['content']  = 'categorylist';
                        $template['tabindex'] = 200;
-                       $this->parser->parse(listplug_batchlist('category', $resource, 'table', $template, $template_name));
+                       $category_list = listplug_batchlist('category', $resource, 'table', $template, $template_name);
+                       $this->parser->parse($category_list);
                }
                else
                {
@@ -1517,8 +1517,9 @@ class AdminActions extends BaseActions
                {
                        $template['content']  = 'teamlist';
                        $template['tabindex'] = 10;
-                               
-                       $this->parser->parse(listplug_batchlist('team', $resource, 'table', $template, $template_name));
+                       
+                       $team_list = listplug_batchlist('team', $resource, 'table', $template, $template_name);
+                       $this->parser->parse($team_list);
                }
                else
                {
@@ -1720,10 +1721,10 @@ class AdminActions extends BaseActions
         * AdminActions::parse_commentnavlist()
         * Parse skinvar commentnavlist
         *
-        * @param       void
+        * @param       string  $template_name  name of template to use
         * @return      void
         */
-       public function parse_commentnavlist()
+       public function parse_commentnavlist($template_name = '')
        {
                global $CONF, $manager, $member;
                
@@ -1803,7 +1804,8 @@ class AdminActions extends BaseActions
                                
                        $template['content'] = 'commentlist';
                                
-                       $this->parser->parse(listplug_navlist('comment', $resource, 'table', $template));
+                       $navlist = listplug_navlist('comment', $resource, 'table', $template, $template_name);
+                       $this->parser->parse($navlist);
                }
                else
                {
@@ -1950,7 +1952,7 @@ class AdminActions extends BaseActions
        {
                global $CONF, $manager;
                
-               if ( !preg_match('#^admin#', $this->skintype) )
+               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                {
                        $skin =& $manager->getSkin($CONF['BaseSkin']);
                        /* TODO: removeaction? */
@@ -1963,7 +1965,7 @@ class AdminActions extends BaseActions
                        /* TODO: removeaction? */
                }
                
-               $temporary = $skin->getDefaultTypes();
+               $temporary = $skin->getNormalTypes();
                $normal_skintype = array();
                foreach ( $temporary as $type => $label )
                {
@@ -1974,9 +1976,10 @@ class AdminActions extends BaseActions
                }
                
                $template['tabindex'] = 10;
-               $template['skinid'] = $skin->getID();
+               $template['skinid'] = intRequestVar('skinid');
                $template['skinname'] = $skin->getName();
-               $this->parser->parse(showlist($normal_skintype, 'list_normalskinlist', $template, $template_name));
+               $skin_list = showlist($normal_skintype, 'list_normalskinlist', $template, $template_name);
+               $this->parser->parse($skin_list);
                
                return;
        }
@@ -1998,7 +2001,8 @@ class AdminActions extends BaseActions
                $template['name'] = 'DefaultBlog';
                $template['selected'] = $CONF['DefaultBlog'];
                $template['tabindex'] = 10;
-               $this->parser->parse(showlist($query, 'select', $template, $template_name));
+               $blog_select = showlist($query, 'select', $template, $template_name);
+               $this->parser->parse($blog_select);
                
                return;
        }
@@ -2024,7 +2028,8 @@ class AdminActions extends BaseActions
                $template['selected'] = $blog->getDefaultCategory();
                $template['tabindex'] = 110;
                
-               $this->parser->parse(showlist($query, 'select', $template, $template_name));
+               $category_select = showlist($query, 'select', $template, $template_name);
+               $this->parser->parse($category_select);
                
                return;
        }
@@ -2041,7 +2046,7 @@ class AdminActions extends BaseActions
        {
                global $CONF, $manager, $member;
                
-               if ( !preg_match('#^admin#', $this->skintype) )
+               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                {
                        $blogid = intRequestVar('blogid');
                        if ( !$blogid )
@@ -2076,7 +2081,8 @@ class AdminActions extends BaseActions
                $query = sprintf($query, sql_table('skin_desc'));
                $template['tabindex'] = 50;
                
-               $this->parser->parse(showlist($query, 'select', $template, $template_name));
+               $skin_select = showlist($query, 'select', $template, $template_name);
+               $this->parser->parse($skin_select);
                
                return;
        }
@@ -2252,8 +2258,9 @@ class AdminActions extends BaseActions
                {
                        $template['content'] = 'memberlist';
                        $template['tabindex'] = 10;
-                               
-                       $this->parser->parse(listplug_batchlist('member', $resource, 'table', $template, $template_name));
+                       
+                       $member_list = listplug_batchlist('member', $resource, 'table', $template, $template_name);
+                       $this->parser->parse($member_list);
                }
                else
                {
@@ -2410,7 +2417,8 @@ class AdminActions extends BaseActions
                if ( sizeof($aOptions) > 0 )
                {
                        $template['content'] = 'plugoptionlist';
-                       $this->parser->parse(showlist($aOptions, 'table', $template, $template_name));
+                       $option_list = showlist($aOptions, 'table', $template, $template_name);
+                       $this->parser->parse($option_list);
                }
                else
                {
@@ -2432,7 +2440,7 @@ class AdminActions extends BaseActions
                
                $skinid = intRequestVar('skinid');
                
-               if ( !preg_match('#^admin#', $this->skintype) )
+               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                {
                        $skin =& $manager->getSKIN($skinid);
                }
@@ -2484,7 +2492,7 @@ class AdminActions extends BaseActions
                {
                        $skinid = intRequestVar('skinid');
                        
-                       if ( !preg_match('#^admin#', $this->skintype) )
+                       if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                        {
                                $skin =& $manager->getSkin($skinid);
                        }
@@ -2493,7 +2501,7 @@ class AdminActions extends BaseActions
                                $skin =& $manager->getSkin($skinid, 'AdminActions');
                        }
                        
-                       $types = $skin->getDefaultTypes();
+                       $types = $skin->getNormalTypes();
                }
                
                $type = strtolower(trim(requestVar('type')));
@@ -2614,13 +2622,15 @@ class AdminActions extends BaseActions
                        case 'extratemplate':
                                $tabidx = 600;
                                $pluginfields = array();
-                               if ( !preg_match('#^admin/#', $this->skintype) )
+                               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                                {
-                                       $manager->notify('TemplateExtraFields', array('fields' => &$pluginfields));
+                                       $data = array('fields' => &$pluginfields);
+                                       $manager->notify('TemplateExtraFields', $data);
                                }
                                else
                                {
-                                       $manager->notify('AdminTemplateExtraFields', array('fields' => &$pluginfields));
+                                       $data = array('fields' => &$pluginfields);
+                                       $manager->notify('AdminTemplateExtraFields', $data);
                                }
                                
                                foreach ( $pluginfields as $ptkey => $ptvalue )
@@ -2634,9 +2644,9 @@ class AdminActions extends BaseActions
                                        /* extra plugin field */
                                        if ( !array_key_exists('TEMPLATE_EDIT_EXPLUGNAME', $tmplt) || empty($tmplt['TEMPLATE_EDIT_EXPLUGNAME']) )
                                        {
-                                               $base = "</tr>\n"
-                                                     . "<tr>\n"
-                                                     . "<th colspan=\"2\"><%explugtplname%></th>\n";
+                                               $base = "<tr>\n"
+                                                     . "<th colspan=\"2\"><%explugtplname%></th>\n"
+                                                     . "</tr>";
                                        }
                                        else
                                        {
@@ -2657,7 +2667,8 @@ class AdminActions extends BaseActions
                                                {
                                                        $content = $template[$ptname];
                                                }
-                                               $this->parser->parse(listplug_templateEditRow($content, $ptdesc, $ptname, $help, $tabidx++, $big, $template_name));
+                                               $tempate_textarea = listplug_templateEditRow($content, $ptdesc, $ptname, $help, $tabidx++, $big, $template_name);
+                                               $this->parser->parse($tempate_textarea);
                                                continue;
                                        }
                                }
@@ -2674,7 +2685,8 @@ class AdminActions extends BaseActions
                                {
                                        $content = $template[$typename];
                                }
-                               $this->parser->parse(listplug_templateEditRow($content, $typedesc, $typename, $help, $tabindex, $big, $template_name));
+                               $tempate_textarea = listplug_templateEditRow($content, $typedesc, $typename, $help, $tabindex, $big, $template_name);
+                               $this->parser->parse($tempate_textarea);
                                break;
                }
                
@@ -2733,16 +2745,14 @@ class AdminActions extends BaseActions
        {
                global $manager;
                
-               $extrahead = Admin::getAdminextrahead();
-               
                $data = array(
-                       'extrahead'     => &$extrahead,
-                       'action'        => Admin::getAdminAction()
+                       'extrahead'     => &Admin::$extrahead,
+                       'action'        => Admin::$action
                );
                
                $manager->notify('AdminPrePageHead', $data);
                
-               $this->parser->parse($extrahead);
+               $this->parser->parse(Admin::$extrahead);
                return;
        }
        
@@ -3096,29 +3106,29 @@ class AdminActions extends BaseActions
                switch ( $type )
                {
                        case 'info':
-                               echo Entity::hsc(requestVar('skininfo'));
+                               echo Entity::hsc(Admin::$contents['skininfo']);
                                break;
                        case 'snames':
-                               $dataArr = requestArray('skinnames');
+                               $dataArr = Admin::$contents['skinnames'];
                                echo implode(' <em>' . _AND . '</em> ', $dataArr);
                                break;
                        case 'tnames':
-                               $dataArr = requestArray('tpltnames');
+                               $dataArr = Admin::$contents['tpltnames'];
                                echo implode(' <em>' . _AND . '</em> ', $dataArr);
                                break;
                        case 'sclashes':
-                               $dataArr = requestArray('skinclashes');
+                               $dataArr = Admin::$contents['skinclashes'];
                                echo implode(' <em>' . _AND . '</em> ', $dataArr);
                                break;
                        case 'tclashes':
-                               $dataArr = requestArray('tpltclashes');
+                               $dataArr = Admin::$contents['tpltclashes'];
                                echo implode(' <em>' . _AND . '</em> ', $dataArr);
                                break;
                        case 'skinfile':
-                               echo Entity::hsc(requestVar('skinfile'));
+                               echo Entity::hsc(Admin::$contents['skinfile']);
                                break;
                        case 'mode':
-                               echo Entity::hsc(requestVar('mode'));
+                               echo Entity::hsc(Admin::$contents['mode']);
                                break;
                }
                return;
@@ -3162,7 +3172,8 @@ class AdminActions extends BaseActions
         */
        public function parse_inputyesno($name, $checkedval, $tabindex = 0, $value1 = 1, $value2 = 0, $yesval = _YES, $noval = _NO, $isAdmin = 0, $template_name = '')
        {
-               $this->parser->parse(listplug_input_yesno($name, $checkedval, $tabindex, $value1, $value2, $yesval, $noval, $isAdmin, $template_name));
+               $input_yesno = listplug_input_yesno($name, $checkedval, $tabindex, $value1, $value2, $yesval, $noval, $isAdmin, $template_name);
+               $this->parser->parse($input_yesno);
                return;
        }
        
@@ -3172,14 +3183,13 @@ class AdminActions extends BaseActions
         */
        public function parse_insertpluginfo($type)
        {
-               $option = Admin::getAdminaOption();
                switch ( $type )
                {
                        case 'id':
-                               return $option['pid'];
+                               return Admin::$aOptions['pid'];
                                break;
                        case 'name':
-                               return Entity::hsc($option['pfile']);
+                               return Entity::hsc(Admin::$aOptions['pfile']);
                                break;
                }
                return;
@@ -3194,13 +3204,11 @@ class AdminActions extends BaseActions
         */
        public function parse_insplugoptcontent()
        {
-               $option = Admin::getAdminaOption();
-               
-               $meta = NucleusPlugin::getOptionMeta($option['typeinfo']);
+               $meta = NucleusPlugin::getOptionMeta(Admin::$aOptions['typeinfo']);
                if ( array_key_exists('access', $meta) && $meta['access'] != 'hidden' )
                {
                        echo '<tr>';
-                       listplug_plugOptionRow($option);
+                       listplug_plugOptionRow(Admin::$aOptions);
                        echo '</tr>';
                }
                return;
@@ -3236,10 +3244,10 @@ class AdminActions extends BaseActions
         * AdminActions::parse_itemnavlist()
         * Parse skinvar itemnavlist
         *
-        * @param       void
+        * @param       string  $template_name  name of template to use
         * @return      void
         */
-       public function parse_itemnavlist($template_name)
+       public function parse_itemnavlist($template_name = '')
        {
                global $CONF, $manager, $member;
                
@@ -3330,7 +3338,8 @@ class AdminActions extends BaseActions
                                
                        $template['content'] = 'itemlist';
                                
-                       $this->parser->parse(listplug_navlist('item', $query, 'table', $template, $template_name));
+                       $navlist = listplug_navlist('item', $query, 'table', $template, $template_name);
+                       $this->parser->parse($navlist);
                }
                else
                {
@@ -3352,34 +3361,7 @@ class AdminActions extends BaseActions
        {
                global $manager;
                
-               $item = false;
-               $itemid = intRequestVar('itemid');
-               $item =& $manager->getItem($itemid, 1, 1);
-               
-               if ( $item )
-               {
-                       $blog =& $manager->getBlog($item['blogid']);
-                       
-                       if ( $blog->convertBreaks() && requestVar('action') == 'itemedit' )
-                       {
-                               $item['body'] = removeBreaks($item['body']);
-                               $item['more'] = removeBreaks($item['more']);
-                       }
-               }
-               
-               $contents = array();
-               if ( requestVar('action') == 'itemedit' )
-               {
-                       $contents = $item;
-               }
-               elseif ( requestVar('action') == 'createitem' )
-               {
-                       $data = array(
-                               'contents'      => &$contents,
-                               'blog'          => &$this->blog
-                       );
-                       $manager->notify('PreAddItemForm', $data);
-               }
+               $contents = Admin::$contents;
                $itemtime = getdate($contents['timestamp']);
                echo $itemtime[$key];
                return;
@@ -3427,39 +3409,39 @@ class AdminActions extends BaseActions
                /* default option */
                if ( $this->skintype == 'editmembersettings' )
                {
-                       if ( !$member->getLocale() )\r
-                       {\r
-                               echo "<option value=\"\" selected=\"selected\">" . Entity::hsc(_MEMBERS_USESITELANG) . "</option>\n";\r
-                       }\r
-                       else\r
-                       {\r
-                               echo "<option value=\"\">" . Entity::hsc(_MEMBERS_USESITELANG) . "</option>\n";\r
-                       }\r
+                       if ( !$member->getLocale() )
+                       {
+                               echo "<option value=\"\" selected=\"selected\">" . Entity::hsc(_MEMBERS_USESITELANG) . "</option>\n";
+                       }
+                       else
+                       {
+                               echo "<option value=\"\">" . Entity::hsc(_MEMBERS_USESITELANG) . "</option>\n";
+                       }
                }
                else
                {
-                       if ( $CONF['Locale'] == 'en_Latn_US' )\r
-                       {\r
-                               echo "<option value=\"\" selected=\"selected\">" . Entity::hsc(_LOCALE_EN_LATN_US) . "</option>\n";\r
-                       }\r
-                       else\r
-                       {\r
-                               echo "<option value=\"\">" . Entity::hsc(_LOCALE_EN_LATN_US) . "</option>\n";\r
-                       }\r
+                       if ( $CONF['Locale'] == 'en_Latn_US' )
+                       {
+                               echo "<option value=\"\" selected=\"selected\">" . Entity::hsc(_LOCALE_EN_LATN_US) . "</option>\n";
+                       }
+                       else
+                       {
+                               echo "<option value=\"\">" . Entity::hsc(_LOCALE_EN_LATN_US) . "</option>\n";
+                       }
                }
                
                /* optional options */
                foreach ( $locales as $locale )
                {
-                       if ( $this->skintype == 'editmembersettings' )\r
+                       if ( $this->skintype == 'editmembersettings' )
                        {
-                               if ( $locale != $member->getLocale() )\r
-                               {\r
-                                       echo "<option value=\"{$locale}\">";\r
-                               }\r
-                               else\r
-                               {\r
-                                       echo "<option value=\"{$locale}\" selected=\"selected\">";\r
+                               if ( $locale != $member->getLocale() )
+                               {
+                                       echo "<option value=\"{$locale}\">";
+                               }
+                               else
+                               {
+                                       echo "<option value=\"{$locale}\" selected=\"selected\">";
                                }
                        }
                        else
@@ -3469,14 +3451,14 @@ class AdminActions extends BaseActions
                                        /* already output */
                                        continue;
                                }
-                               else if ( $locale != $CONF['Locale'] )\r
-                               {\r
-                                       echo "<option value=\"{$locale}\">";\r
-                               }\r
-                               else\r
-                               {\r
-                                       echo "<option value=\"{$locale}\" selected=\"selected\">";\r
-                               }\r
+                               else if ( $locale != $CONF['Locale'] )
+                               {
+                                       echo "<option value=\"{$locale}\">";
+                               }
+                               else
+                               {
+                                       echo "<option value=\"{$locale}\" selected=\"selected\">";
+                               }
                        }
                        $label = '_LOCALE_' . strtoupper($locale);
                        if ( !defined($label) )
@@ -3487,7 +3469,7 @@ class AdminActions extends BaseActions
                        {
                                echo constant($label);
                        }
-                       echo "</option>\n";\r
+                       echo "</option>\n";
                }
                return;
        }
@@ -3501,7 +3483,7 @@ class AdminActions extends BaseActions
         */
        public function parse_listplugplugoptionrow($template_name = '')
        {
-               echo listplug_plugOptionRow(Admin::getAdminaOption(), $template_name);
+               echo listplug_plugOptionRow(Admin::$aOptions, $template_name);
                return;
        }
        
@@ -3591,6 +3573,10 @@ class AdminActions extends BaseActions
                        echo '<br /><a style="color:red" href="http://nucleuscms.org/upgrade.php" title="' . _ADMIN_SYSTEMOVERVIEW_LATESTVERSION_TITLE . '">';
                        echo _ADMIN_SYSTEMOVERVIEW_LATESTVERSION_TEXT . $newestVersion . '</a>';
                }
+               else
+               {
+                       echo _ADMIN_SYSTEMOVERVIEW_VERSION_LATEST;
+               }
                return;
        }
        
@@ -3623,7 +3609,8 @@ class AdminActions extends BaseActions
                        'tabindex'      => 10000,
                        'selected'      => 0
                );
-               $this->parser->parse(showlist($query, 'select', $template, $template_name));
+               $member_select = showlist($query, 'select', $template, $template_name);
+               $this->parser->parse($member_select);
                return;
        }
        
@@ -3676,7 +3663,7 @@ class AdminActions extends BaseActions
         */
        public function parse_passrequestvars()
        {
-               $passvar   = Admin::getAdminpassvar();
+               $passvar   = Admin::$passvar;
                $oldaction = postVar('oldaction');
                
                if ( ($oldaction != 'logout')
@@ -3705,12 +3692,14 @@ class AdminActions extends BaseActions
                        case 'member':
                                $id  = intRequestVar('memberid');
                                $mem =& $manager->getMember($id);
-                               $manager->notify('MemberSettingsFormExtras', array('member' => &$mem));
+                               $data = array('member' => &$mem);
+                               $manager->notify('MemberSettingsFormExtras', $data);
                                break;
                        case 'blog':
                                $id  = intRequestVar('blogid');
                                $blg =& $manager->getBlog($id);
-                               $manager->notify('BlogSettingsFormExtras', array('member' => &$blg));
+                               $data = array('member' => &$blg);
+                               $manager->notify('BlogSettingsFormExtras', $data);
                                break;
                        case 'createaccount':
                                $data = array(
@@ -3723,7 +3712,8 @@ class AdminActions extends BaseActions
                                $manager->notify('RegistrationFormExtraFields', $data);
                                break;
                        default:
-                               $manager->notify('GeneralSettingsFormExtras', array());
+                       $data = array();
+                               $manager->notify('GeneralSettingsFormExtras', $data);
                                break;
                }
                return;
@@ -3778,7 +3768,8 @@ class AdminActions extends BaseActions
                $template['content']  = 'pluginlist';
                $template['tabindex'] = 10;
                
-               $this->parser->parse(showlist($query, 'table', $template, $template_name));
+               $plugin_list = showlist($query, 'table', $template, $template_name);
+               $this->parser->parse($plugin_list);
                
                return;
        }
@@ -3938,7 +3929,8 @@ class AdminActions extends BaseActions
                $template['shortenel']  = '';
                $template['javascript'] = 'onchange="return form.submit()"';
                
-               $this->parser->parse(showlist($query, 'select', $template, $template_name));
+               $selectlist = showlist($query, 'select', $template, $template_name);
+               $this->parser->parse($selectlist);
                
                return;
        }
@@ -3960,7 +3952,8 @@ class AdminActions extends BaseActions
                        $templates = & $manager->getTemplate($template_name);
                }
                $pluginExtras = array();
-               $manager->notify('QuickMenu', array('options' => &$pluginExtras));
+               $data = array('options' => &$pluginExtras);
+               $manager->notify('QuickMenu', $data);
                
                $template  = array();
                if ( count($pluginExtras) > 0 )
@@ -4001,7 +3994,8 @@ class AdminActions extends BaseActions
                                        'plugadmintooltip'      => Entity::hsc($aInfo['tooltip']),
                                        'plugadmintitle'        => Entity::hsc($aInfo['title']),
                                );
-                               $this->parser->parse(Template::fill($template['body'], $data));
+                               $body = Template::fill($template['body'], $data);
+                               $this->parser->parse($body);
                        }
                        $this->parser->parse($template['foot']);
                }
@@ -4056,8 +4050,8 @@ class AdminActions extends BaseActions
                {
                        include_libs('skinie.php');
                }
-
-               if ( !preg_match('#^admin#', $this->skintype) && $this->skintype != 'importAdmin' )
+               
+               if ( !in_array($this->skintype, Admin::$adminskin_actions) && $this->skintype != 'importAdmin' )
                {
                        $skindir = $DIR_SKINS;
                }
@@ -4069,8 +4063,15 @@ class AdminActions extends BaseActions
                $candidates = SkinImport::searchForCandidates($skindir);
                foreach ( $candidates as $skinname => $skinfile )
                {
-                       $skinfile = Entity::hsc($skinfile);
                        $skinname = Entity::hsc($skinname);
+                       if ( !in_array($this->skintype, Admin::$adminskin_actions) && $this->skintype != 'importAdmin' )
+                       {
+                               $skinfile = Entity::hsc($skinfile);
+                       }
+                       else
+                       {
+                               $skinfile = Entity::hsc("admin/$skinfile");
+                       }
                        echo "<option value=\"{$skinfile}\">{$skinname}</option>\n";
                }
        
@@ -4097,7 +4098,7 @@ class AdminActions extends BaseActions
                                $query = sprintf($query, sql_table('blog'));
                                break;
                        case 'template':
-                               if ( !preg_match('#^admin#', $this->skintype) )
+                               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                                {
                                        $query = "SELECT tdname as name, tddesc as description FROM %s WHERE tdname NOT LIKE 'admin/%%';";
                                }
@@ -4111,8 +4112,9 @@ class AdminActions extends BaseActions
                                $query = sprintf($query, sql_table('template_desc'));
                                break;
                }
-       
-               $this->parser->parse(showlist($query, 'table', $show, $template_name));
+               
+               $skin_list = showlist($query, 'table', $show, $template_name);
+               $this->parser->parse($skin_list);
                return;
        }
        
@@ -4135,13 +4137,13 @@ class AdminActions extends BaseActions
                }
                if ( !array_key_exists('SKINIE_EXPORT_LIST', $templates) || empty($templates['SKINIE_EXPORT_LIST']) )
                {
-                       $template = "<td>"
-                       . "<input type=\"checkbox\" name=\"<%typeid%>\" id=\"<%expid%>\" />\n"
-                       . "<label for=\"<%expid%>\"><%expname%></label>\n"
-                       . "</td>\n"
-                       . "<td><%expdesc%></td>\n"
-                       . "</tr>\n"
-                       . "<tr>\n";
+                       $template = "<tr>\n"
+                                 . "<td>"
+                                 . "<input type=\"checkbox\" name=\"<%typeid%>\" id=\"<%expid%>\" />\n"
+                                 . "<label for=\"<%expid%>\"><%expname%></label>\n"
+                                 . "</td>\n"
+                                 . "<td><%expdesc%></td>\n"
+                                 . "</tr>\n";
                }
                else
                {
@@ -4151,7 +4153,7 @@ class AdminActions extends BaseActions
                switch ( $type )
                {
                        case 'skin':
-                               if ( !preg_match('#^admin#', $this->skintype) )
+                               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                                {
                                        $res = DB::getResult('SELECT * FROM ' . sql_table('skin_desc'). " WHERE sdname NOT LIKE 'admin/%%';");
                                }
@@ -4171,7 +4173,7 @@ class AdminActions extends BaseActions
                                }
                                break;
                        case 'template':
-                               if ( !preg_match('#^admin#', $this->skintype) )
+                               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                                {
                                        $res = DB::getResult('SELECT * FROM '.sql_table('template_desc'). " WHERE tdname NOT LIKE 'admin/%%';");
                                }
@@ -4206,9 +4208,10 @@ class AdminActions extends BaseActions
                global $CONF;
                
                $template = array();
-               if ( !preg_match('#^admin#', $this->skintype) )
+               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                {
                        $query = "SELECT * FROM %s WHERE sdname NOT LIKE 'admin/%%' ORDER BY sdname;";
+                       $template['handler'] = 'Actions';
                        $template['editaction'] = 'skinedit';
                        $template['cloneaction'] = 'skinclone';
                        $template['deleteaction'] = 'skindelete';
@@ -4218,6 +4221,7 @@ class AdminActions extends BaseActions
                else
                {
                        $query = "SELECT * FROM %s WHERE sdname LIKE 'admin/%%' ORDER BY sdname;";
+                       $template['handler'] = 'AdminActions';
                        $template['editaction'] = 'adminskinedit';
                        $template['cloneaction'] = 'adminskinclone';
                        $template['deleteaction'] = 'adminskindelete';
@@ -4229,7 +4233,8 @@ class AdminActions extends BaseActions
                $template['tabindex'] = 10;
                $template['content'] = 'skinlist';
                
-               $this->parser->parse(showlist($query, 'table', $template, $template_name));
+               $skin_list = showlist($query, 'table', $template, $template_name);
+               $this->parser->parse($skin_list);
                
                return;
        }
@@ -4243,33 +4248,20 @@ class AdminActions extends BaseActions
         */
        public function parse_skintypehelp()
        {
-               $nowSkinType = strtolower(trim(requestVar('type')));
-               $pageAction  = strtolower(trim(requestVar('action')));
-               if ( preg_match('/^admin.*/', $pageAction) )
+               $surrent_skin_type = strtolower(trim(requestVar('type')));
+               $page_action  = strtolower(trim(requestVar('action')));
+               if ( in_array($page_action, Admin::$adminskin_actions) )
                {
-                       $regularType = self::$default_skin_types;
-                       unset($regularType['memberedit']);
-                       unset($regularType['login']);
-                       $regularType = array_keys($regularType);
+                       $normal_types = array_keys(self::$normal_skin_types);
                }
                else
                {
-                       /* TODO: use Skin class */
-                       $regularType = array(
-                               'index',
-                               'item',
-                               'archivelist',
-                               'archive',
-                               'search',
-                               'error',
-                               'member',
-                               'imagepopup'
-                       );
+                       $normal_types = array_keys(Actions::getNormalSkinTypes());
                }
                
-               if ( in_array($nowSkinType, $regularType) )
+               if ( in_array($surrent_skin_type, $normal_types) )
                {
-                       help('skinpart' . $nowSkinType);
+                       help('skinpart' . $surrent_skin_type);
                }
                else
                {
@@ -4293,7 +4285,7 @@ class AdminActions extends BaseActions
                
                $skinid = intRequestVar('skinid');
                
-               if ( !preg_match('#^admin#', $this->skintype) )
+               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                {
                        $skin =& $manager->getSkin($skinid);
                        $template['editaction'] = 'skinedittype';
@@ -4305,7 +4297,7 @@ class AdminActions extends BaseActions
                        $template['editaction'] = 'adminskinedittype';
                        $template['removeaction'] = 'adminskinremovetype';
                }
-               $normal_types = $skin->getDefaultTypes();
+               $normal_types = $skin->getNormalTypes();
                $available_types = $skin->getAvailableTypes();
                
                $special_skintypes = array();
@@ -4325,7 +4317,8 @@ class AdminActions extends BaseActions
                        $template['tabindex'] = 75;
                        $template['skinid'] = $skin->getID();
                        $template['skinname'] = $skin->getName();
-                       $this->parser->parse(showlist($special_skintypes, 'list_specialskinlist', $template, $template_name));
+                       $skin_list = showlist($special_skintypes, 'list_specialskinlist', $template, $template_name);
+                       $this->parser->parse($skin_list);
                }
                else
                {
@@ -4455,11 +4448,25 @@ class AdminActions extends BaseActions
                                }
                                break;
                        case 'modrewrite':
-                               ob_start();
-                               phpinfo(INFO_MODULES);
-                               $im = ob_get_contents();
-                               ob_end_clean();
-                               echo ( i18n::strpos($im, 'mod_rewrite') !== FALSE ) ? $enable : $disable;
+                               if ( function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules()) )
+                               {
+                                       echo $enable;
+                               }
+                               else
+                               {
+                                       ob_start();
+                                       phpinfo(INFO_MODULES);
+                                       $im = ob_get_contents();
+                                       ob_end_clean();
+                                       if ( i18n::strpos($im, 'mod_rewrite') !== FALSE )
+                                       {
+                                               echo $enable;
+                                       }
+                                       else
+                                       {
+                                               echo $disable;
+                                       }
+                               }
                                break;
                        case 'nucleusversion':
                                echo getNucleusVersion() / 100 . '(' . $nucleus['version'] . ')';
@@ -4498,7 +4505,7 @@ class AdminActions extends BaseActions
         */
        public function parse_templateoverview($template_name = '')
        {
-               if ( !preg_match('#^admin#', $this->skintype) )
+               if ( !in_array($this->skintype, Admin::$adminskin_actions) )
                {
                        $query = "SELECT * FROM %s WHERE tdname NOT LIKE 'admin/%%' ORDER BY tdname;";
                        $template['deleteaction'] = 'templatedelete';
@@ -4517,7 +4524,8 @@ class AdminActions extends BaseActions
                $template['tabindex'] = 10;
                $template['content'] = 'templatelist';
                
-               $this->parser->parse(showlist($query, 'table', $template, $template_name));
+               $template_list = showlist($query, 'table', $template, $template_name);
+               $this->parser->parse($template_list);
                
                return;
        }
@@ -4595,7 +4603,8 @@ class AdminActions extends BaseActions
                        $template['content']    = 'bloglist';
                        $template['superadmin'] = $member->isAdmin();
                                
-                       $this->parser->parse(showlist($resource, 'table', $template, $template_name));
+                       $list_resource_table = showlist($resource, 'table', $template, $template_name);
+                       $this->parser->parse($list_resource_table);
                        $resource->closeCursor();
                                
                        echo '<h2>' . _OVERVIEW_YRDRAFTS . '</h2>';
@@ -4608,7 +4617,8 @@ class AdminActions extends BaseActions
                        if ( $resource->rowCount() > 0 )
                        {
                                $template['content'] = 'draftlist';
-                               $this->parser->parse(showlist($resource, 'table', $template, $template_name));
+                               $draft_list = showlist($resource, 'table', $template, $template_name);
+                               $this->parser->parse($draft_list);
                        }
                        else
                        {
@@ -4699,10 +4709,10 @@ class AdminActions extends BaseActions
                                $condition = $this->ifHasPlugin($name, $value);
                                break;
                        case 'adminaction':
-                               $condition = (Admin::getAdminAction() == $name);
+                               $condition = (Admin::$action == $name);
                                break;
                        case 'adminoldaction':
-                               $condition = (Admin::getAdminAction() == $name);
+                               $condition = (Admin::$action == $name);
                                break;
                        case 'addresschange':
                                $condition = ($this->ifAddresscange());
@@ -4714,7 +4724,7 @@ class AdminActions extends BaseActions
                                $condition = ($this->ifSkincandidates());
                                break;
                        case 'nameclashes':
-                               $condition = requestVar('nameclashes');
+                               $condition = Admin::$contents['nameclashes'];
                                break;
                        case 'existsnewplugin':
                                $condition = ($this->existsNewPlugin());
@@ -5166,10 +5176,10 @@ class AdminActions extends BaseActions
                        $root_element = 'html';
                        $charset = i18n::get_current_charset();
                        $locale = preg_replace('#_#', '-', i18n::get_current_locale());
-                       $xml_version_info = self::$xml_version_info;
-                       $formal_public_identifier = self::$formal_public_identifier;
-                       $system_identifier = self::$system_identifier;
-                       $xhtml_namespace = self::$xhtml_namespace;
+                       $xml_version_info = '1.0';
+                       $formal_public_identifier = '-//W3C//DTD XHTML 1.0 Strict//EN';
+                       $system_identifier = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd';
+                       $xhtml_namespace = 'http://www.w3.org/1999/xhtml';
                        
                        $content = "<?xml version=\"{$xml_version_info}\" encoding=\"{$charset}\" ?>\n"
                                  . "<!DOCTYPE {$root_element} PUBLIC \"{$formal_public_identifier}\" \"{$system_identifier}\">\n"
@@ -5234,10 +5244,8 @@ class AdminActions extends BaseActions
        public function parse_pagefoot()
        {
                global $action, $member, $manager, $blogid;
-               
-               $data = array(
-                       'action' => Admin::getAdminAction()
-               );
+
+               $data = array('action' => Admin::$action);
                $manager->notify('AdminPrePageFoot', $data);
                
                $content = $this->parser->skin->getContentFromDB('pagefoot');