當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Requirements::customCSS方法代碼示例

本文整理匯總了PHP中Requirements::customCSS方法的典型用法代碼示例。如果您正苦於以下問題:PHP Requirements::customCSS方法的具體用法?PHP Requirements::customCSS怎麽用?PHP Requirements::customCSS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Requirements的用法示例。


在下文中一共展示了Requirements::customCSS方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 public function init()
 {
     // set reading lang
     if (SiteTree::has_extension('Translatable') && !$this->getRequest()->isAjax()) {
         Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
     }
     parent::init();
     Versioned::reading_stage("Stage");
     Requirements::css(CMS_DIR . '/css/screen.css');
     Requirements::customCSS($this->generatePageIconsCss());
     Requirements::combine_files('cmsmain.js', array_merge(array(CMS_DIR . '/javascript/CMSMain.js', CMS_DIR . '/javascript/CMSMain.EditForm.js', CMS_DIR . '/javascript/CMSMain.AddForm.js', CMS_DIR . '/javascript/CMSPageHistoryController.js', CMS_DIR . '/javascript/CMSMain.Tree.js', CMS_DIR . '/javascript/SilverStripeNavigator.js', CMS_DIR . '/javascript/SiteTreeURLSegmentField.js'), Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true)));
     CMSBatchActionHandler::register('publish', 'CMSBatchAction_Publish');
     CMSBatchActionHandler::register('unpublish', 'CMSBatchAction_Unpublish');
     // Check legacy actions
     $legacy = $this->config()->enabled_legacy_actions;
     // Delete from live is unnecessary since we have unpublish which does the same thing
     if (in_array('CMSBatchAction_DeleteFromLive', $legacy)) {
         Deprecation::notice('4.0', 'Delete From Live is deprecated. Use Un-publish instead');
         CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
     }
     // Delete action
     if (in_array('CMSBatchAction_Delete', $legacy)) {
         Deprecation::notice('4.0', 'Delete from Stage is deprecated. Use Archive instead.');
         CMSBatchActionHandler::register('delete', 'CMSBatchAction_Delete');
     } else {
         CMSBatchActionHandler::register('archive', 'CMSBatchAction_Archive');
         CMSBatchActionHandler::register('restore', 'CMSBatchAction_Restore');
     }
 }
開發者ID:phuongle2611,項目名稱:silverstripe-cms,代碼行數:29,代碼來源:CMSMain.php

