From a8ae579274aa5bee5bfd83fff6f884d0d733aff5 Mon Sep 17 00:00:00 2001 From: Sam Mousa Date: Thu, 21 Nov 2013 09:59:53 +0100 Subject: [PATCH] Fixed issue #8364: Error in Plugin Example --- plugins/Demo/Example/Example.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/Demo/Example/Example.php b/plugins/Demo/Example/Example.php index 15347ac525e..17c4dea8d9e 100644 --- a/plugins/Demo/Example/Example.php +++ b/plugins/Demo/Example/Example.php @@ -44,8 +44,9 @@ public function __construct(PluginManager $manager, $id) { * Below are the actual methods that handle events */ - public function afterAdminMenuLoaded(PluginEvent $event) + public function afterAdminMenuLoaded() { + $event = $this->event; $menu = $event->get('menu', array()); $menu['left'][]=array( 'href' => "http://docs.limesurvey.org", @@ -56,8 +57,9 @@ public function afterAdminMenuLoaded(PluginEvent $event) $event->set('menu', $menu); } - public function helloWorld(PluginEvent $event) + public function helloWorld() { + $event = $this->event; $count = (int) $this->get('count'); if ($count === false) $count = 0; $count++; @@ -72,8 +74,9 @@ public function helloWorld(PluginEvent $event) * The plugin should return setting meta data. * @param PluginEvent $event */ - public function beforeSurveySettings(PluginEvent $event) + public function beforeSurveySettings() { + $event = $this->event; $event->set("surveysettings.{$this->id}", array( 'name' => get_class($this), 'settings' => array( @@ -86,8 +89,9 @@ public function beforeSurveySettings(PluginEvent $event) )); } - public function newSurveySettings(PluginEvent $event) + public function newSurveySettings() { + $event = $this->event; foreach ($event->get('settings') as $name => $value) {