UserPageBuildingEvent

git-svn-id: file:///home/shish/svn/shimmie2/trunk@301 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-07-16 19:38:12 +00:00
parent 3bfe8ef56b
commit 4e5d7ff7b3

View file

@ -14,6 +14,16 @@ class UserBlockBuildingEvent extends Event {
} }
} }
class UserPageBuildingEvent extends Event {
var $page = null;
var $user = null;
public function UserPageBuildingEvent($page, $user) {
$this->page = $page;
$this->user = $user;
}
}
class UserPage extends Extension { class UserPage extends Extension {
// event handling {{{ // event handling {{{
public function receive_event($event) { public function receive_event($event) {
@ -57,9 +67,13 @@ class UserPage extends Extension {
} }
else { // view else { // view
$duser = ($event->count_args() == 0) ? $user : $database->get_user_by_name($event->get_arg(0)); $duser = ($event->count_args() == 0) ? $user : $database->get_user_by_name($event->get_arg(0));
$this->build_user_page($duser); send_event(new UserPageBuildingEvent($event->page, $duser));
} }
} }
if(is_a($event, 'UserPageBuildingEvent')) {
$this->build_user_page($event->user);
}
// user info is shown on all pages // user info is shown on all pages
if(is_a($event, 'PageRequestEvent')) { if(is_a($event, 'PageRequestEvent')) {