OSDN Git Service

「メンバーの編集(editmembersettings)」画面でスキン変数<%pluginextras%>がパースされていなかった不具合を修正
[nucleus-jp/nucleus-next.git] / nucleus / libs / AdminActions.php
index 5efc9a7..15e62ad 100644 (file)
@@ -426,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(
@@ -470,6 +470,7 @@ class AdminActions extends BaseActions
                                'pluginoptions',
                                'defadminskinselect',
                                'defbookmarkletselect',
+                               'pluginextras',
                                );
                                break;
                        case 'forgotpassword':
@@ -700,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
                {
@@ -854,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
                {
@@ -1213,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;
        }
        
@@ -1257,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;
        }
        
@@ -1369,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
                {
@@ -1511,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
                {
@@ -1714,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;
                
@@ -1797,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
                {
@@ -1970,7 +1978,8 @@ class AdminActions extends BaseActions
                $template['tabindex'] = 10;
                $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;
        }
@@ -1992,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;
        }
@@ -2018,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;
        }
@@ -2070,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;
        }
@@ -2246,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
                {
@@ -2404,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
                {
@@ -2610,11 +2624,13 @@ class AdminActions extends BaseActions
                                $pluginfields = array();
                                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 )
@@ -2628,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
                                        {
@@ -2651,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;
                                        }
                                }
@@ -2668,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;
                }
                
@@ -3154,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;
        }
        
@@ -3225,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;
                
@@ -3319,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
                {
@@ -3389,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
@@ -3431,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) )
@@ -3449,7 +3469,7 @@ class AdminActions extends BaseActions
                        {
                                echo constant($label);
                        }
-                       echo "</option>\n";\r
+                       echo "</option>\n";
                }
                return;
        }
@@ -3589,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;
        }
        
@@ -3671,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(
@@ -3689,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;
@@ -3744,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;
        }
@@ -3904,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;
        }
@@ -3926,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 )
@@ -3967,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']);
                }
@@ -4084,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;
        }
        
@@ -4108,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
                {
@@ -4204,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;
        }
@@ -4287,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
                {
@@ -4493,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;
        }
@@ -4571,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>';
@@ -4584,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
                        {
@@ -5210,8 +5244,9 @@ class AdminActions extends BaseActions
        public function parse_pagefoot()
        {
                global $action, $member, $manager, $blogid;
-               
-               $manager->notify('AdminPrePageFoot', array('action' => Admin::$action));
+
+               $data = array('action' => Admin::$action);
+               $manager->notify('AdminPrePageFoot', $data);
                
                $content = $this->parser->skin->getContentFromDB('pagefoot');
                if ( !$content )