less global user, more event->user

git-svn-id: file:///home/shish/svn/shimmie2/trunk@478 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish
2007-08-24 22:29:34 +00:00
parent 6993bc2fdf
commit 88336cc323
13 changed files with 41 additions and 46 deletions

View File

@@ -9,13 +9,12 @@
class AdminUtils extends Extension {
var $theme;
// event handler {{{
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("admin_utils", "AdminUtilsTheme");
if(is_a($event, 'PageRequestEvent') && ($event->page_name == "admin_utils")) {
global $user;
if($user->is_admin()) {
if($event->user->is_admin()) {
set_time_limit(0);
switch($_POST['action']) {
@@ -40,8 +39,7 @@ class AdminUtils extends Extension {
$this->theme->display_form($page);
}
}
// }}}
// do things {{{
private function lowercase_all_tags() {
global $database;
$database->execute("UPDATE tags SET tag=lower(tag)");
@@ -66,7 +64,6 @@ class AdminUtils extends Extension {
}
}
}
// }}}
}
add_event_listener(new AdminUtils());
?>