当前位置: 首页>>代码示例>>PHP>>正文


PHP SetupBlock::add_label方法代码示例

本文整理汇总了PHP中SetupBlock::add_label方法的典型用法代码示例。如果您正苦于以下问题:PHP SetupBlock::add_label方法的具体用法?PHP SetupBlock::add_label怎么用?PHP SetupBlock::add_label使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SetupBlock的用法示例。


在下文中一共展示了SetupBlock::add_label方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Sitemap");
     $sb->add_bool_option("sitemap_generatefull", "Generate full sitemap");
     $sb->add_label("<br>(Enabled: every image and tag in sitemap, generation takes longer)");
     $sb->add_label("<br>(Disabled: only display the last 50 uploads in the sitemap)");
     $event->panel->add_block($sb);
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:8,代码来源:main.php

示例2: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Image Rotate");
     $sb->add_bool_option("rotate_enabled", "Allow rotating images: ");
     $sb->add_label("<br>Default Orientation: ");
     $sb->add_int_option("rotate_default_deg");
     $sb->add_label(" deg");
     $event->panel->add_block($sb);
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:9,代码来源:main.php

示例3: receive_event

 public function receive_event(Event $event)
 {
     global $config, $database, $page, $user;
     if (is_null($this->theme)) {
         $this->theme = get_theme_object($this);
     }
     if ($event instanceof InitExtEvent) {
         $config->set_default_int("history_limit", -1);
         // shimmie is being installed so call install to create the table.
         if ($config->get_int("ext_tag_history_version") < 3) {
             $this->install();
         }
     }
     if ($event instanceof PageRequestEvent && $event->page_matches("tag_history")) {
         if ($event->get_arg(0) == "revert") {
             // this is a request to revert to a previous version of the tags
             if ($config->get_bool("tag_edit_anon") || !$user->is_anonymous()) {
                 $this->process_revert_request($_POST['revert']);
             }
         } else {
             if ($event->count_args() == 1) {
                 // must be an attempt to view a tag history
                 $image_id = int_escape($event->get_arg(0));
                 $this->theme->display_history_page($page, $image_id, $this->get_tag_history_from_id($image_id));
             } else {
                 $this->theme->display_global_page($page, $this->get_global_tag_history());
             }
         }
     }
     if ($event instanceof DisplayingImageEvent) {
         // handle displaying a link on the view page
         $this->theme->display_history_link($page, $event->image->id);
     }
     if ($event instanceof ImageDeletionEvent) {
         // handle removing of history when an image is deleted
         $this->delete_all_tag_history($event->image->id);
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Tag History");
         $sb->add_label("Limit to ");
         $sb->add_int_option("history_limit");
         $sb->add_label(" entires per image");
         $sb->add_label("<br>(-1 for unlimited)");
         $event->panel->add_block($sb);
     }
     if ($event instanceof TagSetEvent) {
         $this->add_tag_history($event->image, $event->tags);
     }
     if ($event instanceof UserBlockBuildingEvent) {
         if ($user->is_admin()) {
             $event->add_link("Tag Changes", make_link("tag_history"));
         }
     }
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:54,代码来源:main.php

示例4: onSetupBuilding

 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("Image Resize");
     $sb->add_bool_option("resize_enabled", "Allow resizing images: ");
     $sb->add_label("<br>Preset/Default Width: ");
     $sb->add_int_option("resize_default_width");
     $sb->add_label(" px");
     $sb->add_label("<br>Preset/Default Height: ");
     $sb->add_int_option("resize_default_height");
     $sb->add_label(" px");
     $sb->add_label("<br>(enter 0 for no default)");
     $event->panel->add_block($sb);
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:13,代码来源:main.php

示例5: receive_event

 public function receive_event(Event $event)
 {
     global $config, $database, $page, $user;
     //if(is_null($this->theme)) $this->theme = get_theme_object($this);
     if ($event instanceof ImageInfoBoxBuildingEvent) {
         if (!$config->get_bool("tageditcloud_disable")) {
             if ($this->can_tag($event->image)) {
                 if (!($cfg_minusage = $config->get_int("tageditcloud_minusage"))) {
                     $cfg_minusage = 2;
                 }
                 if (!($cfg_defcount = $config->get_int("tageditcloud_defcount"))) {
                     $cfg_defcount = 40;
                 }
                 if (!($cfg_maxcount = $config->get_int("tageditcloud_maxcount"))) {
                     $cfg_maxcount = 4096;
                 }
                 if ($config->get_string("tageditcloud_sort") != "p") {
                     $event->add_part($this->build_tag_map($event->image, $cfg_minusage, false), 40);
                 } else {
                     $event->add_part($this->build_tag_map($event->image, $cfg_defcount, $cfg_maxcount), 40);
                 }
             }
         }
     }
     if ($event instanceof InitExtEvent) {
         $config->set_default_bool("tageditcloud_disable", false);
         $config->set_default_bool("tageditcloud_usedfirst", true);
         $config->set_default_string("tageditcloud_sort", 'a');
         $config->set_default_int("tageditcloud_minusage", 2);
         $config->set_default_int("tageditcloud_defcount", 40);
         $config->set_default_int("tageditcloud_maxcount", 4096);
     }
     if ($event instanceof SetupBuildingEvent) {
         $sort_by = array('Alphabetical' => 'a', 'Popularity' => 'p');
         $sb = new SetupBlock("Tag Edit Cloud");
         $sb->add_bool_option("tageditcloud_disable", "Disable Tag Selection Cloud: ");
         $sb->add_choice_option("tageditcloud_sort", $sort_by, "<br>Sort the tags by:");
         $sb->add_bool_option("tageditcloud_usedfirst", "<br>Always show used tags first: ");
         $sb->add_label("<br><b>Alpha sort</b>:<br>Only show tags used at least ");
         $sb->add_int_option("tageditcloud_minusage");
         $sb->add_label(" times.<br><b>Popularity sort</b>:<br>Show ");
         $sb->add_int_option("tageditcloud_defcount");
         $sb->add_label(" tags by default.<br>Show a maximum of ");
         $sb->add_int_option("tageditcloud_maxcount");
         $sb->add_label(" tags.");
         $event->panel->add_block($sb);
     }
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:48,代码来源:main.php

示例6: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Banned Phrases");
     $sb->add_label("One per line, lines that start with slashes are treated as regex<br/>");
     $sb->add_longtext_option("banned_words");
     $event->panel->add_block($sb);
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:7,代码来源:main.php

示例7: onSetupBuilding

 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("Archive Handler Options");
     $sb->add_text_option("archive_tmp_dir", "Temporary folder: ");
     $sb->add_text_option("archive_extract_command", "<br>Extraction command: ");
     $sb->add_label("<br>%f for archive, %d for temporary directory");
     $event->panel->add_block($sb);
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:8,代码来源:main.php

示例8: receive_event

 public function receive_event(Event $event)
 {
     if (is_null($this->theme)) {
         $this->theme = get_theme_object($this);
     }
     if ($event instanceof DisplayingImageEvent) {
         global $page, $config, $user;
         if ($config->get_bool("tag_edit_anon") || $user->id != $config->get_int("anon_id") && $config->get_bool("ext_tagger_enabled")) {
             $this->theme->build_tagger($page, $event);
         }
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Tagger");
         $sb->add_bool_option("ext_tagger_enabled", "Enable Tagger");
         $sb->add_int_option("ext_tagger_search_delay", "<br/>Delay queries by ");
         $sb->add_label(" milliseconds.");
         $sb->add_label("<br/>Limit queries returning more than ");
         $sb->add_int_option("ext_tagger_tag_max");
         $sb->add_label(" tags to ");
         $sb->add_int_option("ext_tagger_limit");
         $event->panel->add_block($sb);
     }
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:23,代码来源:main.php

示例9: onSetupBuilding

 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("Comment Options");
     $sb->add_bool_option("comment_anon", "Allow anonymous comments: ");
     $sb->add_bool_option("comment_captcha", "<br>Require CAPTCHA for anonymous comments: ");
     $sb->add_label("<br>Limit to ");
     $sb->add_int_option("comment_limit");
     $sb->add_label(" comments per ");
     $sb->add_int_option("comment_window");
     $sb->add_label(" minutes");
     $sb->add_label("<br>Show ");
     $sb->add_int_option("comment_count");
     $sb->add_label(" recent comments on the index");
     $sb->add_label("<br>Show ");
     $sb->add_int_option("comment_list_count");
     $sb->add_label(" comments per image on the list");
     $event->panel->add_block($sb);
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:18,代码来源:main.php

示例10: onSetupBuilding

 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("Index Options");
     $sb->position = 20;
     $sb->add_label("Index table size ");
     $sb->add_int_option("index_width");
     $sb->add_label(" x ");
     $sb->add_int_option("index_height");
     $sb->add_label(" images");
     $event->panel->add_block($sb);
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:11,代码来源:main.php

示例11: receive_event

 public function receive_event(Event $event)
 {
     global $config, $database, $page, $user;
     if ($this->theme == null) {
         $this->theme = get_theme_object($this);
     }
     if ($event instanceof InitExtEvent) {
         $config->set_default_int("tag_list_length", 15);
         $config->set_default_int("popular_tag_list_length", 15);
         $config->set_default_int("tags_min", 3);
         $config->set_default_string("info_link", 'http://en.wikipedia.org/wiki/$tag');
         $config->set_default_string("tag_list_image_type", 'related');
         $config->set_default_bool("tag_list_pages", false);
     }
     if ($event instanceof PageRequestEvent && $event->page_matches("tags")) {
         $this->theme->set_navigation($this->build_navigation());
         switch ($event->get_arg(0)) {
             default:
             case 'map':
                 $this->theme->set_heading("Tag Map");
                 $this->theme->set_tag_list($this->build_tag_map());
                 break;
             case 'alphabetic':
                 $this->theme->set_heading("Alphabetic Tag List");
                 $this->theme->set_tag_list($this->build_tag_alphabetic());
                 break;
             case 'popularity':
                 $this->theme->set_heading("Tag List by Popularity");
                 $this->theme->set_tag_list($this->build_tag_popularity());
                 break;
             case 'categories':
                 $this->theme->set_heading("Popular Categories");
                 $this->theme->set_tag_list($this->build_tag_categories());
                 break;
         }
         $this->theme->display_page($page);
     }
     if ($event instanceof PageRequestEvent && $event->page_matches("api/internal/tag_list/complete")) {
         $all = $database->get_all("SELECT tag FROM tags WHERE tag LIKE :search AND count > 0 LIMIT 10", array("search" => $_GET["s"] . "%"));
         $res = array();
         foreach ($all as $row) {
             $res[] = $row["tag"];
         }
         $page->set_mode("data");
         $page->set_type("text/plain");
         $page->set_data(implode("\n", $res));
     }
     if ($event instanceof PostListBuildingEvent) {
         if ($config->get_int('tag_list_length') > 0) {
             if (!empty($event->search_terms)) {
                 $this->add_refine_block($page, $event->search_terms);
             } else {
                 $this->add_popular_block($page);
             }
         }
     }
     if ($event instanceof DisplayingImageEvent) {
         if ($config->get_int('tag_list_length') > 0) {
             if ($config->get_string('tag_list_image_type') == 'related') {
                 $this->add_related_block($page, $event->image);
             } else {
                 $this->add_tags_block($page, $event->image);
             }
         }
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Tag Map Options");
         $sb->add_int_option("tags_min", "Only show tags used at least ");
         $sb->add_label(" times");
         $sb->add_bool_option("tag_list_pages", "<br>Paged tag lists: ");
         $event->panel->add_block($sb);
         $sb = new SetupBlock("Popular / Related Tag List");
         $sb->add_int_option("tag_list_length", "Show top ");
         $sb->add_label(" related tags");
         $sb->add_int_option("popular_tag_list_length", "<br>Show top ");
         $sb->add_label(" popular tags");
         $sb->add_text_option("info_link", "<br>Tag info link: ");
         $sb->add_choice_option("tag_list_image_type", array("Image's tags only" => "tags", "Show related" => "related"), "<br>Image tag list: ");
         $sb->add_bool_option("tag_list_numbers", "<br>Show tag counts: ");
         $event->panel->add_block($sb);
     }
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:82,代码来源:main.php

示例12: onSetupBuilding

 public function onSetupBuilding(Event $event)
 {
     global $config;
     $hosts = array("None" => "none", "Gravatar" => "gravatar");
     $sb = new SetupBlock("User Options");
     $sb->add_bool_option("login_signup_enabled", "Allow new signups: ");
     $sb->add_longtext_option("login_tac", "<br>Terms &amp; Conditions:<br>");
     $sb->add_choice_option("avatar_host", $hosts, "<br>Avatars: ");
     if ($config->get_string("avatar_host") == "gravatar") {
         $sb->add_label("<br>&nbsp;<br><b>Gravatar Options</b>");
         $sb->add_choice_option("avatar_gravatar_type", array('Default' => 'default', 'Wavatar' => 'wavatar', 'Monster ID' => 'monsterid', 'Identicon' => 'identicon'), "<br>Type: ");
         $sb->add_choice_option("avatar_gravatar_rating", array('G' => 'g', 'PG' => 'pg', 'R' => 'r', 'X' => 'x'), "<br>Rating: ");
     }
     $event->panel->add_block($sb);
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:15,代码来源:main.php


注:本文中的SetupBlock::add_label方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。