OSDN Git Service

FIX: PHP5/MySQL5における文法違反コードの修正
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / libs / ITEM.php
index c1ef7cf..093d547 100755 (executable)
@@ -164,7 +164,17 @@ class ITEM {
                //Setting the itemOptions\r
                $aOptions = requestArray('plugoption');\r
                NucleusPlugin::_applyPluginOptions($aOptions, $itemid);\r
-               $manager->notify('PostPluginOptionsUpdate',array('context' => 'item', 'itemid' => $itemid, 'item' => array('title' => $i_title, 'body' => $i_body, 'more' => $i_more, 'closed' => $i_closed, 'catid' => $i_catid)));\r
+               $param = array(\r
+               'context'       => 'item',\r
+               'itemid'        => $itemid,\r
+               'item'          => array(\r
+                       'title'         => $i_title,\r
+                       'body'          => $i_body,\r
+                       'more'          => $i_more,\r
+                       'closed'        => $i_closed,\r
+                       'catid'         => $i_catid)\r
+               );\r
+               $manager->notify('PostPluginOptionsUpdate', $param);\r
 \r
                if ($i_draftid > 0) {\r
                        // delete permission is checked inside ITEM::delete()\r
@@ -208,7 +218,16 @@ class ITEM {
                }\r
 \r
                // call plugins\r
-               $manager->notify('PreUpdateItem',array('itemid' => $itemid, 'title' => &$title, 'body' => &$body, 'more' => &$more, 'blog' => &$blog, 'closed' => &$closed, 'catid' => &$catid));\r
+               $param = array(\r
+               '       itemid'         =>  $itemid,\r
+                       'title'         => &$title,\r
+                       'body'          => &$body,\r
+                       'more'          => &$more,\r
+                       'blog'          => &$blog,\r
+                       'closed'        => &$closed,\r
+                       'catid'         => &$catid\r
+               );\r
+               $manager->notify('PreUpdateItem', $param);\r
 \r
                // update item itsself\r
                $query =  'UPDATE '.sql_table('item')\r
@@ -264,7 +283,8 @@ class ITEM {
                // off we go!\r
                sql_query($query);\r
 \r
-               $manager->notify('PostUpdateItem',array('itemid' => $itemid));\r
+               $param = array('itemid' => $itemid);\r
+               $manager->notify('PostUpdateItem', $param);\r
 \r
                // when needed, move item and comments to new blog\r
                if ($moveNeeded)\r
@@ -273,7 +293,18 @@ class ITEM {
                //update the itemOptions\r
                $aOptions = requestArray('plugoption');\r
                NucleusPlugin::_applyPluginOptions($aOptions);\r
-               $manager->notify('PostPluginOptionsUpdate',array('context' => 'item', 'itemid' => $itemid, 'item' => array('title' => $title, 'body' => $body, 'more' => $more, 'closed' => $closed, 'catid' => $catid)));\r
+               $param = array(\r
+                       'context'       => 'item',\r
+                       'itemid'        => $itemid,\r
+                       'item'          => array(\r
+                               'title'         => $title,\r
+                               'body'          => $body,\r
+                               'more'          => $more,\r
+                               'closed'        => $closed,\r
+                               'catid'         => $catid\r
+                       )\r
+               );\r
+               $manager->notify('PostPluginOptionsUpdate', $param);\r
 \r
        }\r
 \r
@@ -290,14 +321,12 @@ class ITEM {
 \r
                $new_blogid = getBlogIDFromCatID($new_catid);\r
 \r
-               $manager->notify(\r
-                       'PreMoveItem',\r
-                       array(\r
-                               'itemid' => $itemid,\r
-                               'destblogid' => $new_blogid,\r
-                               'destcatid' => $new_catid\r
-                       )\r
+               $param = array(\r
+                       'itemid'                => $itemid,\r
+                       'destblogid'    => $new_blogid,\r
+                       'destcatid'             => $new_catid\r
                );\r
+               $manager->notify('PreMoveItem', $param);\r
 \r
 \r
                // update item table\r
@@ -308,14 +337,12 @@ class ITEM {
                $query = 'UPDATE '.sql_table('comment')." SET cblog=" . $new_blogid." WHERE citem=" . $itemid;\r
                sql_query($query);\r
 \r
-               $manager->notify(\r
-                       'PostMoveItem',\r
-                       array(\r
-                               'itemid' => $itemid,\r
-                               'destblogid' => $new_blogid,\r
-                               'destcatid' => $new_catid\r
-                       )\r
+               $param = array(\r
+                       'itemid'                => $itemid,\r
+                       'destblogid'    => $new_blogid,\r
+                       'destcatid'             => $new_catid\r
                );\r
+               $manager->notify('PostMoveItem', $param);\r
        }\r
 \r
        /**\r
@@ -332,8 +359,8 @@ class ITEM {
                        return 1;\r
                }\r
 \r
-\r
-               $manager->notify('PreDeleteItem', array('itemid' => $itemid));\r
+               $param = array('itemid' => $itemid);\r
+               $manager->notify('PreDeleteItem', $param);\r
 \r
                // delete item\r
                $query = 'DELETE FROM '.sql_table('item').' WHERE inumber=' . $itemid;\r
@@ -346,7 +373,8 @@ class ITEM {
                // delete all associated plugin options\r
                NucleusPlugin::_deleteOptionValues('item', $itemid);\r
 \r
-               $manager->notify('PostDeleteItem', array('itemid' => $itemid));\r
+               $param = array('itemid' => $itemid);\r
+               $manager->notify('PostDeleteItem', $param);\r
 \r
                return 0;\r
        }\r
@@ -448,12 +476,25 @@ class ITEM {
                        $itemid = $blog->additem($i_catid, $i_title, $i_body, $i_more, $i_blogid, $i_author, $posttime, $i_closed, $i_draft);\r
                }\r
 \r
+               /*\r
                // No plugin support in AutoSaveDraft yet\r
                //Setting the itemOptions\r
-               //$aOptions = requestArray('plugoption');\r
-               //NucleusPlugin::_applyPluginOptions($aOptions, $itemid);\r
-               //$manager->notify('PostPluginOptionsUpdate',array('context' => 'item', 'itemid' => $itemid, 'item' => array('title' => $i_title, 'body' => $i_body, 'more' => $i_more, 'closed' => $i_closed, 'catid' => $i_catid)));\r
-\r
+               $aOptions = requestArray('plugoption');\r
+               NucleusPlugin::_applyPluginOptions($aOptions, $itemid);\r
+               $param = array(\r
+                       'context'       => 'item',\r
+                       'itemid'        => $itemid,\r
+                       'item'          => array(\r
+                               'title'         => $i_title,\r
+                               'body'          => $i_body,\r
+                               'more'          => $i_more,\r
+                               'closed'        => $i_closed,\r
+                               'catid'         => $i_catid\r
+                       )\r
+               );\r
+               $manager->notify('PostPluginOptionsUpdate', $param);\r
+               */\r
+               \r
                // success\r
                return array('status' => 'added', 'draftid' => $itemid);\r
        }\r