diff --git a/core/ext/image.ext.php b/core/ext/image.ext.php index ed97c2a0..42243077 100644 --- a/core/ext/image.ext.php +++ b/core/ext/image.ext.php @@ -27,8 +27,7 @@ class ImageIO extends Extension { $thumbers['ImageMagick'] = "convert"; $sb = new SetupBlock("Thumbnailing"); - $sb->add_label("Engine: "); - $sb->add_choice_option("thumb_engine", $thumbers); + $sb->add_choice_option("thumb_engine", $thumbers, "Engine: "); $sb->add_label("
Size "); $sb->add_int_option("thumb_width"); @@ -38,9 +37,8 @@ class ImageIO extends Extension { $sb->add_int_option("thumb_quality"); $sb->add_label(" % quality "); - $sb->add_label("
Max GD memory use: "); - $sb->add_shorthand_int_option("thumb_gd_mem_limit"); - + $sb->add_shorthand_int_option("thumb_gd_mem_limit", "
Max GD memory use: "); + $event->panel->add_main_block($sb); } if(is_a($event, 'ConfigSaveEvent')) { diff --git a/core/ext/index.ext.php b/core/ext/index.ext.php index 4571abb9..898823e5 100644 --- a/core/ext/index.ext.php +++ b/core/ext/index.ext.php @@ -62,8 +62,7 @@ class Index extends Extension { $sb->add_int_option("index_height"); $sb->add_label(" images"); - $sb->add_label("
Image tooltip "); - $sb->add_text_option("image_tip"); + $sb->add_text_option("image_tip", "
Image tooltip "); $event->panel->add_main_block($sb, 20); } diff --git a/core/ext/setup.ext.php b/core/ext/setup.ext.php index 42e4d229..3c683102 100644 --- a/core/ext/setup.ext.php +++ b/core/ext/setup.ext.php @@ -36,42 +36,67 @@ class SetupBlock extends Block { public function add_label($text) { $this->body .= $text; } - public function add_text_option($name) { + + public function add_text_option($name, $label=null) { global $config; $val = $config->get_string($name); - $this->body .= "\n"; + if(!is_null($label)) { + $this->body .= ""; + } + $this->body .= "\n"; } - public function add_longtext_option($name) { + + public function add_longtext_option($name, $label=null) { global $config; $val = $config->get_string($name); - $this->body .= "\n"; + if(!is_null($label)) { + $this->body .= ""; + } + $this->body .= "\n"; $this->body .= "\n"; // setup page auto-layout counts
tags } - public function add_bool_option($name) { + + public function add_bool_option($name, $label=null) { global $config; $checked = $config->get_bool($name) ? " checked" : ""; - $this->body .= "\n"; + if(!is_null($label)) { + $this->body .= ""; + } + $this->body .= "\n"; } - public function add_hidden_option($name) { + + public function add_hidden_option($name, $label=null) { global $config; $val = $config->get_string($name); - $this->body .= ""; + $this->body .= ""; } - public function add_int_option($name) { + + public function add_int_option($name, $label=null) { global $config; $val = $config->get_string($name); - $this->body .= "\n"; + if(!is_null($label)) { + $this->body .= ""; + } + $this->body .= "\n"; } - public function add_shorthand_int_option($name) { + + public function add_shorthand_int_option($name, $label=null) { global $config; $val = to_shorthand_int($config->get_string($name)); - $this->body .= "\n"; + if(!is_null($label)) { + $this->body .= ""; + } + $this->body .= "\n"; } - public function add_choice_option($name, $options) { + + public function add_choice_option($name, $options, $label=null) { global $config; $current = $config->get_string($name); - $html = ""; foreach($options as $optname => $optval) { if($optval == $current) $selected=" selected"; else $selected=""; @@ -122,20 +147,13 @@ class Setup extends Extension { } $sb = new SetupBlock("General"); - $sb->add_label("Site title: "); - $sb->add_text_option("title"); - $sb->add_label("
Front page: "); - $sb->add_text_option("front_page"); - $sb->add_label("
Base URL: "); - $sb->add_text_option("base_href"); - $sb->add_label("
Data URL: "); - $sb->add_text_option("data_href"); - $sb->add_label("
Contact URL: "); - $sb->add_text_option("contact_link"); - $sb->add_label("
Theme: "); - $sb->add_choice_option("theme", $themes); - // $sb->add_label("
Anonymous ID: "); - // $sb->add_int_option("anon_id", 0, 100000); + $sb->add_text_option("title", "Site title: "); + $sb->add_text_option("front_page", "
Front page: "); + $sb->add_text_option("base_href", "
Base URL: "); + $sb->add_text_option("data_href", "
Data URL: "); + $sb->add_text_option("contact_link", "
Contact URL:"); + $sb->add_choice_option("theme", $themes, "
Theme: "); + // $sb->add_int_option("anon_id", "
Anonymous ID: "); // FIXME: create advanced options page $sb->add_hidden_option("anon_id"); $event->panel->add_main_block($sb, 0); } diff --git a/core/ext/tag_edit.ext.php b/core/ext/tag_edit.ext.php index ac416ea7..22e380ff 100644 --- a/core/ext/tag_edit.ext.php +++ b/core/ext/tag_edit.ext.php @@ -59,8 +59,7 @@ class TagEdit extends Extension { if(is_a($event, 'SetupBuildingEvent')) { $sb = new SetupBlock("Tag Editing"); - $sb->add_label("Allow anonymous editing: "); - $sb->add_bool_option("tag_edit_anon"); + $sb->add_bool_option("tag_edit_anon", "Allow anonymous editing: "); $event->panel->add_main_block($sb); } if(is_a($event, 'ConfigSaveEvent')) { diff --git a/core/ext/upload.ext.php b/core/ext/upload.ext.php index 13e165a9..fe9949c6 100644 --- a/core/ext/upload.ext.php +++ b/core/ext/upload.ext.php @@ -31,12 +31,9 @@ class Upload extends Extension { if(is_a($event, 'SetupBuildingEvent')) { $sb = new SetupBlock("Upload"); - $sb->add_label("Max Uploads: "); - $sb->add_int_option("upload_count"); - $sb->add_label("
Max size per file: "); - $sb->add_shorthand_int_option("upload_size"); - $sb->add_label("
Allow anonymous upoads: "); - $sb->add_bool_option("upload_anon"); + $sb->add_int_option("upload_count", "Max uploads: "); + $sb->add_shorthand_int_option("upload_size", "
Max size per file: "); + $sb->add_bool_option("upload_anon", "
Allow anonymous upoads: "); $event->panel->add_main_block($sb, 10); } if(is_a($event, 'ConfigSaveEvent')) { diff --git a/core/ext/user.ext.php b/core/ext/user.ext.php index d9437a47..63414571 100644 --- a/core/ext/user.ext.php +++ b/core/ext/user.ext.php @@ -56,13 +56,9 @@ class UserPage extends Extension { if(is_a($event, 'SetupBuildingEvent')) { $sb = new SetupBlock("User Options"); - $sb->add_label("Login memory: "); - $sb->add_int_option("login_memory"); - $sb->add_label(" days"); - $sb->add_label("
Allow new signups: "); - $sb->add_bool_option("login_signup_enabled"); - $sb->add_label("
Terms & Conditions:
"); - $sb->add_longtext_option("login_tac"); + $sb->add_int_option("login_memory", "Login memory: "); $sb->add_label(" days"); + $sb->add_bool_option("login_signup_enabled", "
Allow new signups: "); + $sb->add_longtext_option("login_tac", "
Terms & Conditions:
"); $event->panel->add_main_block($sb); } if(is_a($event, 'ConfigSaveEvent')) { diff --git a/core/ext/view.ext.php b/core/ext/view.ext.php index 41358915..d153e5da 100644 --- a/core/ext/view.ext.php +++ b/core/ext/view.ext.php @@ -35,12 +35,9 @@ class ViewImage extends Extension { if(is_a($event, 'SetupBuildingEvent')) { $sb = new SetupBlock("View Options"); - $sb->add_label("Long link "); - $sb->add_text_option("image_ilink"); - $sb->add_label("
Short link "); - $sb->add_text_option("image_slink"); - $sb->add_label("
Thumbnail link "); - $sb->add_text_option("image_tlink"); + $sb->add_text_option("image_ilink", "Long link "); + $sb->add_text_option("image_slink", "
Short link "); + $sb->add_text_option("image_tlink", "
Thumbnail link "); $event->panel->add_main_block($sb, 30); } if(is_a($event, 'ConfigSaveEvent')) { diff --git a/ext/comment/main.php b/ext/comment/main.php index b1fb0771..a0950383 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -103,8 +103,7 @@ class CommentList extends Extension { if(is_a($event, 'SetupBuildingEvent')) { $sb = new SetupBlock("Comment Options"); - $sb->add_label("Allow anonymous comments "); - $sb->add_bool_option("comment_anon"); + $sb->add_bool_option("comment_anon", "Allow anonymous comments: "); $sb->add_label("
Limit to "); $sb->add_int_option("comment_limit"); $sb->add_label(" comments per "); @@ -113,8 +112,7 @@ class CommentList extends Extension { $sb->add_label("
Show "); $sb->add_int_option("comment_count"); $sb->add_label(" recent comments on the index"); - $sb->add_label("
Akismet Key "); - $sb->add_text_option("comment_wordpress_key"); + $sb->add_text_option("comment_wordpress_key", "
Akismet Key "); $event->panel->add_main_block($sb); } if(is_a($event, 'ConfigSaveEvent')) { diff --git a/ext/downtime/main.php b/ext/downtime/main.php index 1b57db5a..13f01a1d 100644 --- a/ext/downtime/main.php +++ b/ext/downtime/main.php @@ -7,10 +7,8 @@ class Downtime extends Extension { if(is_a($event, 'SetupBuildingEvent')) { $sb = new SetupBlock("Downtime"); - $sb->add_label("Disable non-admin access: "); - $sb->add_bool_option("downtime"); - $sb->add_label("
"); - $sb->add_longtext_option("downtime_message"); + $sb->add_bool_option("downtime", "Disable non-admin access: "); + $sb->add_longtext_option("downtime_message", "
"); $event->panel->add_main_block($sb); } if(is_a($event, 'ConfigSaveEvent')) { diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 7a5b7d96..035399da 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -44,19 +44,13 @@ class TagList extends Extension { if(is_a($event, 'SetupBuildingEvent')) { $sb = new SetupBlock("Tag Map Options"); - $sb->add_label("Ignore tags used fewer than "); - $sb->add_int_option("tags_min", 0, 99); - $sb->add_label(" times"); + $sb->add_int_option("tags_min", "Ignore tags used fewer than "); $sb->add_label(" times"); $event->panel->add_main_block($sb); $sb = new SetupBlock("Popular / Related Tag List"); - $sb->add_label("Show top "); - $sb->add_int_option("tag_list_length"); - $sb->add_label(" tags"); - $sb->add_label("
Tag info link: "); - $sb->add_text_option("info_link"); - $sb->add_label("
Show tag counts: "); - $sb->add_bool_option("tag_list_numbers"); + $sb->add_int_option("tag_list_length", "Show top "); $sb->add_label(" tags"); + $sb->add_text_option("info_link", "
Tag info link: "); + $sb->add_bool_option("tag_list_numbers", "
Show tag counts: "); $event->panel->add_main_block($sb); } if(is_a($event, 'ConfigSaveEvent')) { diff --git a/ext/zoom/main.php b/ext/zoom/main.php index a68ba7c0..47b0071e 100644 --- a/ext/zoom/main.php +++ b/ext/zoom/main.php @@ -9,8 +9,7 @@ class Zoom extends Extension { if(is_a($event, 'SetupBuildingEvent')) { $sb = new SetupBlock("Image Zoom"); - $sb->add_label("Zoom by default: "); - $sb->add_bool_option("image_zoom"); + $sb->add_bool_option("image_zoom", "Zoom by default: "); $event->panel->add_main_block($sb); } if(is_a($event, 'ConfigSaveEvent')) {