\r
/*\r
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2011 The Nucleus Group\r
+ * Copyright (C) 2002-2012 The Nucleus Group\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
* as published by the Free Software Foundation; either version 2\r
* of the License, or (at your option) any later version.\r
* (see nucleus/documentation/index.html#license for more info)\r
- */\r
-/**\r
- * A class representing an item\r
*\r
- * @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2011 The Nucleus Group\r
- * @version $Id$\r
- * $NucleusJP: ITEM.php,v 1.7.2.3 2008/02/07 06:13:30 kimitake Exp $\r
+ * A class representing an item\r
*/\r
class ITEM {\r
\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
+ $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
}\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
// 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
//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
\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
$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
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
// 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
$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