本文整理汇总了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');
}
}
示例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;
}
示例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');
}
示例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>';
}
示例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');
}
示例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');
}
示例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"
});
}
');
}
示例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()));
}
示例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');
}
示例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') . ';}');
}
示例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);
}
示例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');
}
示例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());
}
}
}
示例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
);
}
}
示例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());
}