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


PHP SetupBlock::add_int_option方法代码示例

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


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

示例1: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Forum");
     $sb->add_int_option("forumTitleSubString", "Title max long: ");
     $sb->add_int_option("forumThreadsPerPage", "<br>Threads per page: ");
     $sb->add_int_option("forumPostsPerPage", "<br>Posts per page: ");
     $sb->add_int_option("forumMaxCharsPerPost", "<br>Max chars per post: ");
     $event->panel->add_block($sb);
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:9,代码来源:main.php

示例2: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Pools");
     $sb->add_int_option("poolsMaxImportResults", "Max results on import: ");
     $sb->add_int_option("poolsImagesPerPage", "<br>Images per page: ");
     $sb->add_int_option("poolsListsPerPage", "<br>Index list items per page: ");
     $sb->add_int_option("poolsUpdatedPerPage", "<br>Updated list items per page: ");
     $sb->add_bool_option("poolsInfoOnViewImage", "<br>Show pool info on image: ");
     //$sb->add_bool_option("poolsAdderOnViewImage", "<br>Show pool adder on image: ");
     $event->panel->add_block($sb);
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:11,代码来源:main.php

示例3: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Tagger");
     $sb->add_int_option("ext_tagger_search_delay", "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:thelectronicnub,项目名称:shimmie2,代码行数:11,代码来源:main.php

示例4: 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

示例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 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

示例6: 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

示例7: onSetupBuilding

 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("Image Options");
     $sb->position = 30;
     // advanced only
     //$sb->add_text_option("image_ilink", "Image link: ");
     //$sb->add_text_option("image_tlink", "<br>Thumbnail link: ");
     $sb->add_text_option("image_tip", "Image tooltip: ");
     $sb->add_choice_option("upload_collision_handler", array('Error' => 'error', 'Merge' => 'merge'), "<br>Upload collision handler: ");
     if (!in_array("OS", $_SERVER) || $_SERVER["OS"] != 'Windows_NT') {
         $sb->add_bool_option("image_show_meta", "<br>Show metadata: ");
     }
     $event->panel->add_block($sb);
     $thumbers = array();
     $thumbers['Built-in GD'] = "gd";
     $thumbers['ImageMagick'] = "convert";
     $sb = new SetupBlock("Thumbnailing");
     $sb->add_choice_option("thumb_engine", $thumbers, "Engine: ");
     $sb->add_label("<br>Size ");
     $sb->add_int_option("thumb_width");
     $sb->add_label(" x ");
     $sb->add_int_option("thumb_height");
     $sb->add_label(" px at ");
     $sb->add_int_option("thumb_quality");
     $sb->add_label(" % quality ");
     $sb->add_shorthand_int_option("thumb_mem_limit", "<br>Max memory use: ");
     $event->panel->add_block($sb);
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:28,代码来源:main.php

示例8: 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

示例9: receive_event

 public function receive_event(Event $event)
 {
     global $config, $database, $page, $user;
     if (is_null($this->theme)) {
         $this->theme = get_theme_object($this);
     }
     $is_full = disk_free_space(realpath("./images/")) < 100 * 1024 * 1024;
     if ($event instanceof InitExtEvent) {
         global $config;
         $config->set_default_int('upload_count', 3);
         $config->set_default_int('upload_size', '1MB');
         $config->set_default_bool('upload_anon', false);
     }
     if ($event instanceof PostListBuildingEvent) {
         global $user;
         if ($this->can_upload($user)) {
             if ($is_full) {
                 $this->theme->display_full($page);
             } else {
                 $this->theme->display_block($page);
             }
         }
     }
     if ($event instanceof PageRequestEvent && $event->page_matches("upload")) {
         if (count($_FILES) + count($_POST) > 0) {
             $tags = Tag::explode($_POST['tags']);
             $source = isset($_POST['source']) ? $_POST['source'] : null;
             if ($this->can_upload($user)) {
                 $ok = true;
                 foreach ($_FILES as $file) {
                     $ok = $ok & $this->try_upload($file, $tags, $source);
                 }
                 foreach ($_POST as $name => $value) {
                     if (substr($name, 0, 3) == "url" && strlen($value) > 0) {
                         $ok = $ok & $this->try_transload($value, $tags, $source);
                     }
                 }
                 $this->theme->display_upload_status($page, $ok);
             } else {
                 $this->theme->display_permission_denied($page);
             }
         } else {
             if (!empty($_GET['url'])) {
                 global $user;
                 if ($this->can_upload($user)) {
                     $url = $_GET['url'];
                     $tags = array('tagme');
                     if (!empty($_GET['tags']) && $_GET['tags'] != "null") {
                         $tags = Tag::explode($_GET['tags']);
                     }
                     $ok = $this->try_transload($url, $tags, $url);
                     $this->theme->display_upload_status($page, $ok);
                 } else {
                     $this->theme->display_permission_denied($page);
                 }
             } else {
                 if (!$is_full) {
                     $this->theme->display_page($page);
                 }
             }
         }
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Upload");
         $sb->position = 10;
         $sb->add_int_option("upload_count", "Max uploads: ");
         $sb->add_shorthand_int_option("upload_size", "<br>Max size per file: ");
         $sb->add_bool_option("upload_anon", "<br>Allow anonymous uploads: ");
         $sb->add_choice_option("transload_engine", array("Disabled" => "none", "cURL" => "curl", "fopen" => "fopen", "WGet" => "wget"), "<br>Transload: ");
         $event->panel->add_block($sb);
     }
     if ($event instanceof DataUploadEvent) {
         global $config;
         if ($is_full) {
             throw new UploadException("Upload failed; disk nearly full");
         }
         if (filesize($event->tmpname) > $config->get_int('upload_size')) {
             $size = to_shorthand_int(filesize($event->tmpname));
             $limit = to_shorthand_int($config->get_int('upload_size'));
             throw new UploadException("File too large ({$size} &gt; {$limit})");
         }
     }
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:83,代码来源:main.php

示例10: 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

示例11: onSetupBuilding

 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("Image Options");
     $sb->position = 30;
     // advanced only
     //$sb->add_text_option("image_ilink", "Image link: ");
     //$sb->add_text_option("image_tlink", "<br>Thumbnail link: ");
     $sb->add_text_option("image_tip", "Image tooltip: ");
     $sb->add_choice_option("upload_collision_handler", array('Error' => 'error', 'Merge' => 'merge'), "<br>Upload collision handler: ");
     if (!in_array("OS", $_SERVER) || $_SERVER["OS"] != 'Windows_NT') {
         $sb->add_bool_option("image_show_meta", "<br>Show metadata: ");
     }
     $sb->add_bool_option("image_jquery_confirm", "<br>Confirm Delete with jQuery: ");
     $expires = array();
     $expires['1 Minute'] = 60;
     $expires['1 Hour'] = 3600;
     $expires['1 Day'] = 86400;
     $expires['1 Month (31 days)'] = 2678400;
     //(60*60*24*31)
     $expires['1 Year'] = 31536000;
     // 365 days (60*60*24*365)
     $expires['Never'] = 3153600000.0;
     // 100 years..
     $sb->add_choice_option("image_expires", $expires, "<br>Image Expiration: ");
     $event->panel->add_block($sb);
     $thumbers = array();
     $thumbers['Built-in GD'] = "gd";
     $thumbers['ImageMagick'] = "convert";
     $sb = new SetupBlock("Thumbnailing");
     $sb->add_choice_option("thumb_engine", $thumbers, "Engine: ");
     $sb->add_label("<br>Size ");
     $sb->add_int_option("thumb_width");
     $sb->add_label(" x ");
     $sb->add_int_option("thumb_height");
     $sb->add_label(" px at ");
     $sb->add_int_option("thumb_quality");
     $sb->add_label(" % quality ");
     $sb->add_shorthand_int_option("thumb_mem_limit", "<br>Max memory use: ");
     $event->panel->add_block($sb);
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:40,代码来源:main.php


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