git-svn-id: file:///home/shish/svn/shimmie2/trunk@516 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-10-02 23:20:23 +00:00
parent b8fbd4671d
commit 7dda59a4d9

View file

@ -18,6 +18,10 @@ class Ratings extends Extension {
if($config->get_int("ext_ratings_version") < 2) { if($config->get_int("ext_ratings_version") < 2) {
$this->install(); $this->install();
} }
global $config;
$config->set_default_string("ext_rating_anon_privs", 'sq');
$config->set_default_string("ext_rating_user_privs", 'sq');
} }
# TODO: ImageEditorBuildingEvent # TODO: ImageEditorBuildingEvent
@ -35,6 +39,18 @@ class Ratings extends Extension {
$this->theme->display_rater($event->page, $event->image->id, $event->image->rating); $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, "<br>Logged in: ");
$event->panel->add_block($sb);
}
} }
private function install() { private function install() {