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


PHP SetupBlock::add_text_option方法代码示例

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


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

示例1: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Site Description");
     $sb->add_text_option("site_description", "Description: ");
     $sb->add_text_option("site_keywords", "<br>Keywords: ");
     $event->panel->add_block($sb);
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:7,代码来源:main.php

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

示例3: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Mailing Options");
     $sb->add_text_option("mail_sub", "Subject prefix: ");
     $sb->add_text_option("mail_img", "<br>Banner Image URL: ");
     $sb->add_text_option("mail_style", "<br>Style URL: ");
     $sb->add_longtext_option("mail_fot", "<br>Footer (Use HTML)");
     $sb->add_label("<br><i>Should measure 550x110px. Use an absolute URL</i>");
     $event->panel->add_block($sb);
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:10,代码来源:main.php

示例4: onSetupBuilding

 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sort_by = array('Alphabetical' => 'a', 'Popularity' => 'p', 'Relevance' => 'r');
     $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/Relevance 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.");
     $sb->add_label("<br><b>Relevance sort</b>:<br>Ignore tags (space separated): ");
     $sb->add_text_option("tageditcloud_ignoretags");
     $event->panel->add_block($sb);
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:18,代码来源: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 DisplayingImageEvent) {
         $this->theme->links_block($page, $this->data($event->image));
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Link to Image");
         $sb->add_text_option("ext_link-img_text-link_format", "Text Link Format: ");
         $event->panel->add_block($sb);
     }
     if ($event instanceof InitExtEvent) {
         //just set default if empty.
         $config->set_default_string("ext_link-img_text-link_format", '$title - $id ($ext $size $filesize)');
     }
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:19,代码来源:main.php

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

示例7: receive_event

 public function receive_event(Event $event)
 {
     if ($event instanceof ImageAdditionEvent) {
         global $config;
         $min_w = $config->get_int("upload_min_width", -1);
         $min_h = $config->get_int("upload_min_height", -1);
         $max_w = $config->get_int("upload_max_width", -1);
         $max_h = $config->get_int("upload_max_height", -1);
         $ratios = explode(" ", $config->get_string("upload_ratios", ""));
         $image = $event->image;
         if ($min_w > 0 && $image->width < $min_w) {
             throw new UploadException("Image too small");
         }
         if ($min_h > 0 && $image->height < $min_h) {
             throw new UploadException("Image too small");
         }
         if ($max_w > 0 && $image->width > $max_w) {
             throw new UploadException("Image too large");
         }
         if ($max_h > 0 && $image->height > $max_h) {
             throw new UploadException("Image too large");
         }
         if (count($ratios) > 0) {
             $ok = false;
             $valids = 0;
             foreach ($ratios as $ratio) {
                 $parts = explode(":", $ratio);
                 if (count($parts) < 2) {
                     continue;
                 }
                 $valids++;
                 $width = $parts[0];
                 $height = $parts[1];
                 if ($image->width / $width == $image->height / $height) {
                     $ok = true;
                     break;
                 }
             }
             if ($valids > 0 && !$ok) {
                 throw new UploadException("Image needs to be in one of these ratios: " . html_escape($config->get_string("upload_ratios", "")));
             }
         }
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Resolution Limits");
         $sb->add_label("Min ");
         $sb->add_int_option("upload_min_width");
         $sb->add_label(" x ");
         $sb->add_int_option("upload_min_height");
         $sb->add_label(" px");
         $sb->add_label("<br>Max ");
         $sb->add_int_option("upload_max_width");
         $sb->add_label(" x ");
         $sb->add_int_option("upload_max_height");
         $sb->add_label(" px");
         $sb->add_label("<br>(-1 for no limit)");
         $sb->add_label("<br>Ratios ");
         $sb->add_text_option("upload_ratios");
         $sb->add_label("<br>(eg. '4:3 16:9', blank for no limit)");
         $event->panel->add_block($sb);
     }
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:62,代码来源: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: 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


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