OSDN Git Service

FIX: デバッグ動作時に発生する警告に対処
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / libs / PAGEFACTORY.php
index 0a8d4d3..b303bc9 100755 (executable)
@@ -101,7 +101,11 @@ class PAGEFACTORY extends BaseActions {
                $this->method = 'add';\r
 \r
                global $manager;\r
-               $manager->notify('PreAddItemForm', array('contents' => &$contents, 'blog' => &$this->blog));\r
+               $param = array(\r
+                       'contents'      => &$contents,\r
+                       'blog'          => &$this->blog\r
+               );\r
+               $manager->notify('PreAddItemForm', $param);\r
 \r
                $this->createForm($contents);\r
        }\r
@@ -135,7 +139,7 @@ class PAGEFACTORY extends BaseActions {
                $template = $this->getTemplateFor($this->type);\r
 \r
                // use the PARSER engine to parse that template\r
-               $parser =& new PARSER($this->actions, $this);\r
+               $parser = new PARSER($this->actions, $this);\r
                $parser->parse($template);\r
        }\r
 \r
@@ -165,7 +169,7 @@ class PAGEFACTORY extends BaseActions {
 \r
        // create category dropdown box\r
        function parse_categories($startidx = 0) {\r
-                       if ($this->variables['catid'])\r
+                       if (array_key_exists('catid', $this->variables) && $this->variables['catid'])\r
                                $catid = $this->variables['catid'];                             // on edit item\r
                        else\r
                                $catid = $this->blog->getDefaultCategory();             // on add item\r
@@ -245,12 +249,10 @@ class PAGEFACTORY extends BaseActions {
 \r
                $extrahead = '';\r
 \r
-               $manager->notify(\r
-                       'BookmarkletExtraHead',\r
-                       array(\r
-                               'extrahead' => &$extrahead\r
-                       )\r
+               $param = array(\r
+                       'extrahead' => &$extrahead\r
                );\r
+               $manager->notify('BookmarkletExtraHead', $param);\r
 \r
                echo $extrahead;\r
        }\r
@@ -387,20 +389,18 @@ class PAGEFACTORY extends BaseActions {
 \r
                switch ($this->method) {\r
                        case 'add':\r
-                               $manager->notify('AddItemFormExtras',\r
-                                               array(\r
-                                                       'blog' => &$this->blog\r
-                                               )\r
+                               $param = array(\r
+                                       'blog' => &$this->blog\r
                                );\r
+                               $manager->notify('AddItemFormExtras', $param);\r
                                break;\r
                        case 'edit':\r
-                               $manager->notify('EditItemFormExtras',\r
-                                               array(\r
-                                                       'variables' => $this->variables,\r
-                                                       'blog' => &$this->blog,\r
-                                                       'itemid' => $this->variables['itemid']\r
-                                               )\r
+                               $param = array(\r
+                                       'variables'     =>  $this->variables,\r
+                                       'blog'          => &$this->blog,\r
+                                       'itemid'        =>  $this->variables['itemid']\r
                                );\r
+                               $manager->notify('EditItemFormExtras', $param);\r
                                break;\r
                }\r
        }\r