aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/event/data.php56
-rw-r--r--phpBB/includes/functions.php3
2 files changed, 58 insertions, 1 deletions
diff --git a/phpBB/includes/event/data.php b/phpBB/includes/event/data.php
new file mode 100644
index 0000000000..754876c119
--- /dev/null
+++ b/phpBB/includes/event/data.php
@@ -0,0 +1,56 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class phpbb_event_data extends phpbb_event implements ArrayAccess
+{
+ private $data;
+
+ public function __construct(array $data = array())
+ {
+ $this->set_data($data);
+ }
+
+ public function set_data(array $data = array())
+ {
+ $this->data = $data;
+ }
+
+ public function get_data()
+ {
+ return $this->data;
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return isset($this->data[$offset]) ? $this->data[$offset] : null;
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ $this->data[$offset] = $value;
+ }
+
+ public function offsetUnset($offset)
+ {
+ unset($this->data[$offset]);
+ }
+}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 03376bf906..109f5b0366 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4745,7 +4745,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'A_COOKIE_SETTINGS' => addslashes('; path=' . $config['cookie_path'] . ((!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']) . ((!$config['cookie_secure']) ? '' : '; secure')),
));
- $event = new phpbb_event();
+ $event = new phpbb_event_data();
+ $event->set_data(compact('page_title', 'display_online_list', 'item_id', 'item'));
$phpbb_dispatcher->dispatch('page_header', $event);
// application/xhtml+xml not used because of IE