示例2: initialize

 /**
  * Initializes the honey pot. Loads CSS, and adds the field
  *
  * @param ContactForm
  * @return HoneyPotSpamProtector
  */
 public function initialize(ContactForm $proxy)
 {
     Requirements::customCSS("\n\t\t\t#{$this->name} {position:absolute;left:-9999em;}\n\t\t");
     $proxy->addField(TextField::create($this->name, null)->setAttribute('tabindex', '-1'));
     $proxy->addOmittedField($this->name);
     return $this;
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-contact-form,代碼行數:13,代碼來源:HoneyPotSpamProtector.php

示例3: index

 public function index()
 {
     Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
     Requirements::customCSS('#OrphanIDs .middleColumn {width: auto;}');
     Requirements::customCSS('#OrphanIDs label {display: inline;}');
     return $this->renderWith('BlankPage');
 }
開發者ID:jakedaleweb,項目名稱:AtomCodeChallenge,代碼行數:7,代碼來源:RemoveOrphanedPagesTask.php

示例4: Field

    public function Field($properties = array())
    {
        Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.min.js');
        Requirements::javascript('geoform/javascript/jquery.geocomplete.js');
        if (GoogleMaps::getApiKey()) {
            Requirements::javascript('//maps.googleapis.com/maps/api/js?sensor=false&libraries=places&language=' . i18n::get_tinymce_lang() . '&key=' . GoogleMaps::getApiKey());
        } else {
            Requirements::javascript('//maps.googleapis.com/maps/api/js?sensor=false&libraries=places&language=' . i18n::get_tinymce_lang());
        }
        $name = $this->getName();
        $this->fieldAddress->setPlaceholder(_t('GeoLocationField.ADDRESSPLACEHOLDER', 'Address'));
        // set caption if required
        $js = <<<JS
(function(\$){
    \$(function(){
        \$("#{$name}-Address").geocomplete().bind("geocode:result", function(event, result){
            \$("#{$name}-Latitude").val(result.geometry.location.lat());
            \$("#{$name}-Longditude").val(result.geometry.location.lng());
        });
    });
})(jQuery);
JS;
        Requirements::customScript($js, 'BootstrapGeoLocationField_Js_' . $this->ID());
        $css = <<<CSS
/* make the location suggest dropdown appear above dialog */
.pac-container {
    z-index: 2000 !important;
}
CSS;
        Requirements::customCSS($css, 'BootstrapGeoLocationField_Css_' . $this->ID());
        return $this->fieldLatitude->Field() . $this->fieldLongditude->Field() . '<div class="row">' . '<div class="col-sm-12">' . $this->fieldAddress->Field() . '</div>' . '</div>';
    }
開發者ID:EduardMa,項目名稱:silverstripe-bootstrap_extra_fields,代碼行數:32,代碼來源:BootstrapGeoLocationField.php

示例5: onAfterInit

	public function onAfterInit() {
		$cssTemplate = Object::get_static('GalleristPageDecorator', 'css_template');
		if ((bool)$cssTemplate && $this->owner->hasMethod('data')) {
			Requirements::customCSS($this->owner->data()->renderWith($cssTemplate));
		}
		Requirements::themedCSS('gallerist');
	}
開發者ID:redema,項目名稱:silverstripe-gallerist,代碼行數:7,代碼來源:GalleristPageControllerExtension.php

示例6: init

 public function init()
 {
     parent::init();
     Requirements::css(CMS_DIR . '/css/screen.css');
     Requirements::customCSS($this->generatePageIconsCss());
     Requirements::css(self::$directory . '/css/external-content-admin.css');
     Requirements::javascript(self::$directory . '/javascript/external-content-admin.js');
     Requirements::javascript(self::$directory . '/javascript/external-content-reload.js');
 }
開發者ID:nyeholt,項目名稱:silverstripe-external-content,代碼行數:9,代碼來源:ExternalContentAdmin.php

示例7: init

    function init()
    {
        parent::init();
        // Shorten Text Area
        Requirements::customCSS("textarea {height:3em; width:300px;}");
        // adding JS for jquery based validation
        Requirements::javascript("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
        Requirements::javascript("http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js");
        Requirements::customScript('
				jQuery(document).ready(function() {
					jQuery("#Form_LogoForm").validate({
						rules: {
								Name: "required",
						Email: {
								required: true,
								email: true
						},
								PhoneNumber: "required",
								CompanyName: "required",
								ProductName: "required",
								Website: "required",
								StreetAddress: "required",
								City: "required",
								Country: "required"
					},
					messages: {
								Name: "Oops... Please provide your name.",
								Email: "Oops... Please provide your email address.",
								PhoneNumber: "Oops... Please provide your phone number.",
								CompanyName: "Oops... Please provide your company name.",
								ProductName: "Oops... Please provide your product name.",
								Website: "Oops... Please provide your company website.",
								StreetAddress: "Oops... Please provide your street address.",
								City: "Oops... Please provide your city.",
								Country: "Oops... Please provide your country."
								}
						});
					});
				');
        Requirements::javascript("http://assets.zendesk.com/external/zenbox/v2.5/zenbox.js");
        Requirements::css("http://assets.zendesk.com/external/zenbox/v2.5/zenbox.css");
        Requirements::customScript('
				 if (typeof(Zenbox) !== "undefined") {
				    Zenbox.init({
				      dropboxID:   "20115046",
				      url:         "https://openstack.zendesk.com",
				      tabID:       "Ask Us",
				      tabColor:    "black",
				      tabPosition: "Right"
				    });
				  }

			');
    }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:54,代碼來源:LogoRightsPage.php

示例8: CarouselSlides

    public function CarouselSlides()
    {
        // Load CSS to size the carousel
        Requirements::customCSS(<<<CSS
    .carousel-container {
        width: {$this->owner->CarouselWidth}px;
        height: {$this->owner->CarouselHeight}px;
    }
CSS
);
        return $this->owner->renderWith('CarouselSlides', array('Slides' => $this->owner->Slides()));
    }
開發者ID:i-lateral,項目名稱:silverstripe-carousel,代碼行數:12,代碼來源:CarouselPage.php

示例9: init

    public function init()
    {
        parent::init();
        Requirements::customCSS(<<<CSS
\t\t\tul.step-buttons {
\t\t\t\tpadding: 0;
\t\t\t}
CSS
);
        Requirements::block(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
        Requirements::block(USERFORMS_DIR . '/thirdparty/jquery-validate/jquery.validate.min.js');
    }
開發者ID:sentromedia,項目名稱:letsfund,代碼行數:12,代碼來源:GenericPage.php

示例10: init

 public function init()
 {
     /** =========================================
          * @var SiteConfig $config
         ===========================================*/
     $config = SiteConfig::current_site_config();
     /**
      * Remove the Reports menu item in the CMS
      */
     if (!$config->ShowAssetAdmin) {
         CMSMenu::remove_menu_item('AssetAdmin');
     }
     /**
      * Remove the Blog menu item in the CMS
      */
     if (!$config->ShowBlogAdmin) {
         CMSMenu::remove_menu_item('BlogPageModelAdmin');
     }
     /**
      * Remove the Help Link in the CMS
      */
     if (!$config->ShowHelpLink) {
         CMSMenu::remove_menu_item('Help');
     }
     /**
      * Remove the Messages menu item in the CMS
      */
     if (!$config->ShowMessagesAdmin) {
         CMSMenu::remove_menu_item('ContactMessageModelAdmin');
     }
     /**
      * Remove the Portfolio menu item in the CMS
      */
     if (!$config->ShowPortfolioAdmin) {
         CMSMenu::remove_menu_item('PortfolioPageModelAdmin');
     }
     /**
      * Remove the Reports menu item in the CMS
      */
     if (!$config->ShowReportAdmin) {
         CMSMenu::remove_menu_item('ReportAdmin');
     }
     /**
      * Remove the Security menu item in the CMS
      */
     if (!$config->ShowSecurityAdmin) {
         CMSMenu::remove_menu_item('SecurityAdmin');
     }
     /** Set the background colour of the cms sidebar menu. */
     Requirements::customCSS('.cms-menu {background: ' . $this->owner->stat('cms_menu_background') . ';}');
 }
開發者ID:stevie-mayhew,項目名稱:silverstripe-boilerplate-installer,代碼行數:51,代碼來源:LeftAndMain.php

示例11: __construct

    /**
     * @param Controller $controller
     * @param String     $name
     * @param FieldList   $fields
     * @param FieldList   $actions
     * @param null       $validator
     */
    function __construct($controller, $name, FieldList $fields, FieldList $actions, $validator = null)
    {
        // Guard against automated spam registrations by optionally adding a field
        // that is supposed to stay blank (and is hidden from most humans).
        $fields->push($honey = new TextField(self::FieldName, self::FieldName));
        $honey->addExtraClass('honey');
        $css = <<<CSS
.honey {
\tposition: absolute; left: -9999px
}
CSS;
        Requirements::customCSS($css, 'honey_css');
        parent::__construct($controller, $name, $fields, $actions, $validator);
    }
開發者ID:Thingee,項目名稱:openstack-org,代碼行數:21,代碼來源:HoneyPotForm.php

示例12: init

 public function init()
 {
     // set reading lang
     if (Object::has_extension('SiteTree', 'Translatable') && !$this->request->isAjax()) {
         Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
     }
     parent::init();
     Requirements::css(CMS_DIR . '/css/screen.css');
     Requirements::customCSS($this->generatePageIconsCss());
     Requirements::combine_files('cmsmain.js', array_merge(array(CMS_DIR . '/javascript/CMSMain.js', CMS_DIR . '/javascript/CMSMain.EditForm.js', CMS_DIR . '/javascript/CMSMain.AddForm.js', CMS_DIR . '/javascript/CMSPageHistoryController.js', CMS_DIR . '/javascript/CMSMain.Tree.js', CMS_DIR . '/javascript/SilverStripeNavigator.js', CMS_DIR . '/javascript/SiteTreeURLSegmentField.js'), Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true)));
     CMSBatchActionHandler::register('publish', 'CMSBatchAction_Publish');
     CMSBatchActionHandler::register('unpublish', 'CMSBatchAction_Unpublish');
     CMSBatchActionHandler::register('delete', 'CMSBatchAction_Delete');
     CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
 }
開發者ID:prostart,項目名稱:cobblestonepath,代碼行數:15,代碼來源:CMSMain.php

示例13: init

 /**
  * Initialises the extension by generating custom CSS for the CMS interface.
  */
 public function init()
 {
     if (class_exists("SiteConfig") && ($SiteConfig = SiteConfig::current_site_config())) {
         // Load Moderno Custom CSS:
         Requirements::customCSS($SiteConfig->renderWith('ModernoAdminCustomCSS'));
         // Customise Application Name:
         if ($application_name = $SiteConfig->ModernoApplicationName) {
             Config::inst()->update('LeftAndMain', 'application_name', $application_name);
         }
         // Customise Application Link:
         if ($application_link = $SiteConfig->ModernoApplicationLink) {
             Config::inst()->update('LeftAndMain', 'application_link', $SiteConfig->dbObject('ModernoApplicationLink')->URL());
         }
     }
 }
開發者ID:praxisnetau,項目名稱:silverstripe-moderno-admin,代碼行數:18,代碼來源:ModernoAdminExtension.php

示例14: onAfterInit

    public function onAfterInit()
    {
        /* =========================================
           * Add Google Font CSS
           =========================================*/
        if (SiteConfig::current_site_config()->FontHeadings) {
            $font = SiteConfig::current_site_config()->FontHeadings;
            // Strip out font variants after colon
            $fontName = substr($font, 0, strpos($font, ':'));
            Requirements::css('http://fonts.googleapis.com/css?family=' . SiteConfig::current_site_config()->FontHeadings);
            Requirements::customCSS(<<<CSS
            h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{
                font-family: {$fontName}, serif;
            }
CSS
);
        }
        if (SiteConfig::current_site_config()->FontBody) {
            $font = SiteConfig::current_site_config()->FontBody;
            // Strip out font variants after colon
            $fontName = substr($font, 0, strpos($font, ':'));
            Requirements::css('http://fonts.googleapis.com/css?family=' . SiteConfig::current_site_config()->FontBody);
            Requirements::customCSS(<<<CSS
            body,
            strong,
            input,
            textarea,
            #main-nav .nav li a,
            .btn{
                font-family: {$fontName}, serif;
            }
            ::-webkit-input-placeholder{
                font-family: {$fontName}, serif;
            }
            ::-moz-placeholder{
                font-family: {$fontName}, serif;
            }
            :-ms-input-placeholder{
                font-family: {$fontName}, serif;
            }
            input:-moz-placeholder{
                font-family: {$fontName}, serif;
            }
CSS
);
        }
    }
開發者ID:ormandroid,項目名稱:ss_boilerplate,代碼行數:47,代碼來源:GoogleFontPageExtension.php

示例15: init

 /**
  * ─────────────────────────────▄██▄
  * ─────────────────────────────▀███
  * ────────────────────────────────█
  * ───────────────▄▄▄▄▄────────────█
  * ──────────────▀▄────▀▄──────────█
  * ──────────▄▀▀▀▄─█▄▄▄▄█▄▄─▄▀▀▀▄──█
  * ─────────█──▄──█────────█───▄─█─█
  * ─────────▀▄───▄▀────────▀▄───▄▀─█
  * ──────────█▀▀▀────────────▀▀▀─█─█
  * ──────────█───────────────────█─█
  * ▄▀▄▄▀▄────█──▄█▀█▀█▀█▀█▀█▄────█─█
  * █▒▒▒▒█────█──█████████████▄───█─█
  * █▒▒▒▒█────█──██████████████▄──█─█
  * █▒▒▒▒█────█───██████████████▄─█─█
  * █▒▒▒▒█────█────██████████████─█─█
  * █▒▒▒▒█────█───██████████████▀─█─█
  * █▒▒▒▒█───██───██████████████──█─█
  * ▀████▀──██▀█──█████████████▀──█▄█
  * ──██───██──▀█──█▄█▄█▄█▄█▄█▀──▄█▀
  * ──██──██────▀█─────────────▄▀▓█
  * ──██─██──────▀█▀▄▄▄▄▄▄▄▄▄▀▀▓▓▓█
  * ──████────────█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
  * ──███─────────█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
  * ──██──────────█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
  * ──██──────────█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
  * ──██─────────▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
  * ──██────────▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
  * ──██───────▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
  * ──██──────▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
  * ──██─────▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
  * ──██────▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
  * Override all of the things
  */
 public function init()
 {
     /* Radio & Check boxes */
     Requirements::customCSS('.cms [type="radio"]:not(:checked) + label:after,' . '.cms [type="checkbox"]:checked + label .ui:after' . '{color:' . $this->owner->config()->cms_success_color . '!important;}' . '.cms [type="radio"]:checked + label:after,' . '.cms [type="checkbox"]:checked + label:after' . '{background:' . $this->owner->config()->cms_success_color . '!important;}');
     /* Composite Fields */
     Requirements::customCSS('.cms .togglecomposite' . '{color:' . $this->owner->config()->cms_success_color . ' !important;}' . '.cms .togglecomposite,' . '.cms .ui-accordion-header' . '{background:' . $this->owner->config()->cms_success_color . ' !important;}' . '.cms .togglecomposite,' . '.cms .ui-accordion .ui-accordion-content,' . '.cms .ui-accordion .ui-accordion-header' . '{border-color:' . $this->owner->config()->cms_success_color . ' !important;}');
     /* Left Hand Menu */
     Requirements::customCSS('.cms .description' . '{border-left: 4px solid ' . $this->owner->config()->cms_success_color . ' !important;}' . '.cms .cms-menu' . '{background:' . $this->owner->config()->cms_highlight_colour . ' !important;}' . '.cms .cms-menu-list li a:hover,' . '.cms .cms-menu-list li.current a' . '{background:' . $this->adjustBrightness($this->owner->config()->cms_highlight_colour, 20) . '!important;}');
     /* Form Elements */
     Requirements::customCSS('.cms .field .chzn-container-single .chzn-single.chzn-container-active,' . '.cms .field input.text:focus, .cms .field textarea:focus, .cms .field .TreeDropdownField:focus' . '{border:1px solid ' . $this->owner->config()->cms_highlight_colour . ';}');
     /* Buttons */
     Requirements::customCSS('.cms table.ss-gridfield-table tr th.main,table.ss-gridfield-table tr td.bottom-all ' . '{background: ' . $this->adjustBrightness($this->owner->config()->cms_success_color, 30) . ' !important;}' . 'table.ss-gridfield-table tr.title th,.cms .ss-ui-button.ss-ui-action-constructive' . '{background: ' . $this->owner->config()->cms_success_color . ' !important;' . 'border-color: ' . $this->owner->config()->cms_success_color . ';}' . '.ss-uploadfield .ss-uploadfield-item .ss-uploadfield-item-preview.ss-uploadfield-dropzone{border: 2px dashed' . $this->owner->config()->cms_success_color . ';}' . '.cms .ss-ui-button.ss-ui-action-constructive:hover,' . '.cms .ss-ui-button.ss-ui-action-constructive:active' . '{background: ' . $this->adjustBrightness($this->owner->config()->cms_success_color, 20) . ';' . 'border-color: ' . $this->adjustBrightness($this->owner->config()->cms_success_color, 20) . ';}' . '.cms .ss-ui-button.ss-ui-action-destructive' . '{background: ' . $this->owner->config()->cms_error_color . ';' . 'border-color: ' . $this->owner->config()->cms_error_color . ';}' . '.cms .ss-ui-button.ss-ui-action-destructive:hover,' . '.cms .ss-ui-button.ss-ui-action-destructive:active' . '{background: ' . $this->adjustBrightness($this->owner->config()->cms_error_color, 20) . ';' . 'border-color: ' . $this->adjustBrightness($this->owner->config()->cms_error_color, 20) . ';}');
     /* Tabs */
     Requirements::customCSS('.cms .ui-tabs-nav li.ui-state-active,.cms .cms-content-header.north .cms-content-header-tabs .ui-tabs-nav li.ui-state-active a' . '{background-color:' . $this->owner->config()->cms_success_color . ' !important;' . 'border-bottom: 4px solid ' . $this->adjustBrightness($this->owner->config()->cms_success_color, 60) . ';}' . '.cms .ui-tabs-nav li.ui-state-active' . '{background:' . $this->owner->config()->cms_highlight_colour . ';}');
     Requirements::css('./flat-cms/styles/css/flat-cms.css');
     Requirements::customCSS($this->getAwesomeIconCSS());
 }
開發者ID:toastnz,項目名稱:flat-cms,代碼行數:51,代碼來源:FlatCMSLeftAndMainExtension.php


注:本文中的Requirements::customCSS方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。