• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-next: Commit

Nucleus CMSの新リリースを準備するためのリポジトリ。現在はNucleus CMS 4.0にマージするためのコードをコミットしている。


Commit MetaInfo

Revision7ea26abd7e41c2644f42ce936f6557d58755cb3a (tree)
Time2012-06-28 01:00:43
Authorreine <reine@user...>
Commiterreine

Log Message

FIX:$manager->notify()の第二引数に変数を渡すように修正。

スクリプトに含まれるすべての$manager->notify()の第二引数を変数に変更した
プラグインメソッドは、引数を参照で受け取るようにする必要がある。

Change Summary

Incremental Difference

--- a/nucleus/libs/ACTION.php
+++ b/nucleus/libs/ACTION.php
@@ -296,8 +296,9 @@ class Action
296296 $newmem = new Member();
297297 $newmem->readFromName($name);
298298 $newmem->sendActivationLink('register');
299-
300- $manager->notify('PostRegister', array('member' => &$newmem) );
299+
300+ $data = array('member' => $newmem);
301+ $manager->notify('PostRegister', $data);
301302
302303 if ( postVar('desturl') )
303304 {
--- a/nucleus/libs/ACTIONLOG.php
+++ b/nucleus/libs/ACTIONLOG.php
@@ -64,7 +64,8 @@ class ActionLog
6464
6565 $query = sprintf('DELETE FROM %s', sql_table('actionlog'));
6666
67- $manager->notify('ActionLogCleared',array());
67+ $data = array();
68+ $manager->notify('ActionLogCleared', $data);
6869
6970 return DB::execute($query) !== FALSE;
7071 }
--- a/nucleus/libs/ACTIONS.php
+++ b/nucleus/libs/ACTIONS.php
@@ -706,10 +706,11 @@ class Actions extends BaseActions
706706 * @param object $blog an instance of Blog class
707707 * @return void
708708 */
709- private function preBlogContent($type, &$blog)
709+ private function preBlogContent($type, $blog)
710710 {
711711 global $manager;
712- $manager->notify('PreBlogContent',array('blog' => &$blog, 'type' => $type));
712+ $data = array('blog' => $blog, 'type' => $type);
713+ $manager->notify('PreBlogContent', $data);
713714 return;
714715 }
715716
@@ -721,10 +722,11 @@ class Actions extends BaseActions
721722 * @param objecct $blog an instance of Blog class
722723 * @return void
723724 */
724- private function postBlogContent($type, &$blog)
725+ private function postBlogContent($type, $blog)
725726 {
726727 global $manager;
727- $manager->notify('PostBlogContent', array('blog' => &$blog, 'type' => $type));
728+ $data = array('blog' => $blog, 'type' => $type);
729+ $manager->notify('PostBlogContent', $data);
728730 return;
729731 }
730732
@@ -974,11 +976,11 @@ class Actions extends BaseActions
974976 public function parse_blog($template, $amount = 10, $category = '')
975977 {
976978 global $blog, $startpos;
977-
978979 list($limit, $offset) = sscanf($amount, '%d(%d)');
979980 $this->setBlogCategory($blog, $category);
980981 $this->preBlogContent('blog',$blog);
981982 $this->amountfound = $blog->readLog($template, $limit, $offset, $startpos);
983+ $this->parse_benchmark();
982984 $this->postBlogContent('blog',$blog);
983985 return;
984986 }
@@ -1042,7 +1044,8 @@ class Actions extends BaseActions
10421044 public function parse_callback($eventName, $type)
10431045 {
10441046 global $manager;
1045- $manager->notify($eventName, array('type' => $type));
1047+ $data = array('type' => $type);
1048+ $manager->notify($eventName, $data);
10461049 return;
10471050 }
10481051
--- a/nucleus/libs/ADMIN.php
+++ b/nucleus/libs/ADMIN.php
@@ -813,7 +813,8 @@ class Admin
813813
814814 $item =& $manager->getItem($itemid, 1, 1);
815815 $blog =& $manager->getBlog($item['blogid']);
816- $manager->notify('PrepareItemForEdit', array('blog'=> &$blog, 'item' => &$item));
816+ $data = array('blog'=> $blog, 'item' => $item);
817+ $manager->notify('PrepareItemForEdit', $data);
817818
818819 if ( $blog->convertBreaks() )
819820 {
@@ -1202,8 +1203,9 @@ class Admin
12021203
12031204 $member->canAlterComment($commentid) or self::disallow();
12041205
1205- $comment = COMMENT::getComment($commentid);
1206- $manager->notify('PrepareCommentForEdit', array('comment' => &$comment));
1206+ $comment = Comment::getComment($commentid);
1207+ $data = array('comment' => &$comment);
1208+ $manager->notify('PrepareCommentForEdit', $data);
12071209
12081210 self::$contents = $comment;
12091211 self::$skin->parse('commentedit');
@@ -5250,8 +5252,9 @@ class Admin
52505252 {
52515253 $event_identifier = 'AdminSkin';
52525254 }
5253-
5254- $manager->notify("PreDelete{$event_identifier}", array('skinid' => $skinid));
5255+
5256+ $data = array('skinid' => $skinid);
5257+ $manager->notify("PreDelete{$event_identifier}", $data);
52555258
52565259 // 1. delete description
52575260 $query = "DELETE FROM %s WHERE sdnumber=%d;";
@@ -5263,7 +5266,7 @@ class Admin
52635266 $query = sprintf($query, sql_table('skin'), (integer) $skinid);
52645267 DB::execute($query);
52655268
5266- $manager->notify("PostDelete{$event_identifier}", array('skinid' => $skinid));
5269+ $manager->notify("PostDelete{$event_identifier}", $data);
52675270
52685271 return;
52695272 }
--- a/nucleus/libs/AdminActions.php
+++ b/nucleus/libs/AdminActions.php
@@ -2611,11 +2611,13 @@ class AdminActions extends BaseActions
26112611 $pluginfields = array();
26122612 if ( !in_array($this->skintype, Admin::$adminskin_actions) )
26132613 {
2614- $manager->notify('TemplateExtraFields', array('fields' => &$pluginfields));
2614+ $data = array('fields' => &$pluginfields);
2615+ $manager->notify('TemplateExtraFields', $data);
26152616 }
26162617 else
26172618 {
2618- $manager->notify('AdminTemplateExtraFields', array('fields' => &$pluginfields));
2619+ $data = array('fields' => &$pluginfields);
2620+ $manager->notify('AdminTemplateExtraFields', $data);
26192621 }
26202622
26212623 foreach ( $pluginfields as $ptkey => $ptvalue )
@@ -3673,12 +3675,14 @@ class AdminActions extends BaseActions
36733675 case 'member':
36743676 $id = intRequestVar('memberid');
36753677 $mem =& $manager->getMember($id);
3676- $manager->notify('MemberSettingsFormExtras', array('member' => &$mem));
3678+ $data = array('member' => &$mem);
3679+ $manager->notify('MemberSettingsFormExtras', $data);
36773680 break;
36783681 case 'blog':
36793682 $id = intRequestVar('blogid');
36803683 $blg =& $manager->getBlog($id);
3681- $manager->notify('BlogSettingsFormExtras', array('member' => &$blg));
3684+ $data = array('member' => &$blg);
3685+ $manager->notify('BlogSettingsFormExtras', $data);
36823686 break;
36833687 case 'createaccount':
36843688 $data = array(
@@ -3691,7 +3695,8 @@ class AdminActions extends BaseActions
36913695 $manager->notify('RegistrationFormExtraFields', $data);
36923696 break;
36933697 default:
3694- $manager->notify('GeneralSettingsFormExtras', array());
3698+ $data = array();
3699+ $manager->notify('GeneralSettingsFormExtras', $data);
36953700 break;
36963701 }
36973702 return;
@@ -3929,7 +3934,8 @@ class AdminActions extends BaseActions
39293934 $templates = & $manager->getTemplate($template_name);
39303935 }
39313936 $pluginExtras = array();
3932- $manager->notify('QuickMenu', array('options' => &$pluginExtras));
3937+ $data = array('options' => &$pluginExtras);
3938+ $manager->notify('QuickMenu', $data);
39333939
39343940 $template = array();
39353941 if ( count($pluginExtras) > 0 )
@@ -5214,8 +5220,9 @@ class AdminActions extends BaseActions
52145220 public function parse_pagefoot()
52155221 {
52165222 global $action, $member, $manager, $blogid;
5217-
5218- $manager->notify('AdminPrePageFoot', array('action' => Admin::$action));
5223+
5224+ $data = array('action' => Admin::$action);
5225+ $manager->notify('AdminPrePageFoot', $data);
52195226
52205227 $content = $this->parser->skin->getContentFromDB('pagefoot');
52215228 if ( !$content )
--- a/nucleus/libs/BAN.php
+++ b/nucleus/libs/BAN.php
@@ -55,28 +55,19 @@ class Ban
5555 public function addBan($blogid, $iprange, $reason)
5656 {
5757 global $manager;
58-
59- $manager->notify(
60- 'PreAddBan',
61- array(
58+
59+ $data = array(
6260 'blogid' => $blogid,
6361 'iprange' => &$iprange,
6462 'reason' => &$reason
65- )
66- );
63+ );
64+ $manager->notify('PreAddBan', $data);
6765
6866 $query = 'INSERT INTO %s (blogid, iprange, reason) VALUES (%d, %s, %s)';
6967 $query = sprintf($query, sql_table('ban'), intval($blogid), DB::quoteValue($iprange), DB::quoteValue($reason));
7068 $res = DB::execute($query);
7169
72- $manager->notify(
73- 'PostAddBan',
74- array(
75- 'blogid' => $blogid,
76- 'iprange' => $iprange,
77- 'reason' => $reason
78- )
79- );
70+ $manager->notify('PostAddBan', $data);
8071
8172 return $res !== FALSE ? 1 : 0;
8273 }
@@ -88,26 +79,18 @@ class Ban
8879 public function removeBan($blogid, $iprange)
8980 {
9081 global $manager;
91-
92- $manager->notify(
93- 'PreDeleteBan',
94- array(
82+
83+ $data = array(
9584 'blogid' => $blogid,
9685 'range' => $iprange
97- )
98- );
86+ );
87+ $manager->notify('PreDeleteBan', $data);
9988
10089 $query = 'DELETE FROM %s WHERE blogid=%d and iprange=%s';
10190 $query = sprintf($query, sql_table('ban'), intval($blogid), DB::quoteValue($iprange));
10291 $res = DB::execute($query);
10392
104- $manager->notify(
105- 'PostDeleteBan',
106- array(
107- 'blogid' => $blogid,
108- 'range' => $iprange
109- )
110- );
93+ $manager->notify('PostDeleteBan', $data);
11194
11295 return $res !== FALSE ? 1 : 0;
11396 }
--- a/nucleus/libs/BLOG.php
+++ b/nucleus/libs/BLOG.php
@@ -184,6 +184,7 @@ class Blog
184184 private function showUsingQuery($templateName, $query, $highlight = '', $comments = 0, $dateheads = 1)
185185 {
186186 global $CONF, $manager, $currentTemplateName;
187+ global $StartTime;
187188
188189 $lastVisit = cookieVar($CONF['CookiePrefix'] .'lastVisit');
189190 if ( $lastVisit != 0 )
@@ -228,7 +229,8 @@ class Blog
228229 if ( $old_date != 0 )
229230 {
230231 $oldTS = strtotime($old_date);
231- $manager->notify('PreDateFoot',array('blog' => &$this, 'timestamp' => $oldTS));
232+ $data = array('blog' => $this, 'timestamp' => $oldTS);
233+ $manager->notify('PreDateFoot', $data);
232234
233235 if ( !in_array('DATE_FOOTER', $template) || empty($template['DATE_FOOTER']) )
234236 {
@@ -239,10 +241,11 @@ class Blog
239241 $tmp_footer = i18n::formatted_datetime($template['DATE_FOOTER'], $oldTS);
240242 }
241243 $parser->parse($tmp_footer);
242- $manager->notify('PostDateFoot',array('blog' => &$this, 'timestamp' => $oldTS));
244+ $manager->notify('PostDateFoot', $data);
243245 }
244246
245- $manager->notify('PreDateHead',array('blog' => &$this, 'timestamp' => $timestamp));
247+ $data = array('blog' => $this, 'timestamp' => $timestamp);
248+ $manager->notify('PreDateHead', $data);
246249
247250 // note, to use templatvars in the dateheader, the %-characters need to be doubled in
248251 // order to be preserved by strftime
@@ -255,16 +258,17 @@ class Blog
255258 $tmp_header = i18n::formatted_datetime($template['DATE_HEADER'], $timestamp);
256259 }
257260 $parser->parse($tmp_header);
258- $manager->notify('PostDateHead',array('blog' => &$this, 'timestamp' => $timestamp));
261+ $manager->notify('PostDateHead', $data);
259262 }
260263 $old_date = $new_date;
261264 }
262265
263266 // parse item
264267 $parser->parse($template['ITEM_HEADER']);
265- $manager->notify('PreItem', array('blog' => &$this, 'item' => &$item));
268+ $data = array('blog' => $this, 'item' => &$item);
269+ $manager->notify('PreItem', $data);
266270 $parser->parse($template['ITEM']);
267- $manager->notify('PostItem', array('blog' => &$this, 'item' => &$item));
271+ $manager->notify('PostItem', $data);
268272 $parser->parse($template['ITEM_FOOTER']);
269273 }
270274
@@ -273,9 +277,10 @@ class Blog
273277 // add another date footer if there was at least one item
274278 if ( ($numrows > 0) && $dateheads )
275279 {
276- $manager->notify('PreDateFoot',array('blog' => &$this, 'timestamp' => strtotime($old_date)));
280+ $data = array('blog' => $this, 'timestamp' => strtotime($old_date));
281+ $manager->notify('PreDateFoot', $data);
277282 $parser->parse($template['DATE_FOOTER']);
278- $manager->notify('PostDateFoot',array('blog' => &$this, 'timestamp' => strtotime($old_date)));
283+ $manager->notify('PostDateFoot', $data);
279284 }
280285
281286 $items->closeCursor();
@@ -353,8 +358,9 @@ class Blog
353358 }
354359
355360 $timestamp = date('Y-m-d H:i:s',$timestamp);
356-
357- $manager->notify('PreAddItem',array('title' => &$title, 'body' => &$body, 'more' => &$more, 'blog' => &$this, 'authorid' => &$authorid, 'timestamp' => &$timestamp, 'closed' => &$closed, 'draft' => &$draft, 'catid' => &$catid));
361+
362+ $data = array('title' => &$title, 'body' => &$body, 'more' => &$more, 'blog' => $this, 'authorid' => &$authorid, 'timestamp' => &$timestamp, 'closed' => &$closed, 'draft' => &$draft, 'catid' => &$catid);
363+ $manager->notify('PreAddItem', $data);
358364
359365 $ititle = DB::quoteValue($title);
360366 $ibody = DB::quoteValue($body);
@@ -365,8 +371,9 @@ class Blog
365371 $query = sprintf($query, sql_table('item'), $ititle, $ibody, $imore, $blogid, $authorid, $timestamp, $closed, $draft, $catid, $posted);
366372 DB::execute($query);
367373 $itemid = DB::getInsertId();
368-
369- $manager->notify('PostAddItem',array('itemid' => $itemid));
374+
375+ $data = array('itemid' => $itemid);
376+ $manager->notify('PostAddItem', $data);
370377
371378 if ( !$draft )
372379 {
@@ -681,7 +688,7 @@ class Blog
681688 }
682689
683690 $template =& $manager->getTemplate($template);
684- $data['blogid'] = $this->blogid;
691+ $listitem['blogid'] = $this->blogid;
685692
686693 if ( !array_key_exists('ARCHIVELIST_HEADER', $template) || !$template['ARCHIVELIST_HEADER'] )
687694 {
@@ -692,7 +699,7 @@ class Blog
692699 $tplt = $template['ARCHIVELIST_HEADER'];
693700 }
694701
695- echo Template::fill($tplt, $data);
702+ echo Template::fill($tplt, $listitem);
696703
697704 $query = 'SELECT itime, SUBSTRING(itime,1,4) AS Year, SUBSTRING(itime,6,2) AS Month, SUBSTRING(itime,9,2) AS Day'
698705 . ' FROM '.sql_table('item')
@@ -732,34 +739,35 @@ class Blog
732739 {
733740 $archivedate = date('Y-m-d',$current['itime']);
734741 $archive['day'] = date('d',$current['itime']);
735- $data['day'] = date('d',$current['itime']);
736- $data['month'] = date('m',$current['itime']);
737- $archive['month'] = $data['month'];
742+ $listitem['day'] = date('d',$current['itime']);
743+ $listitem['month'] = date('m',$current['itime']);
744+ $archive['month'] = $listitem['month'];
738745 }
739746 elseif ( $mode == 'year' )
740747 {
741748 $archivedate = date('Y',$current['itime']);
742- $data['day'] = '';
743- $data['month'] = '';
749+ $listitem['day'] = '';
750+ $listitem['month'] = '';
744751 $archive['day'] = '';
745752 $archive['month'] = '';
746753 }
747754 else
748755 {
749756 $archivedate = date('Y-m',$current['itime']);
750- $data['month'] = date('m',$current['itime']);
751- $archive['month'] = $data['month'];
752- $data['day'] = '';
757+ $listitem['month'] = date('m',$current['itime']);
758+ $archive['month'] = $listitem['month'];
759+ $listitem['day'] = '';
753760 $archive['day'] = '';
754761 }
755762
756- $data['year'] = date('Y',$current['itime']);
757- $archive['year'] = $data['year'];
758- $data['archivelink'] = Link::create_archive_link($this->blogid,$archivedate,$linkparams);
759-
760- $manager->notify('PreArchiveListItem', array('listitem' => &$data));
763+ $listitem['year'] = date('Y',$current['itime']);
764+ $archive['year'] = $listitem['year'];
765+ $listitem['archivelink'] = Link::create_archive_link($this->blogid,$archivedate,$linkparams);
766+
767+ $data = array('listitem' => &$listitem);
768+ $manager->notify('PreArchiveListItem', $data);
761769
762- $temp = Template::fill($template['ARCHIVELIST_LISTITEM'],$data);
770+ $temp = Template::fill($template['ARCHIVELIST_LISTITEM'],$listitem);
763771 echo i18n::formatted_datetime($temp, $current['itime']);
764772 return;
765773 }
@@ -775,7 +783,7 @@ class Blog
775783 $tplt = $template['ARCHIVELIST_FOOTER'];
776784 }
777785
778- echo Template::fill($tplt, $data);
786+ echo Template::fill($tplt, $listitem);
779787 return;
780788 }
781789
@@ -846,29 +854,29 @@ class Blog
846854 $query = sprintf($query, sql_table('category'), (integer) $this->blogid);
847855 $res = DB::getResult($query);
848856
849- foreach ( $res as $data )
857+ foreach ( $res as $row )
850858 {
851859 $args = array(
852- 'catid' => $data['catid'],
853- 'name' => $data['catname'],
860+ 'catid' => $row['catid'],
861+ 'name' => $row['catname'],
854862 'extra' => $linkparams
855863 );
856864
857- $data['blogid'] = $this->blogid;
858- $data['blogurl'] = $blogurl;
859- $data['catlink'] = Link::create_link('category', $args);
860- $data['self'] = $CONF['Self'];
865+ $row['blogid'] = $this->blogid;
866+ $row['blogurl'] = $blogurl;
867+ $row['catlink'] = Link::create_link('category', $args);
868+ $row['self'] = $CONF['Self'];
861869
862870 // this gives catiscurrent = no when no category is selected.
863- $data['catiscurrent'] = 'no';
864- $data['currentcat'] = 'no';
871+ $row['catiscurrent'] = 'no';
872+ $row['currentcat'] = 'no';
865873
866874 if ( $this->selectedcatid )
867875 {
868- if ( $this->selectedcatid == $data['catid'] )
876+ if ( $this->selectedcatid == $row['catid'] )
869877 {
870- $data['catiscurrent'] = 'yes';
871- $data['currentcat'] = 'yes';
878+ $row['catiscurrent'] = 'yes';
879+ $row['currentcat'] = 'yes';
872880 }
873881 }
874882 else
@@ -879,23 +887,24 @@ class Blog
879887 $iobj =& $manager->getItem($itemid, 0, 0);
880888 $cid = $iobj['catid'];
881889
882- if ( $cid == $data['catid'] )
890+ if ( $cid == $row['catid'] )
883891 {
884- $data['catiscurrent'] = 'yes';
885- $data['currentcat'] = 'yes';
892+ $row['catiscurrent'] = 'yes';
893+ $row['currentcat'] = 'yes';
886894 }
887895 }
888896 }
889-
890- $manager->notify('PreCategoryListItem', array('listitem' => &$data));
897+
898+ $data = array('listitem' => &$row);
899+ $manager->notify('PreCategoryListItem', $data);
891900
892901 if ( !array_key_exists('CATLIST_LISTITEM', $template) || empty($template['CATLIST_LISTITEM']))
893902 {
894- echo Template::fill(NULL, $data);
903+ echo Template::fill(NULL, $row);
895904 }
896905 else
897906 {
898- echo Template::fill($template['CATLIST_LISTITEM'], $data);
907+ echo Template::fill($template['CATLIST_LISTITEM'], $row);
899908 }
900909 }
901910
@@ -987,24 +996,25 @@ class Blog
987996 $query = 'SELECT bnumber, bname, bshortname, bdesc, burl FROM '.sql_table('blog').' ORDER BY '.$orderby.' '.$direction;
988997 $res = DB::getResult($query);
989998
990- foreach ( $res as $data )
999+ foreach ( $res as $row )
9911000 {
9921001 $list = array();
993- $list['bloglink'] = Link::create_blogid_link($data['bnumber']);
994- $list['blogdesc'] = $data['bdesc'];
995- $list['blogurl'] = $data['burl'];
1002+ $list['bloglink'] = Link::create_blogid_link($row['bnumber']);
1003+ $list['blogdesc'] = $row['bdesc'];
1004+ $list['blogurl'] = $row['burl'];
9961005
9971006 if ( $bnametype == 'shortname' )
9981007 {
999- $list['blogname'] = $data['bshortname'];
1008+ $list['blogname'] = $row['bshortname'];
10001009 }
10011010 else
10021011 {
10031012 /* all other cases */
1004- $list['blogname'] = $data['bname'];
1013+ $list['blogname'] = $row['bname'];
10051014 }
1006-
1007- $manager->notify('PreBlogListItem',array('listitem' => &$list));
1015+
1016+ $data = array('listitem' => &$list);
1017+ $manager->notify('PreBlogListItem', $data);
10081018
10091019 echo Template::fill($template['BLOGLIST_LISTITEM'], $list);
10101020 }
@@ -1139,8 +1149,8 @@ class Blog
11391149 public function getCategoryDesc($catid)
11401150 {
11411151 $query = 'SELECT cdesc FROM %s WHERE cblog=%d and catid=%d;';
1142- $query = sprintf($querym, sql_table('category'), (integer) $this->blogid, (integer) $catid);
1143- $res = DB::getValue();
1152+ $query = sprintf($query, sql_table('category'), (integer) $this->blogid, (integer) $catid);
1153+ $res = DB::getValue($query);
11441154 return $res;
11451155 }
11461156
@@ -1767,7 +1777,8 @@ class Blog
17671777 // This $pinged is allow a plugin to tell other hook to the event that a ping is sent already
17681778 // Note that the plugins's calling order is subject to thri order in the plugin list
17691779 $pinged = FALSE;
1770- $manager->notify('JustPosted', array('blogid' => $this->blogid, 'pinged' => &$pinged));
1780+ $data = array('blogid' => $this->blogid, 'pinged' => &$pinged);
1781+ $manager->notify('JustPosted', $data);
17711782
17721783 // clear all expired future posts
17731784 $query = "UPDATE %s SET iposted='1' WHERE iblog=%d AND itime < NOW();";
--- a/nucleus/libs/COMMENTS.php
+++ b/nucleus/libs/COMMENTS.php
@@ -120,10 +120,11 @@ class Comments
120120 $comment['timestamp'] = strtotime($comment['ctime']);
121121 $handler->setCurrentComment($comment);
122122 $handler->setHighlight($highlight);
123-
124- $manager->notify('PreComment', array('comment' => &$comment));
123+
124+ $data = array('comment' => &$comment);
125+ $manager->notify('PreComment', $data);
125126 $parser->parse($template['COMMENTS_BODY']);
126- $manager->notify('PostComment', array('comment' => &$comment));
127+ $manager->notify('PostComment', $data);
127128 }
128129
129130 $parser->parse($template['COMMENTS_FOOTER']);
@@ -273,8 +274,9 @@ class Comments
273274 $spamcheck['email'] = $comment['email'];
274275 $spamcheck['url'] = $comment['userid'];
275276 }
276-
277- $manager->notify('SpamCheck', array('spamcheck' => &$spamcheck) );
277+
278+ $data = array('spamcheck' => &$spamcheck);
279+ $manager->notify('SpamCheck', $data);
278280
279281 if ( !$continue && isset($spamcheck['result']) && $spamcheck['result'] == TRUE )
280282 {
@@ -336,8 +338,9 @@ class Comments
336338 }
337339
338340 $comment = Comment::prepare($comment);
339-
340- $manager->notify('PreAddComment', array('comment' => &$comment, 'spamcheck' => &$spamcheck) );
341+
342+ $data = array('comment' => &$comment, 'spamcheck' => &$spamcheck);
343+ $manager->notify('PreAddComment', $data);
341344
342345 $name = DB::quoteValue($comment['user']);
343346 $url = DB::quoteValue($comment['userid']);
@@ -372,7 +375,8 @@ class Comments
372375
373376 // post add comment
374377 $commentid = DB::getInsertId();
375- $manager->notify('PostAddComment', array('comment' => &$comment, 'commentid' => &$commentid, 'spamcheck' => &$spamcheck) );
378+ $data = array('comment' => &$comment, 'commentid' => &$commentid, 'spamcheck' => &$spamcheck);
379+ $manager->notify('PostAddComment', $data);
376380
377381 // succeeded !
378382 return TRUE;
@@ -435,7 +439,8 @@ class Comments
435439 // let plugins do verification (any plugin which thinks the comment is invalid
436440 // can change 'error' to something other than '1')
437441 $result = 1;
438- $manager->notify('ValidateForm', array('type' => 'comment', 'comment' => &$comment, 'error' => &$result, 'spamcheck' => &$spamcheck) );
442+ $data = array('type' => 'comment', 'comment' => &$comment, 'error' => &$result, 'spamcheck' => &$spamcheck);
443+ $manager->notify('ValidateForm', $data);
439444
440445 return $result;
441446 }
--- a/nucleus/libs/ITEM.php
+++ b/nucleus/libs/ITEM.php
@@ -373,8 +373,9 @@ class Item
373373
374374 // off we go!
375375 DB::execute($query);
376-
377- $manager->notify('PostUpdateItem', array('itemid' => $itemid));
376+
377+ $data = array('itemid' => $itemid);
378+ $manager->notify('PostUpdateItem', $data);
378379
379380 // when needed, move item and comments to new blog
380381 if ( $moveNeeded )
@@ -461,8 +462,9 @@ class Item
461462 {
462463 return 1;
463464 }
464-
465- $manager->notify('PreDeleteItem', array('itemid' => $itemid));
465+
466+ $data = array('itemid' => $itemid);
467+ $manager->notify('PreDeleteItem', $data);
466468
467469 // delete item
468470 $query = "DELETE FROM %s WHERE inumber=%d;";
@@ -477,7 +479,7 @@ class Item
477479 // delete all associated plugin options
478480 NucleusPlugin::delete_option_values('item', $itemid);
479481
480- $manager->notify('PostDeleteItem', array('itemid' => $itemid));
482+ $manager->notify('PostDeleteItem', $data);
481483
482484 return 0;
483485 }
--- a/nucleus/libs/LINK.php
+++ b/nucleus/libs/LINK.php
@@ -116,15 +116,13 @@ class Link
116116
117117 if ($usePathInfo)
118118 {
119- $manager->notify(
120- 'GenerateURL',
121- array(
119+ $data = array(
122120 'type' => $type,
123121 'params' => $params,
124122 'completed' => &$created,
125123 'url' => &$url
126- )
127- );
124+ );
125+ $manager->notify('GenerateURL', $data);
128126 }
129127
130128 // if a plugin created the URL, return it
--- a/nucleus/libs/MANAGER.php
+++ b/nucleus/libs/MANAGER.php
@@ -542,7 +542,7 @@ class Manager
542542 * but it can also be an array containing multiple values
543543 * @return void
544544 */
545- public function notify($eventName, $data)
545+ public function notify($eventName, &$data)
546546 {
547547 // load subscription list if needed
548548 if ( !is_array($this->subscriptions) )
@@ -571,7 +571,7 @@ class Manager
571571 && !empty($this->plugins[$listener])
572572 && method_exists($this->plugins[$listener], 'event_' . $eventName) )
573573 {
574- call_user_func(array(&$this->plugins[$listener], 'event_' . $eventName), array(&$data));
574+ call_user_func(array(&$this->plugins[$listener], 'event_' . $eventName), $data);
575575 }
576576 }
577577 }
--- a/nucleus/libs/MEDIA.php
+++ b/nucleus/libs/MEDIA.php
@@ -206,7 +206,8 @@ class Media
206206 }
207207
208208 // trigger PreMediaUpload event
209- $manager->notify('PreMediaUpload',array('collection' => &$collection, 'uploadfile' => $uploadfile, 'filename' => &$filename));
209+ $data = array('collection' => &$collection, 'uploadfile' => $uploadfile, 'filename' => &$filename);
210+ $manager->notify('PreMediaUpload', $data);
210211
211212 // don't allow uploads to unknown or forbidden collections
212213 $exceptReadOnly = TRUE;
@@ -268,8 +269,9 @@ class Media
268269 $oldumask = umask(0000);
269270 @chmod($mediadir . $filename, 0644);
270271 umask($oldumask);
271-
272- $manager->notify('PostMediaUpload',array('collection' => $collection, 'mediadir' => $mediadir, 'filename' => $filename));
272+
273+ $data = array('collection' => $collection, 'mediadir' => $mediadir, 'filename' => $filename);
274+ $manager->notify('PostMediaUpload', $data);
273275
274276 return '';
275277 }
--- a/nucleus/libs/MEMBER.php
+++ b/nucleus/libs/MEMBER.php
@@ -201,7 +201,8 @@ class Member
201201
202202 $success = 0;
203203 $allowlocal = 1;
204- $manager->notify('CustomLogin', array('login' => &$login, 'password'=>&$password, 'success'=>&$success, 'allowlocal'=>&$allowlocal));
204+ $data = array('login' => &$login, 'password'=>&$password, 'success'=>&$success, 'allowlocal'=>&$allowlocal);
205+ $manager->notify('CustomLogin', $data);
205206
206207 $this->loggedin = 0;
207208 if ( $success )
@@ -225,7 +226,8 @@ class Member
225226 {
226227 $errormessage = 'Login failed for ' . $login;
227228 }
228- $manager->notify('LoginFailed', array('username' => $login) );
229+ $data = array('username' => $login);
230+ $manager->notify('LoginFailed', $data);
229231 ActionLog::add(INFO, $errormessage);
230232 }
231233 /* login success */
@@ -248,7 +250,8 @@ class Member
248250 }
249251
250252 $errormessage = '';
251- $manager->notify('LoginSuccess', array('member' => &$member, 'username' => $login) );
253+ $data = array('member' => $this, 'username' => $login);
254+ $manager->notify('LoginSuccess', $data);
252255 ActionLog::add(INFO, "Login successful for $login (sharedpc=$shared)");
253256 }
254257
@@ -324,7 +327,8 @@ class Member
324327 /* remove cookies on logout */
325328 setcookie("{$CONF['CookiePrefix']}user", '', (time() - 2592000), $CONF['CookiePath'], $CONF['CookieDomain'], $CONF['CookieSecure']);
326329 setcookie("{$CONF['CookiePrefix']}loginkey", '', (time() - 2592000), $CONF['CookiePath'], $CONF['CookieDomain'], $CONF['CookieSecure']);
327- $manager->notify('Logout', array('username' => cookieVar("{$CONF['CookiePrefix']}user") ) );
330+ $data = array('username' => cookieVar("{$CONF['CookiePrefix']}user") );
331+ $manager->notify('Logout', $data);
328332 }
329333
330334 $this->loggedin = 0;
--- a/nucleus/libs/SKIN.php
+++ b/nucleus/libs/SKIN.php
@@ -320,7 +320,7 @@ class Skin
320320 global $currentSkinName, $manager, $CONF, $DIR_NUCLEUS;
321321
322322 $data = array(
323- 'skin' => &$this,
323+ 'skin' => $this,
324324 'type' => $type
325325 );
326326 $manager->notify("Init{$this->event_identifier}Parse", $data);
--- a/nucleus/libs/TEMPLATE.php
+++ b/nucleus/libs/TEMPLATE.php
@@ -142,26 +142,22 @@ class Template
142142 static public function createNew($name, $desc)
143143 {
144144 global $manager;
145-
146- $manager->notify(
147- 'PreAddTemplate',
148- array(
145+
146+ $data = array(
149147 'name' => &$name,
150148 'description' => &$desc
151- )
152- );
149+ );
150+ $manager->notify('PreAddTemplate', $data);
153151
154152 DB::execute('INSERT INTO '.sql_table('template_desc').' (tdname, tddesc) VALUES (' . DB::quoteValue($name) . ',' . DB::quoteValue($desc) . ')');
155153 $newId = DB::getInsertId();
156-
157- $manager->notify(
158- 'PostAddTemplate',
159- array(
154+
155+ $data = array(
160156 'templateid' => $newId,
161157 'name' => $name,
162158 'description' => $desc
163- )
164- );
159+ );
160+ $manager->notify('PostAddTemplate', $data);
165161
166162 return $newId;
167163 }
@@ -176,12 +172,8 @@ class Template
176172 static public function read($name)
177173 {
178174 global $manager;
179- $manager->notify(
180- 'PreTemplateRead',
181- array(
182- 'template' => &$name
183- )
184- );
175+ $data = array('template' => &$name);
176+ $manager->notify('PreTemplateRead', $data);
185177
186178 $query = "SELECT tpartname, tcontent FROM %s, %s WHERE tdesc=tdnumber and tdname=%s";
187179 $query = sprintf($query, sql_table('template_desc'), sql_table('template'), DB::quoteValue($name));
--- a/nucleus/libs/globalfunctions.php
+++ b/nucleus/libs/globalfunctions.php
@@ -344,7 +344,8 @@ i18n::set_current_locale($locale);
344344
345345
346346 /* login completed */
347-$manager->notify('PostAuthentication', array('loggedIn' => $member->isLoggedIn() ) );
347+$data = array('loggedIn' => $member->isLoggedIn());
348+$manager->notify('PostAuthentication', $data);
348349
349350 /* next action */
350351 if ( $member->isLoggedIn() && $nextaction )
--- a/nucleus/plugins/NP_Medium.php
+++ b/nucleus/plugins/NP_Medium.php
@@ -135,7 +135,7 @@ class NP_Medium extends NucleusPlugin
135135 return;
136136 }
137137
138- public function event_AdminPrePageHead($data)
138+ public function event_AdminPrePageHead(&$data)
139139 {
140140 global $CONF;
141141
--- a/nucleus/plugins/NP_Ping.php
+++ b/nucleus/plugins/NP_Ping.php
@@ -111,7 +111,7 @@ class NP_Ping extends NucleusPlugin
111111 return;
112112 }
113113
114- public function event_JustPosted($data)
114+ public function event_JustPosted(&$data)
115115 {
116116 global $DIR_PLUGINS, $DIR_NUCLEUS;
117117
@@ -138,13 +138,13 @@ class NP_Ping extends NucleusPlugin
138138 return;
139139 }
140140
141- public function event_PostAddItem($data)
141+ public function event_PostAddItem(&$data)
142142 {
143143 $this->_sendPingCheck($data['itemid']);
144144 return ;
145145 }
146146
147- public function event_PostUpdateItem($data)
147+ public function event_PostUpdateItem(&$data)
148148 {
149149 $this->_sendPingCheck($data['itemid']);
150150 return;
--- a/nucleus/plugins/NP_SecurityEnforcer.php
+++ b/nucleus/plugins/NP_SecurityEnforcer.php
@@ -123,7 +123,7 @@ class NP_SecurityEnforcer extends NucleusPlugin
123123 return;
124124 }
125125
126- public function event_QuickMenu($data)
126+ public function event_QuickMenu(&$data)
127127 {
128128 // only show when option enabled
129129 global $member;
@@ -143,7 +143,7 @@ class NP_SecurityEnforcer extends NucleusPlugin
143143 return;
144144 }
145145
146- public function event_PrePasswordSet($data)
146+ public function event_PrePasswordSet(&$data)
147147 {
148148 //password, errormessage, valid
149149 if ( $this->enable_security == 'no' )
@@ -172,7 +172,7 @@ class NP_SecurityEnforcer extends NucleusPlugin
172172 return;
173173 }
174174
175- public function event_PostRegister($data)
175+ public function event_PostRegister(&$data)
176176 {
177177 if ( $this->enable_security != 'yes' )
178178 {
@@ -192,7 +192,7 @@ class NP_SecurityEnforcer extends NucleusPlugin
192192 return;
193193 }
194194
195- public function event_CustomLogin($data)
195+ public function event_CustomLogin(&$data)
196196 {
197197 if ( $this->enable_security != 'yes' || $this->max_failed_login <= 0 )
198198 {
@@ -226,7 +226,7 @@ class NP_SecurityEnforcer extends NucleusPlugin
226226 return;
227227 }
228228
229- public function event_LoginSuccess($data)
229+ public function event_LoginSuccess(&$data)
230230 {
231231 //member(obj),username
232232 if ( $this->enable_security != 'yes' || $this->max_failed_login <= 0 )
@@ -241,7 +241,7 @@ class NP_SecurityEnforcer extends NucleusPlugin
241241 return;
242242 }
243243
244- public function event_LoginFailed($data)
244+ public function event_LoginFailed(&$data)
245245 {
246246 //username
247247 if ( $this->enable_security != 'yes' || $this->max_failed_login <= 0 )
--- a/nucleus/plugins/NP_SkinFiles.php
+++ b/nucleus/plugins/NP_SkinFiles.php
@@ -104,7 +104,7 @@ class NP_SkinFiles extends NucleusPlugin {
104104 return;
105105 }
106106
107- public function event_QuickMenu($data)
107+ public function event_QuickMenu(&$data)
108108 {
109109 global $member;
110110
Show on old repository browser