本文整理汇总了PHP中LeftAndMain::init方法的典型用法代码示例。如果您正苦于以下问题:PHP LeftAndMain::init方法的具体用法?PHP LeftAndMain::init怎么用?PHP LeftAndMain::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeftAndMain
的用法示例。
在下文中一共展示了LeftAndMain::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Set up the controller, in particular, re-sync the File database with the assets folder./
*/
function init()
{
parent::init();
if (!file_exists('../assets')) {
mkdir('../assets');
}
// needed for MemberTableField (Requirements not determined before Ajax-Call)
Requirements::javascript("sapphire/javascript/ComplexTableField.js");
Requirements::css("jsparty/greybox/greybox.css");
Requirements::css("sapphire/css/ComplexTableField.css");
Requirements::javascript("cms/javascript/AssetAdmin.js");
Requirements::javascript("cms/javascript/AssetAdmin_left.js");
Requirements::javascript("cms/javascript/AssetAdmin_right.js");
Requirements::javascript("cms/javascript/CMSMain_upload.js");
Requirements::javascript("cms/javascript/Upload.js");
Requirements::javascript("sapphire/javascript/Security_login.js");
Requirements::javascript("jsparty/SWFUpload/SWFUpload.js");
// Include the right JS]
// Hayden: This didn't appear to be used at all
/*$fileList = new FileList("Form_EditForm_Files", null);
$fileList->setClick_AjaxLoad('admin/assets/getfile/', 'Form_SubForm');
$fileList->FieldHolder();*/
Requirements::javascript("jsparty/greybox/AmiJS.js");
Requirements::javascript("jsparty/greybox/greybox.js");
Requirements::css("jsparty/greybox/greybox.css");
Requirements::css("cms/css/AssetAdmin.css");
}
示例2: init
public function init()
{
// In LeftAndMain::init() the current theme is unset.
// we need to restore the current theme here for make the dropdown of template list.
$theme = SSViewer::current_theme();
parent::init();
if (isset($theme) && $theme) {
SSViewer::set_theme($theme);
}
Requirements::javascript(MCE_ROOT . 'tiny_mce_src.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/tiny_mce_improvements.js');
//TODO what is going on here? where did that hover.js go? can't find it.
//TODO We need to reimplement a hover.js?
Requirements::javascript(CMS_DIR . '/javascript/hover.js');
Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/controls.js');
Requirements::javascript(CMS_DIR . '/javascript/LeftAndMain_left.js');
Requirements::javascript(CMS_DIR . '/javascript/LeftAndMain_right.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain_left.js');
Requirements::javascript(CMS_DIR . '/javascript/SecurityAdmin.js');
Requirements::javascript(NEWSLETTER_DIR . '/javascript/NewsletterAdmin_left.js');
Requirements::javascript(NEWSLETTER_DIR . '/javascript/NewsletterAdmin_right.js');
Requirements::javascript(NEWSLETTER_DIR . '/javascript/ProgressBar.js');
// We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
if (!Director::is_ajax()) {
Requirements::javascript(MCE_ROOT . 'tiny_mce_src.js');
HtmlEditorConfig::get('cms')->setOption('ContentCSS', project() . '/css/editor.css');
HtmlEditorConfig::get('cms')->setOption('Lang', i18n::get_tinymce_lang());
}
// Always block the HtmlEditorField.js otherwise it will be sent with an ajax request
Requirements::block(SAPPHIRE_DIR . '/javascript/HtmlEditorField.js');
Requirements::css(NEWSLETTER_DIR . '/css/NewsletterAdmin.css');
}
示例3: init
public function init()
{
parent::init();
Requirements::css("dashboard/css/dashboard.css");
Requirements::javascript("dashboard/javascript/jquery.flip.js");
Requirements::javascript("dashboard/javascript/dashboard.js");
}
示例4: init
public function init()
{
parent::init();
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
Requirements::javascript("jsparty/tiny_mce_improvements.js");
Requirements::javascript("jsparty/hover.js");
Requirements::javascript("jsparty/scriptaculous/controls.js");
Requirements::javascript("cms/javascript/SecurityAdmin.js");
Requirements::javascript("cms/javascript/LeftAndMain_left.js");
Requirements::javascript("cms/javascript/LeftAndMain_right.js");
Requirements::javascript("cms/javascript/CMSMain_left.js");
Requirements::javascript("cms/javascript/ReportAdmin_left.js");
Requirements::javascript("cms/javascript/ReportAdmin_right.js");
Requirements::css("cms/css/ReportAdmin.css");
// TODO Find a better solution to integrate optional Requirements in a specific order
if (Director::fileExists("ecommerce/css/DataReportCMSMain.css")) {
Requirements::css("ecommerce/css/DataReportCMSMain.css");
}
if (Director::fileExists("ecommerce/css/DataReportCMSMain.css")) {
Requirements::javascript("ecommerce/javascript/DataReport.js");
}
if (Director::fileExists(project() . "/css/DataReportCMSMain.css")) {
Requirements::css(project() . "/css/DataReportCMSMain.css");
}
if (Director::fileExists(project() . "/css/DataReportCMSMain.css")) {
Requirements::javascript(project() . "/javascript/DataReport.js");
}
// We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
if (!Director::is_ajax()) {
Requirements::javascriptTemplate("cms/javascript/tinymce.template.js", array("ContentCSS" => project() . "/css/editor.css", "BaseURL" => Director::absoluteBaseURL(), "Lang" => i18n::get_tinymce_lang()));
}
}
示例5: init
/**
* Set up the controller, in particular, re-sync the File database with the assets folder./
*/
function init()
{
parent::init();
if (!file_exists(ASSETS_PATH)) {
mkdir(ASSETS_PATH);
}
// needed for MemberTableField (Requirements not determined before Ajax-Call)
Requirements::css(THIRDPARTY_DIR . "/greybox/greybox.css");
Requirements::css(SAPPHIRE_DIR . "/css/ComplexTableField.css");
Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.js");
Requirements::javascript(CMS_DIR . "/javascript/CMSMain_upload.js");
Requirements::javascript(CMS_DIR . "/javascript/Upload.js");
Requirements::javascript(THIRDPARTY_DIR . "/SWFUpload/SWFUpload.js");
Requirements::javascript(THIRDPARTY_DIR . "/greybox/AmiJS.js");
Requirements::javascript(THIRDPARTY_DIR . "/greybox/greybox.js");
Requirements::css(THIRDPARTY_DIR . "/greybox/greybox.css");
Requirements::css(CMS_DIR . "/css/AssetAdmin.css");
Requirements::customScript(<<<JS
\t\t\t_TREE_ICONS = {};
\t\t\t_TREE_ICONS['Folder'] = {
\t\t\t\t\tfileIcon: 'jsparty/tree/images/page-closedfolder.gif',
\t\t\t\t\topenFolderIcon: 'jsparty/tree/images/page-openfolder.gif',
\t\t\t\t\tclosedFolderIcon: 'jsparty/tree/images/page-closedfolder.gif'
\t\t\t};
JS
);
}
示例6: init
/**
* Provides hook for decorators, so that they can overwrite css
* and other definitions.
*
* @param bool $skipUpdateInit Set to true to skip the parents updateInit extension
*
* @return void
*
* @author Sebastian Diel <sdiel@pixeltricks.de>
* @since 20.02.2013
*/
public function init($skipUpdateInit = false)
{
parent::init();
if (!$skipUpdateInit) {
$this->extend('updateInit');
}
}
示例7: 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');
}
}
示例8: init
public function init() {
parent::init();
if(Translatable::is_enabled()) {
$this->Lang = $this->requestParams["lang"] ? $this->requestParams["lang"] : Translatable::default_lang();
Translatable::set_reading_lang($this->Lang);
}
// collect languages for TinyMCE spellchecker plugin
if(Translatable::is_enabled()) {
$spellcheckLangs = Translatable::get_existing_content_languages();
} else {
$defaultLang = Translatable::default_lang();
$spellcheckLangs = array($defaultLang => i18n::get_language_name($defaultLang));
}
$spellcheckSpec = array();
foreach($spellcheckLangs as $lang => $title) $spellcheckSpec[] = "{$title}={$lang}";
// We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
if(!Director::is_ajax()) {
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
Requirements::javascriptTemplate(CMS_DIR . "/javascript/tinymce.template.js", array(
"ContentCSS" => (SSViewer::current_theme() ? THEMES_DIR . "/" . SSViewer::current_theme() : project()) . "/css/editor.css",
"BaseURL" => Director::absoluteBaseURL(),
"Lang" => i18n::get_tinymce_lang(),
'SpellcheckLangs' => '+' . implode(',', $spellcheckSpec)
));
}
// Always block the HtmlEditorField.js otherwise it will be sent with an ajax request
Requirements::block(SAPPHIRE_DIR . '/javascript/HtmlEditorField.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain_left.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain_right.js');
}
示例9: 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::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'
),
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');
}
示例10: init
public function init()
{
parent::init();
//CSS/JS Dependencies - currently not much there
Requirements::css("calendar/css/admin/CalendarAdmin.css");
Requirements::javascript("calendar/javascript/admin/CalendarAdmin.js");
}
示例11: init
public function init()
{
parent::init();
if (isset($_GET['refresh'])) {
$this->clearAllCache();
}
}
示例12: init
function init()
{
parent::init();
// somehow themed css gets mixed in, remove it
$reqbe = Requirements::backend();
foreach ($reqbe->get_css() as $file => $val) {
if (preg_match('/^themes\\//', $file)) {
Requirements::block($file);
}
}
Requirements::javascript(THIRDPARTY_DIR . '/jquery-form/jquery.form.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery.ui.core.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery.ui.widget.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery.ui.mouse.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery.ui.tabs.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery.ui.button.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery.ui.position.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery.ui.dialog.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery.ui.draggable.js');
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/base/jquery.ui.core.css');
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/base/jquery.ui.dialog.css');
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/base/jquery.ui.theme.css');
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/base/jquery.ui.tabs.css');
Requirements::clear('jsparty/prototype.js');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/i18n.js");
Requirements::add_i18n_javascript('dbplumber/javascript/lang');
Requirements::javascript("dbplumber/javascript/DatabaseBrowser.js");
Requirements::javascript("dbplumber/thirdparty/jquery.event.drag-1.4.js");
Requirements::javascript("dbplumber/thirdparty/jquery.kiketable.colsizable-1.1.js");
Requirements::javascript("dbplumber/thirdparty/jquery.textarea-expander.js");
Requirements::css("dbplumber/thirdparty/jquery.kiketable.colsizable-1.1.css");
Requirements::css("dbplumber/css/DatabaseBrowser_left.css");
Requirements::css("dbplumber/css/DatabaseBrowser_right.css");
}
示例13: init
public function init()
{
// Check permissions
// if(!Member::currentUser() || !Member::currentUser()->isAdmin()) Security::permissionFailure($this);
parent::init();
/*
if(!$this->can('AdminCMS')) {
$messageSet = array(
'default' => "Please choose an authentication method and enter your credentials to access the CMS.",
'alreadyLoggedIn' => "I'm sorry, but you can't access that part of the CMS. If you want to log in as someone else, do so below",
'logInAgain' => "You have been logged out of the CMS. If you would like to log in again, enter a username and password below.",
);
Security::permissionFailure($this, $messageSet);
return;
}*/
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
Requirements::javascript("jsparty/tiny_mce_improvements.js");
Requirements::javascript("jsparty/hover.js");
Requirements::javascript("jsparty/scriptaculous/controls.js");
Requirements::javascript("cms/javascript/SecurityAdmin.js");
Requirements::javascript("cms/javascript/LeftAndMain_left.js");
Requirements::javascript("cms/javascript/LeftAndMain_right.js");
Requirements::javascript("cms/javascript/CMSMain_left.js");
Requirements::javascript("cms/javascript/NewsletterAdmin_left.js");
Requirements::javascript("cms/javascript/NewsletterAdmin_right.js");
Requirements::javascript("sapphire/javascript/ProgressBar.js");
// We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
if (!Director::is_ajax()) {
Requirements::javascriptTemplate("cms/javascript/tinymce.template.js", array("ContentCSS" => project() . "/css/editor.css", "BaseURL" => Director::absoluteBaseURL(), "Lang" => i18n::get_tinymce_lang()));
}
// needed for MemberTableField (Requirements not determined before Ajax-Call)
Requirements::javascript("cms/javascript/MemberTableField.js");
Requirements::css("cms/css/NewsletterAdmin.css");
}
示例14: init
public function init()
{
parent::init();
// Locale" attribute is either explicitly added by LeftAndMain Javascript logic,
// or implied on a translated record (see {@link Translatable->updateCMSFields()}).
// $Lang serves as a "context" which can be inspected by Translatable - hence it
// has the same name as the database property on Translatable.
if ($this->getRequest()->requestVar("Locale")) {
$this->Locale = $this->getRequest()->requestVar("Locale");
} elseif ($this->getRequest()->requestVar("locale")) {
$this->Locale = $this->getRequest()->requestVar("locale");
} else {
$this->Locale = Translatable::default_locale();
}
Translatable::set_current_locale($this->Locale);
// collect languages for TinyMCE spellchecker plugin.
// see http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
$langName = i18n::get_locale_name($this->Locale);
HtmlEditorConfig::get('cms')->setOption('spellchecker_languages', "+{$langName}={$this->Locale}");
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.Tree.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.EditForm.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.Translatable.js');
Requirements::css(CMS_DIR . '/css/CMSMain.css');
CMSBatchActionHandler::register('publish', 'CMSBatchAction_Publish');
CMSBatchActionHandler::register('unpublish', 'CMSBatchAction_Unpublish');
CMSBatchActionHandler::register('delete', 'CMSBatchAction_Delete');
CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
}
示例15: init
/**
* Loads the requirements, checks perms, etc. If an ID is in the URL, that becomes the
* current folder.
*/
public function init()
{
parent::init();
if (!Permission::check("ADMIN") && !Permission::check("CMS_ACCESS_BrowseFiles")) {
return Security::permissionFailure($this, _t('KickAssets.PERMISSIONFAIL', 'You do not have permission to access this section of the CMS.'));
}
Requirements::clear();
Requirements::css('kickassets/css/core.css');
Requirements::css('kickassets/css/kickassets.css');
Requirements::javascript('kickassets/javascript/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
Requirements::javascript('kickassets/javascript/apprise/apprise-1.5.full.js');
Requirements::javascript('kickassets/javascript/jquery.tooltip.js');
Requirements::css('kickassets/javascript/apprise/apprise.css');
Requirements::javascript('kickassets/javascript/kickassets_ui.js');
Requirements::javascript('kickassets/javascript/chosen/chosen.jquery.js');
Requirements::css('kickassets/javascript/chosen/chosen.css');
Requirements::javascript('kickassets/javascript/jquery.form.js');
Requirements::javascript('kickassets/javascript/kickassets.js');
Requirements::css('kickassets/css/kickassets_ui.css');
if ($this->getRequest()->param('ID')) {
$this->currentFolder = DataObject::get_by_id("Folder", (int) $this->getRequest()->param('ID'));
$this->currentPath = KickAssetUtil::relative_asset_dir($this->currentFolder->Filename);
} else {
$this->currentFolder = singleton('Folder');
$this->currentPath = false;
}
}