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


PHP Requirements::set_write_js_to_body方法代码示例

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


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

示例1: FieldHolder

 public function FieldHolder($attributes = array())
 {
     //$tags_json = json_encode($this->Category->AllowedTags()->column('Tag'));
     $tag_array = array();
     foreach ($this->Category->AllowedTags() as $tag) {
         if (!isset($tag_array[$tag->Group])) {
             $tag_array[$tag->Group] = array();
         }
         $tag_array[$tag->Group][] = $tag->Tag;
     }
     $tags_json = json_encode($tag_array);
     Requirements::customScript("var category_tags = {$tags_json};");
     Requirements::javascript('themes/openstack/bower_assets/jquery-validate/dist/jquery.validate.min.js');
     Requirements::set_write_js_to_body(false);
     return parent::FieldHolder($attributes);
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:16,代码来源:TagManagerField.php

示例2: fifth

 public function fifth()
 {
     $this->Title = 'The OpenStack Fifth Anniversary';
     $this->FBImage = 'http://www.openstack.org/themes/openstack/images/anniversary/5/img/bot-facebook.jpg';
     $this->FBImageW = '200';
     $this->FBImageH = '284';
     $this->FBDesc = 'Happy 5th OpenStack! Come celebrate at one of 40 global events.';
     $this->FBUrl = Director::protocolAndHost() . $this->Link('fifth');
     $this->CurrentDomain = Director::protocolAndHost();
     Requirements::set_write_js_to_body(false);
     Requirements::combine_files('5.css', array());
     Requirements::css($this->ThemeDir() . '/images/anniversary/5/css/bootstrap.css');
     Requirements::css($this->ThemeDir() . '/images/anniversary/5/css/styles.css');
     Requirements::combine_files('5.js', array($this->ThemeDir() . '/images/anniversary/5/js/jquery.js', $this->ThemeDir() . '/images/anniversary/5/js/scripts.js', $this->ThemeDir() . '/images/anniversary/5/js/jquery.easing.min.js'));
     return $this->getViewer('fifth')->process($this, array('ImgPath' => '/themes/openstack/images/anniversary/5/img', 'BadgeImgUrl' => 'http://841038e5aa7ad2e38487-650bfe6158d7143a3437ef4c83572bc4.r48.cf1.rackcdn.com/5/openstack-5th-anniversary.png', 'SlideDeckUrl' => '//www.dropbox.com/s/8bvbo2dzp9jd61o/OpenStack%205th%20Birthday%20slide%20deck.pptx?dl=0', 'LocalEventUrl' => '//www.openstack.org/blog/2015/06/openstack-turns-5-its-time-to-celebrate-the-community/', 'SummitUrl' => '//www.openstack.org/summit/tokyo-2015/', 'FBSharerUrl' => 'http://www.openstack.org/birthday/fifth', 'FBSharerImg' => 'http://www.openstack.org/themes/openstack/images/anniversary/5/img/bot-facebook.jpg'));
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:16,代码来源:AnniversaryPage.php

示例3: init

 public function init()
 {
     parent::init();
     i18n::set_locale('de_DE');
     setlocale(LC_ALL, 'de_DE@euro', 'de_DE.UTF-8', 'de_DE', 'de', 'ge');
     i18n::set_date_format('dd.MM.YYYY');
     i18n::set_time_format('HH:mm');
     Requirements::set_write_js_to_body(false);
     Requirements::javascript("framework/thirdparty/jquery/jquery.js");
     Requirements::javascript("calendar/3rdparty/jquery-ui-1.9.2.custom.js");
     Requirements::javascript("calendar/3rdparty/fullcalendar/fullcalendar.js");
     Requirements::javascript("calendar/3rdparty/jQuery-Loading/toggleLoading.jquery.js");
     Requirements::javascript("calendar/javascript/widget.js");
     Requirements::css("framework/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css");
     Requirements::css("calendar/3rdparty/fullcalendar/fullcalendar.css");
     Requirements::css("calendar/css/calendar.css");
 }
开发者ID:robomod,项目名称:silverstripe-calendar,代码行数:17,代码来源:CalendarPage.php

示例4: init

 /**
  * Inlcudes the CSS and Javascript files required by the cwsoft-foldergallery module
  *
  * @return void
  */
 function init()
 {
     parent::init();
     // include i18n Javascript library and lang files
     // it doesn't work without the meta-tag (see http://open.silverstripe.org/ticket/7949)
     Requirements::insertHeadTags('<meta http-equiv="Content-language" content="' . i18n::get_locale() . '" />');
     Requirements::javascript(FRAMEWORK_DIR . "/javascript/i18n.js");
     Requirements::add_i18n_javascript('cwsoft-foldergallery/javascript/lang');
     // load cwsoft-foldergallery Javascript files into head
     Requirements::set_write_js_to_body(false);
     // include required cwsoft-foldergallery CSS and Javascript files
     Requirements::css('cwsoft-foldergallery/thirdparty/colorbox/colorbox.css');
     Requirements::css('cwsoft-foldergallery/css/cwsoft-foldergallery.css');
     Requirements::javascript('cwsoft-foldergallery/thirdparty/jquery/jquery.min.js');
     Requirements::javascript('cwsoft-foldergallery/thirdparty/colorbox/jquery.colorbox-min.js');
     Requirements::javascript('cwsoft-foldergallery/javascript/cwsoft-foldergallery.js');
 }
开发者ID:helpfulrobot,项目名称:cwsoft-silverstripe-foldergallery,代码行数:22,代码来源:cwsFolderGalleryPage.php

示例5: basename

 * 
 * @platform    CMS SilverStripe 3
 * @package     cwsoft-shortcode
 * @version     2.2.4
 * @author      cwsoft (http://cwsoft.de)
 * @copyright   cwsoft
 * @license     http://www.gnu.org/licenses/gpl-3.0.html
*/
// ensure module is stored in folder "cwsoft-shortcode"
$moduleName = 'cwsoft-shortcode';
$folderName = basename(dirname(__FILE__));
if ($folderName != $moduleName) {
    user_error(_t('_config.WRONG_MODULE_FOLDER', 'Please rename the folder "{folderName}" into "{moduleName}" to get the {moduleName} module working properly.', array('moduleName' => $moduleName, 'folderName' => $folderName)), E_USER_ERROR);
}
// include external files into head section
Requirements::set_write_js_to_body(false);
// register short code tags accessible from pages of type cwsCodePage
ShortcodeParser::get()->register('cwsHideMailto', array('cwsShortCodeHideMailto', 'cwsShortCodeHideMailtoHandler'));
ShortcodeParser::get()->register('cwsRandomImage', array('cwsShortCodeRandomImage', 'cwsShortCodeRandomImageHandler'));
ShortcodeParser::get()->register('cwsRandomQuote', array('cwsShortCodeRandomQuote', 'cwsShortCodeRandomQuoteHandler'));
// increase quality of created thumbnails
if (class_exists('GDBackend')) {
    // SilverStripe >= 3.1.0
    GDBackend::set_default_quality(95);
} else {
    // SilverStripe 3.0.x
    GD::set_default_quality(95);
}
// Note: If you see unparsed placeholders like "{#shortcode.dlg_description}" when using the TinyMCE cwsoft-shortcode plugin,
// you need to add a plugin language file for your locale to the folder "./plugins/shortcode/langs". Supported locales: EN, DE.
HtmlEditorConfig::get('cms')->enablePlugins(array('shortcode' => '../../../cwsoft-shortcode/plugins/shortcode/editor_plugin_src.js'));
开发者ID:helpfulrobot,项目名称:cwsoft-silverstripe-shortcode,代码行数:31,代码来源:_config.php

示例6: define

}
if (!defined('DOCUMENT_ROOT_PATH')) {
    define('DOCUMENT_ROOT_PATH', $_SERVER['DOCUMENT_ROOT']);
}
if (!defined('SS_SITE_DATABASE_NAME')) {
    define('SS_SITE_DATABASE_NAME', $databaseConfig['database']);
}
//jpeg quality
Config::inst()->update('GDBackend', 'default_quality', 80);
// block the default page build
SiteTree::set_create_default_pages(false);
Config::inst()->update('SiteTree', 'create_default_pages', false);
// --------------------------------- //
// Assets
// --------------------------------- //
Requirements::set_write_js_to_body(true);
Requirements::set_combined_files_enabled(true);
// HTML5 Shims
// -----------
$shimRequirements = array('thirdparty/selectivizr/index.js', 'thirdparty/respond/dest/respond.min.js', 'thirdparty/modernizr/modernizr.js');
Requirements::combine_files('lte-ie8-shims.js', $shimRequirements);
Requirements::process_combined_files();
// forces ss to generate the file regardless of blocking
// CSS
// ---
$cssRequirements = array('themes/project/css/main.css', 'themes/project/css/typography.css');
Requirements::combine_files('application.css', $cssRequirements);
// Primary JS
// ----------
$jsRequirements = array('thirdparty/jquery/dist/jquery.min.js', 'project/javascript/main.js', 'project/javascript/forms.js');
Requirements::combine_files('application.js', $jsRequirements);
开发者ID:JamesWatling,项目名称:bonethug,代码行数:31,代码来源:_config.php

示例7: loadJSRequirements

 /**
  * On before init.
  * 
  * @return void
  *
  * @author Sebastian Diel <sdiel@pixeltricks.de>
  * @since 22.10.2014
  */
 public function loadJSRequirements()
 {
     if (SilvercartTools::isIsolatedEnvironment()) {
         return;
     }
     Requirements::set_write_js_to_body(true);
     Requirements::javascript('https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js');
     Requirements::javascript('https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js');
     $jsFiles = array('customhtmlform/script/jquery.pixeltricks.forms.checkFormData.js', 'customhtmlform/script/jquery.pixeltricks.forms.events.js', 'customhtmlform/script/jquery.pixeltricks.forms.validator.js', 'silvercart/javascript/jquery.pixeltricks.tools.js', 'silvercart/javascript/jquery.cookie.js', 'silvercart/javascript/bootstrap.min.js', 'silvercart/javascript/jquery.flexslider-min.js', 'silvercart/javascript/jquery.cycle2.min.js', 'silvercart/javascript/jquery.cycle2.carousel.min.js', 'silvercart/javascript/jquery.cycle2.swipe.min.js', 'silvercart/javascript/jquery.tweet.js', 'silvercart/javascript/fancybox/jquery.fancybox.js', 'silvercart/javascript/custom.js', 'silvercart/javascript/silvercart.js');
     if (SilvercartWidget::$use_anything_slider) {
         $jsFiles = array_merge($jsFiles, array('silvercart/javascript/anythingslider/js/jquery.anythingslider.min.js', 'silvercart/javascript/anythingslider/js/jquery.anythingslider.fx.min.js', 'silvercart/javascript/anythingslider/js/jquery.easing.1.2.js'));
     }
     $this->extend('updatedJSRequirements', $jsFiles);
     Requirements::combine_files('m.js.js', $jsFiles);
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:23,代码来源:SilvercartPage.php


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