本文整理汇总了PHP中LeftAndMain::require_javascript方法的典型用法代码示例。如果您正苦于以下问题:PHP LeftAndMain::require_javascript方法的具体用法?PHP LeftAndMain::require_javascript怎么用?PHP LeftAndMain::require_javascript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeftAndMain
的用法示例。
在下文中一共展示了LeftAndMain::require_javascript方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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')));
示例2: array
<?php
Director::addRules(50, array('createecommercevariations/$Action/$ProductID' => 'CreateEcommerceVariations', 'createecommercevariationsbatch/$Action' => 'CreateEcommerceVariations_Batch'));
Buyable::add_class("ProductVariation");
Object::add_extension("Product", "ProductWithVariationDecorator");
Object::add_extension("Product_Controller", "ProductWithVariationDecorator_Controller");
Object::add_extension("ProductBulkLoader", "ProductVariationBulkLoader");
Product_Controller::$allowed_actions[] = 'VariationForm';
Product_Controller::$allowed_actions[] = 'addvariation';
LeftAndMain::require_javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
LeftAndMain::require_javascript(THIRDPARTY_DIR . "/jquery-livequery/jquery.livequery.js");
LeftAndMain::require_javascript("ecommerce_product_variation/javascript/CreateEcommerceVariationsField.js");
LeftAndMain::require_themed_css("CreateEcommerceVariationsField");
ProductsAndGroupsModelAdmin::$model_importers['ProductVariation'] = null;
//copy the lines between the START AND END line to your /mysite/_config.php file and choose the right settings
// __________________________________ START ECOMMERCE PRODUCT VARIATIONS MODULE CONFIG __________________________________
//____________HIGHLY RECOMMENDED
//ProductsAndGroupsModelAdmin::add_managed_model("ProductAttributeValue");
//ProductsAndGroupsModelAdmin::add_managed_model("ProductAttributeType");
//ProductsAndGroupsModelAdmin::add_managed_model("ProductVariation");
//____________ADD TO CART FORM INTERACTION
//ProductWithVariationDecorator_Controller::set_use_js_validation(false);
//ProductWithVariationDecorator_Controller::set_alternative_validator_class_name("MyValidatorClass");
//____________EASY SORTING - REQUIRES: http://sunny.svnrepository.com/svn/sunny-side-up-general/dataobjectsorter
//Object::add_extension('ProductAttributeValue', 'DataObjectSorterDOD');
//Object::add_extension('ProductAttributeType', 'DataObjectSorterDOD');
//DataObjectSorterDOD::set_also_update_sort_field(true);
//DataObjectSorterDOD::set_do_not_add_alternative_sort_field(true);
//____________CUSTOMISED CMS INTERACTION
//LeftAndMain::require_javascript("mysite/javascript/MyCreateEcommerceVariationsField.js");
//____________COLOUR OPTIONS
示例3: apply_requirements
/**
* Apply all descriptive required extensions.
*/
public static function apply_requirements()
{
LeftAndMain::require_css(DESCRIPTIVE_PATH . '/css/descriptive.css');
LeftAndMain::require_javascript(DESCRIPTIVE_PATH . '/javascript/descriptive.js');
}
示例4:
<?php
// Add necessary javascript and css
LeftAndMain::require_javascript(basename(__DIR__) . '/javascript/LeftAndMain.BatchTranslatePlus.js');
LeftAndMain::require_css(basename(__DIR__) . '/css/batchtranslateplus.css');
示例5:
<?php
LeftAndMain::require_css('processmap/css/process.css');
LeftAndMain::require_javascript('processmap/javascript/process-admin.js');
if (class_exists('DefinitionAdmin')) {
Object::add_extension('ProcessInfo', 'ProcessInfoExtension');
}
示例6:
<?php
LeftAndMain::require_javascript('userforms/javascript/FieldEditor.js');
LeftAndMain::require_css('userforms/css/FieldEditor.css');
示例7: _t
<?php
$link = 'admin/' . KickAssetAdmin::$url_segment;
CMSMenu::replace_menu_item("AssetAdmin", _t('KickAssetAdmin.BROWSE', 'Browse files...'), $link, "KickAssetAdmin", 2);
// We're using our own custom menu insertion. Don't need another one.
CMSMenu::remove_menu_item("KickAssetAdmin");
Director::addRules(10, array($link => 'KickAssetAdmin'));
$dir = basename(dirname(__FILE__));
if ($dir != "kickassets") {
user_error('Directory name must be "kickassets" (currently "' . $dir . '")', E_USER_ERROR);
}
LeftAndMain::require_javascript("kickassets/javascript/fancybox/fancybox.js");
LeftAndMain::require_css("kickassets/javascript/fancybox/fancybox.css");
LeftAndMain::require_javascript("kickassets/javascript/kickassets_init.js");
示例8: define
<?php
define('BLOCK_DIR', basename(dirname(__FILE__)));
Requirements::block('rightsidebar/js/cms.js');
LeftAndMain::require_javascript(BLOCK_DIR . '/js/silverstripe-block.script.js');
Requirements::css(BLOCK_DIR . '/css/blocks.css');
示例9: load
public static function load($name)
{
switch ($name) {
case 'jquery':
// loaders / blockers
Requirements::block(THIRDPARTY_DIR . "/jquery/jquery.js");
Requirements::javascript(ABC_PATH . "/javascript/library/jQuery/jquery-1.10.2.min.js");
LeftAndMainHelper::require_unblock(THIRDPARTY_DIR . "/jquery/jquery.js");
LeftAndMainHelper::require_block(ABC_PATH . "/javascript/library/jQuery/jquery-1.10.2.min.js");
LeftAndMain::require_javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
break;
case 'jquery-mobile':
// dependencies
self::load('jquery');
// loaders / blockers
Requirements::javascript(ABC_PATH . '/javascript/library/jQuery/mobile/jquery.mobile-1.3.2.min.js');
LeftAndMainHelper::require_block(ABC_PATH . '/javascript/library/jQuery/mobile/jquery.mobile-1.3.2.min.js');
break;
case 'lean-modal':
// dependencies
self::load('jquery');
// loaders / blockers
Requirements::javascript(ABC_PATH . "/javascript/library/jQuery/lean-modal/jquery.lean-modal.min.js");
Requirements::css(ABC_PATH . "/javascript/library/jQuery/lean-modal/jquery.lean-modal.css");
LeftAndMainHelper::require_block(ABC_PATH . "/javascript/library/jQuery/lean-modal/jquery.lean-modal.min.js");
LeftAndMainHelper::require_block(ABC_PATH . "/javascript/library/jQuery/lean-modal/jquery.lean-modal.css");
break;
case 'avgrund':
// dependencies
self::load('jquery');
// loaders / blockers
Requirements::javascript(ABC_PATH . "/javascript/library/jQuery/avgrund/jquery.avgrund.js");
Requirements::css(ABC_PATH . "/javascript/library/jQuery/avgrund/avgrund.css");
LeftAndMainHelper::require_block(ABC_PATH . "/javascript/library/jQuery/avgrund/jquery.avgrund.js");
LeftAndMainHelper::require_block(ABC_PATH . "/javascript/library/jQuery/avgrund/argvund.css");
break;
case 'bootstrap':
// dependencies
self::load('jquery');
// loaders / blockers
Requirements::javascript(ABC_PATH . '/lib/bootstrap/css/bootstrap.min.css');
LeftAndMainHelper::require_block(ABC_PATH . '/lib/bootstrap/js/bootstrap.min.js');
break;
case 'slidatron':
// dependencies
self::load('jquery');
// loaders / blockers
Requirements::javascript(ABC_PATH . '/javascript/library/jQuery/event.drag/jquery.event.drag.js');
Requirements::javascript(ABC_PATH . '/javascript/library/jQuery/event.drag/jquery.event.drag.live.js');
Requirements::javascript(ABC_PATH . '/javascript/library/jquery.drag.touch.js');
Requirements::javascript(ABC_PATH . '/javascript/library/jQuery/slidatron/jquery.slidatron.js');
// Requirements::css(ABC_PATH.'/javascript/library/jQuery/slidatron/slidatron.css');
LeftAndMainHelper::require_block(ABC_PATH . '/javascript/library/jQuery/event.drag/jquery.event.drag.js');
LeftAndMainHelper::require_block(ABC_PATH . '/javascript/library/jQuery/event.drag/jquery.event.drag.live.js');
LeftAndMainHelper::require_block(ABC_PATH . '/javascript/library/jquery.drag.touch.js');
LeftAndMainHelper::require_block(ABC_PATH . '/javascript/library/jQuery/slidatron/jquery.slidatron.js');
break;
case 'nivo-slider':
// dependencies
self::load('jquery');
// loaders / blockers
Requirements::javascript(ABC_PATH . '/javascript/library/jQuery/nivo-slider/jquery.nivo.slider.pack.js');
Requirements::css(ABC_PATH . '/javascript/library/jQuery/nivo-slider/nivo-slider.css');
Requirements::css(ABC_PATH . '/javascript/library/jQuery/nivo-slider/themes/default/default.css');
LeftAndMainHelper::require_block(ABC_PATH . '/javascript/library/jQuery/nivo-slider/jquery.nivo.slider.pack.js');
LeftAndMainHelper::require_block(ABC_PATH . '/javascript/library/jQuery/nivo-slider/nivo-slider.css');
LeftAndMainHelper::require_block(ABC_PATH . '/javascript/library/jQuery/nivo-slider/themes/default/default.css');
break;
default:
throw new Exception('Invalid module requested; currently available modules are: jquery, jquery-mobile, bootstrap, avgrund, slidatron, nivo-slider');
break;
}
}
示例10: user_error
<?php
require_once Director::baseFolder() . '/event_calendar/code/sfTime.class.php';
require_once Director::baseFolder() . '/event_calendar/code/sfDate.class.php';
require_once Director::baseFolder() . '/event_calendar/code/sfDateTimeToolkit.class.php';
require_once Director::baseFolder() . '/event_calendar/code/CalendarUI.class.php';
if (!class_exists("DataObjectManager")) {
user_error(_t('EventCalendar.DATAOBJECTMANAGER', 'Event Calendar requires the DataObjectManager module.'), E_USER_ERROR);
}
LeftAndMain::require_javascript('event_calendar/javascript/calendar_interface.js');
LeftAndMain::require_css('event_calendar/css/calendar_cms.css');
Object::add_extension('SiteTree', 'CalendarSiteTree');
Calendar::set_param('language', 'EN');
Calendar::set_param('timezone', 'US-Eastern');
CalendarDateTime::set_param('offset', '-04:00');
CalendarDateTime::set_date_format('dmy');
CalendarDateTime::set_time_format('24');
i18n::include_locale_file('event_calendar', 'en_US');
// Override to specify custom date templates. Falls back on lang file.
/**
* Available date format keys
** Start Date **
%{sWeekDayShort} e.g. Mon
%{sWeekDayFull} e.g. Monday
%{sDayNumFull} e.g. 09
%{sDayNumShort} e.g. 9
%{sDaySuffix} e.g. th, rd, st
%{sMonNumShort} e.g. 8
%{sMonNumFull} e.g. 08
%{sMonShort} e.g. Oct
示例11: 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();
示例12:
<?php
global $project;
$project = 'mysite';
global $database;
$database = 'SS_ss3demo';
require_once 'conf/ConfigureFromEnv.php';
MySQLDatabase::set_connection_charset('utf8');
// Set the current theme. More themes can be downloaded from
// http://www.silverstripe.org/themes/
SSViewer::set_theme('simple');
// Disable BasicAuth by default
BasicAuth::protect_entire_site(false);
// Set the site locale
i18n::set_locale('en_US');
// Enable nested URLs for this site (e.g. page/sub-page/)
if (class_exists('SiteTree')) {
SiteTree::enable_nested_urls();
}
LeftAndMain::require_javascript('mysite/javascript/usabilla.js');
示例13: 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'));
示例14:
<?php
// Default batch action: move to
CMSBatchActionHandler::register('moveto', 'CMSBatchAction_MoveTo');
CMSMenu::remove_menu_item('CMSBatchAction_MoveToController');
// Extras, to be moved to project config as required
// CMSBatchActionHandler::register('hidefrommenus', 'CMSBatchAction_HideFromMenus');
// CMSBatchActionHandler::register('hidefromsearch', 'CMSBatchAction_HideFromSearch');
LeftAndMain::require_javascript(basename(__DIR__) . '/javascript/LeftAndMain.BatchActionsPlus.js');
LeftAndMain::require_css(basename(__DIR__) . '/css/batchactionsplus.css');
示例15: project
<?php
global $project;
$project = 'mysite';
global $database;
$database = 'SS_RCPN';
// Set the site locale
i18n::set_locale('en_GB');
// Set the editor stylesheet
HtmlEditorConfig::get('cms')->setOption('content_css', project() . '/css/editor.css');
// Include JavaScript to fix the date picker in the editable grid field
LeftAndMain::require_javascript('mysite/javascript/GridFieldEditableDatePicker.js');
// Use _ss_environment.php file for configuration
require_once "conf/ConfigureFromEnv.php";