本文整理汇总了PHP中LeftAndMain::require_css方法的典型用法代码示例。如果您正苦于以下问题:PHP LeftAndMain::require_css方法的具体用法?PHP LeftAndMain::require_css怎么用?PHP LeftAndMain::require_css使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeftAndMain
的用法示例。
在下文中一共展示了LeftAndMain::require_css方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: customise_css
/**
* Apply custom styles to the absolute description element.
*
* @parameter <{DESCRIPTION_CSS}> array(string)
*/
public static function customise_css($styles)
{
if (is_array($styles)) {
// Determine the path to write against.
$URL = DESCRIPTIVE_PATH . '/css/custom.css';
$path = Director::baseFolder() . "/{$URL}";
// Collate each custom style where appropriate.
$CSS = '#cms-menu-descriptive {' . PHP_EOL;
foreach ($styles as $style => $value) {
if (!is_numeric($style)) {
$CSS .= "\t{$style}: {$value} !important;" . PHP_EOL;
// Apply any possible background change.
if (strtolower($style) === 'background') {
$background = '#cms-menu-descriptive:before,' . PHP_EOL . '#cms-menu-descriptive:after {' . PHP_EOL;
$background .= "\tborder-top: 10px solid {$value} !important;" . PHP_EOL . '}' . PHP_EOL . PHP_EOL;
$background .= '#cms-menu-descriptive:before {' . PHP_EOL;
$background .= "\tborder-top: 13px solid !important;" . PHP_EOL;
$background .= "\tborder-top-color: inherit !important;" . PHP_EOL . '}' . PHP_EOL;
}
}
}
$CSS .= '}' . PHP_EOL . PHP_EOL . $background;
// Write the custom styles.
file_put_contents($path, $CSS);
chmod($path, 0664);
LeftAndMain::require_css($URL);
}
}
示例2:
<?php
LeftAndMain::require_css(basename(__DIR__) . '/css/GroupProfilesAdmin.css');
示例3: define
<?php
define('NEWSGRID_DIR', basename(dirname(__FILE__)));
// add an arrow overlay to page icons indicating they're children of the GridHolder
LeftAndMain::require_css(NEWSGRID_DIR . '/css/newsgridpages.css');
// Add this line to _config to use provide your own gridfield implementaion on a subclass
//GridFieldPageHolder::$add_default_gridfield = false;
示例4: array
<?php
/**
* DataObjectManager config file
* This can be used to store registrations for SortableDataObject
* e.g. SortableDataObject::add_sortable_class(MyDataObject')
* Followed by /dev/build
*
* Otherwise, put SortableDataObject registrations in mysite/_config.php
*
*/
// Allow DataObjectManager to take control of the AssetAdmin using the AssetManager field
DataObjectManager::allow_assets_override(true);
// Allow DataObjectManager to override some of the core CSS in the CMS (work in progress)
DataObjectManager::allow_css_override(false);
LeftAndMain::require_javascript("dataobject_manager/javascript/jquery-ui.1.6.js");
LeftAndMain::require_javascript("dataobject_manager/code/date_picker_field/datepicker.js");
LeftAndMain::require_javascript("dataobject_manager/code/date_picker_field/datepicker_init.js");
LeftAndMain::require_css("dataobject_manager/css/ui/ui.core.css");
LeftAndMain::require_css("dataobject_manager/css/ui/ui.datepicker.css");
LeftAndMain::require_css("dataobject_manager/css/ui/ui.theme.css");
SimpleWysiwygField::set_default_configuration(array(array('cut', 'copy', 'paste', '|', 'bold', 'italic', 'underline', '|', 'left', 'center', 'right'), array('ol', 'ul', '|', 'hyperlink', 'unlink', 'image', '|', 'formats')));
示例5:
<?php
LeftAndMain::require_css('dubdubdesign-welcome/css/admin.css');
示例6:
<?php
// Add necessary javascript and css
LeftAndMain::require_javascript(basename(__DIR__) . '/javascript/LeftAndMain.BatchTranslatePlus.js');
LeftAndMain::require_css(basename(__DIR__) . '/css/batchtranslateplus.css');
示例7:
<?php
LeftAndMain::require_javascript('userforms/javascript/FieldEditor.js');
LeftAndMain::require_css('userforms/css/FieldEditor.css');
示例8: define
<?php
define('INPAGE_MODULES_DIR', basename(__DIR__));
CMSMenu::remove_menu_item('ContentModuleMain');
CMSMenu::remove_menu_item('ContentModuleEditController');
CMSMenu::remove_menu_item('ContentModuleSettingsController');
CMSMenu::remove_menu_item('ContentModuleHistoryController');
//CMSMenu::remove_menu_item('CMSPageReportsController');
CMSMenu::remove_menu_item('ContentModuleAddController');
//CMSMenu::remove_menu_item('CMSFileAddController');
LeftAndMain::require_css(INPAGE_MODULES_DIR . '/css/ContentModuleField.css');
if (class_exists('Translatable') && SiteTree::has_extension('Translatable')) {
Config::inst()->update('ContentModule', 'extensions', array('ContentModuleLanguageExtension'));
Config::inst()->update('ContentModuleField', 'extensions', array('ContentModuleFieldTranslatableExtension'));
Config::inst()->update('SiteTree', 'extensions', array('ContentModuleSiteTreeTranslatableExtension'));
Config::inst()->update('ContentModuleMain', 'extensions', array('ContentModuleMainTranslatableExtension'));
}
示例9: define
<?php
// define this directory
define('DEVTOOLS_DIR', 'dev-tools');
// create definition of site name (based on SS_PRIMARY_DOMAIN)
$siteName = SS_PRIMARY_DOMAIN;
$siteName = str_replace('http://', '', $siteName);
$siteName = str_replace('https://', '', $siteName);
$siteName = str_replace('.', '_', $siteName);
define('SS_SITE_NAME', $siteName);
// detect if we're using the old domain and need to flag the issue
$fullDomain = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
if ($fullDomain != SS_PRIMARY_DOMAIN && SS_ENVIRONMENT_TYPE == 'live') {
define('DEVTOOLS_ISOLDDOMAIN', true);
// if we're disabled, include our cms-disabling javascript
Requirements::customScript('var ss_primary_domain = "' . SS_PRIMARY_DOMAIN . '";');
LeftAndMain::require_javascript(DEVTOOLS_DIR . '/js/disable-cms.js');
} else {
define('DEVTOOLS_ISOLDDOMAIN', false);
}
// add functionality to SiteTree
ContentController::add_extension('DebugTools_ContentControllerExtension');
SiteConfig::add_extension('DebugTools_SiteConfigExtension');
Member::add_extension('DebugTools_MemberExtension');
// include css
LeftAndMain::require_css(DEVTOOLS_DIR . '/css/cms.css');
// specify editor css file (this needs to be pure CSS, not SCSS)
HtmlEditorConfig::get('cms')->setOption('content_css', '/site/cms/editor.css');
// enable our log jam logger
LogJam::EnableLog();
示例10: basename
<?php
// Set the module directory so we know where JS, etc lives.
NamedLinkFormField::$module_dir = basename(dirname(__FILE__));
// Load required CSS (extra, doesn't seem to load via Ajax)
LeftAndMain::require_css(NamedLinkFormField::$module_dir . '/css/linkfield.css');
示例11: DebugView
<?php
/**
* @package silverstripe-multisites
*/
if (!ClassInfo::exists('MultiValueField')) {
$view = new DebugView();
$link = 'https://github.com/nyeholt/silverstripe-multivaluefield';
if (!headers_sent()) {
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
}
$view->writeHeader();
$view->writeInfo('Dependency Error', 'The Multisites module requires the MultiValueField module.');
$view->writeParagraph("Please install the <a href=\"{$link}\">MultiValueField</a> module.");
$view->writeFooter();
exit;
}
if (!defined('MULTISITES_PATH')) {
define('MULTISITES_PATH', rtrim(basename(dirname(__FILE__))));
}
CMSMenu::remove_menu_item('MultisitesCMSSiteAddController');
CMSMenu::remove_menu_item('MultisitesCMSPageAddController');
LeftAndMain::require_css(MULTISITES_PATH . '/css/MultisitesAdmin.css');
LeftAndMain::require_javascript(MULTISITES_PATH . '/javascript/MultisitesAdmin.js');
SiteTree::set_create_default_pages(false);
// Remove LeftAndMain.AddForm.js - at least until this ticket is resolved
// http://open.silverstripe.org/ticket/7987
Requirements::block(FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js');
SS_Report::add_excluded_reports(array('SideReport_EmptyPages', 'BrokenLinksReport', 'SideReport_RecentlyEdited', 'SideReport_BrokenLinks', 'SideReport_BrokenFiles', 'SideReport_BrokenVirtualPages', 'SideReport_BrokenRedirectorPages'));
示例12: define
<?php
// define this directory
define('MODULE_MANAGER_DIR', basename(dirname(__FILE__)));
// include css
LeftAndMain::require_css(MODULE_MANAGER_DIR . '/css/cms.css');
// add functionality to SiteTree
Object::add_extension('SiteTree', 'ModuleSiteTreeExtension');
CMSMenu::remove_menu_item('ModuleManagerAddController');
CMSMenu::remove_menu_item('ModuleManagerEditController');
示例13: array
// Default administrator account for the CMS
Security::setDefaultAdmin('admin', 'password');
// Theme should be located in /themes/<themename> (Default folder: '/themes/mysite')
SSViewer::set_theme('mysite');
// Recipe: Taggable
DataObject::add_extension('SiteTree', 'Taggable');
// Recipe: Redirection of legacy URLs
Director::addRules(1, array(
'$URLSegment//$Action/$ID/$OtherID' => 'CustomModelAsController',
));
// Recipe: Branding the CMS
LeftAndMain::setApplicationName(
'My Kiwi CMS',
'My Kiwi CMS',
'http://mykiwicms.com'
);
LeftAndMain::setLogo(
'mysite/images/kiwicmslogo.gif',
'width: 62px; height: 32px;'
);
LeftAndMain::set_loading_image(
'mysite/images/kiwicmslogo_loading.png'
);
LeftAndMain::require_css('mysite/css/kiwicms.css');
BlogEntry::$allow_wysiwyg_editing = true;
?>
示例14: define
<?php
define('CB_BUILD_DATE', '@@BUILD_DATE@@');
define('CB_VERSION', '@@VERSION@@');
define('CB_DIR', basename(dirname(__FILE__)));
//Add the include path for the thirdparty folder (fixes zend api's)
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/thirdparty/');
//CMS Menu
CMSMenu::remove_menu_item('CodeBankAddSnippet');
CMSMenu::remove_menu_item('CodeBankEditSnippet');
CMSMenu::remove_menu_item('CodeBankSettings');
CMSMenu::remove_menu_item('CodeBankIPAgreement');
//Inject Menu Styles
LeftAndMain::require_css(CB_DIR . '/css/CodeBankMenu.css');
//Register Short Code
ShortcodeParser::get_active()->register('snippet', array('CodeBankShortCode', 'parse'));
示例15: array
<?php
LeftAndMain::require_css('silverstripe-gdm-express/assets/css/custom.css');
// Don't allow h1 in the editor
HtmlEditorConfig::get('cms')->setOption('theme_advanced_blockformats', 'p,pre,address,h2,h3,h4,h5,h6');
// Add in start and type attributes for ol
HtmlEditorConfig::get('cms')->setOption('extended_valid_elements', 'img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],iframe[src|name|width|height|title|align|allowfullscreen|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt],ol[start|type]');
// Macrons
HtmlEditorConfig::get('cms')->enablePlugins(array('ssmacron' => '../../../framework/thirdparty/tinymce_ssmacron/editor_plugin_src.js'));
HtmlEditorConfig::get('cms')->insertButtonsAfter('charmap', 'ssmacron');
GD::set_default_quality(90);
FulltextSearchable::enable();
// Configure document converter.
if (class_exists('DocumentConverterDecorator')) {
DocumentImportIFrameField_Importer::set_docvert_username('ss-express');
DocumentImportIFrameField_Importer::set_docvert_password('hLT7pCaJrYVz');
DocumentImportIFrameField_Importer::set_docvert_url('http://docvert.silverstripe.com:8888/');
Page::add_extension('DocumentConverterDecorator');
}
// Default translations
if (class_exists('Translatable')) {
Translatable::set_default_locale('en_NZ');
Translatable::set_allowed_locales(array('en_NZ', 'mi_NZ', 'zh_cmn', 'en_GB'));
SiteTree::add_extension('Translatable');
SiteConfig::add_extension('Translatable');
}
Config::inst()->update('i18n', 'common_locales', array("mi_NZ" => array(0 => 'Māori')));
Config::inst()->update('i18n', 'common_languages', array("mi" => array(0 => 'Māori')));