options
git-svn-id: file:///home/shish/svn/shimmie2/trunk@516 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
b8fbd4671d
commit
7dda59a4d9
1 changed files with 16 additions and 0 deletions
|
@ -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, "<br>Logged in: ");
|
||||
$event->panel->add_block($sb);
|
||||
}
|
||||
}
|
||||
|
||||
private function install() {
|
||||
|
|
Reference in a new issue