Skip to content

Commit

Permalink
Event
Browse files Browse the repository at this point in the history
  • Loading branch information
elinw committed Apr 12, 2011
1 parent 1b65293 commit 94c572d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions libraries/joomla/event/dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static function getInstance()
* @access public
* @param string $event Name of the event to register handler for
* @param string $handler Name of the event handler
*
* @return void
* @since 11.1
*/
Expand All @@ -57,13 +58,13 @@ public function register($event, $handler)
// Are we dealing with a class or function type handler?
if (function_exists($handler))
{
// Ok, function type event handler... lets attach it.
// Ok, function type event handler... let's attach it.
$method = array('event' => $event, 'handler' => $handler);
$this->attach($method);
}
elseif (class_exists($handler))
{
// Ok, class type event handler... lets instantiate and attach it.
// Ok, class type event handler... let's instantiate and attach it.
$this->attach(new $handler($this));
}
else
Expand All @@ -79,6 +80,7 @@ public function register($event, $handler)
* @access public
* @param string $event The event to trigger.
* @param array $args An array of arguments.
*
* @return array An array of results from each function call.
* @since 11.1
*/
Expand Down
3 changes: 2 additions & 1 deletion libraries/joomla/event/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ abstract class JEvent extends JObserver
*
* @access public
* @param array Arguments
*
* @return mixed Routine return value
* @since 11.1
*/
public function update(&$args)
{
/*
* First lets get the event from the argument array. Next we will unset the
* First let's get the event from the argument array. Next we will unset the
* event argument as it has no bearing on the method to handle the event.
*/
$event = $args['event'];
Expand Down

0 comments on commit 94c572d

Please sign in to comment.