From 7dda59a4d93b01b951404f88ec1ba963bbc88a01 Mon Sep 17 00:00:00 2001 From: shish Date: Tue, 2 Oct 2007 23:20:23 +0000 Subject: [PATCH] options git-svn-id: file:///home/shish/svn/shimmie2/trunk@516 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/rating/main.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/contrib/rating/main.php b/contrib/rating/main.php index e5b6edf3..00905b8b 100644 --- a/contrib/rating/main.php +++ b/contrib/rating/main.php @@ -18,6 +18,10 @@ class Ratings extends Extension { if($config->get_int("ext_ratings_version") < 2) { $this->install(); } + + global $config; + $config->set_default_string("ext_rating_anon_privs", 'sq'); + $config->set_default_string("ext_rating_user_privs", 'sq'); } # TODO: ImageEditorBuildingEvent @@ -35,6 +39,18 @@ class Ratings extends Extension { $this->theme->display_rater($event->page, $event->image->id, $event->image->rating); } } + + if(is_a($event, 'SetupBuildingEvent')) { + $privs = array(); + $privs['Safe Only'] = 's'; + $privs['Safe and Questionable'] = 'sq'; + $privs['All'] = 'sqe'; + + $sb = new SetupBlock("Image Ratings"); + $sb->add_choice_option("ext_rating_anon_privs", $privs, "Anonymous: "); + $sb->add_choice_option("ext_rating_user_privs", $privs, "
Logged in: "); + $event->panel->add_block($sb); + } } private function install() {