UserPageBuildingEvent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@301 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
3bfe8ef56b
commit
4e5d7ff7b3
1 changed files with 15 additions and 1 deletions
|
@ -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 {
|
||||
// event handling {{{
|
||||
public function receive_event($event) {
|
||||
|
@ -57,9 +67,13 @@ class UserPage extends Extension {
|
|||
}
|
||||
else { // view
|
||||
$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
|
||||
if(is_a($event, 'PageRequestEvent')) {
|
||||
|
|
Reference in a new issue