public function init()
 {
     parent::init();
     CMSBatchActionHandler::register('batchCmsWorkflowPublish', 'BatchPublishPages');
     CMSBatchActionHandler::register('batchCmsWorkflowApprove', 'BatchApprovePages');
     CMSBatchActionHandler::register('forcepublish', 'BatchForcePublishPages');
 }
Exemplo n.º 2
0
 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');
 }
 public function init()
 {
     parent::init();
     Requirements::javascript(CMS_DIR . '/javascript/SecurityAdmin.js');
     Requirements::javascript(CMS_DIR . '/javascript/SecurityAdmin.Tree.js');
     CMSBatchActionHandler::register('delete', 'SecurityAdmin_DeleteBatchAction', 'Group');
 }
Exemplo n.º 4
0
	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');
	}
Exemplo n.º 5
0
 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');
     }
 }
Exemplo n.º 6
0
 /**
  * Set up the controller
  */
 public function init()
 {
     parent::init();
     Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.js");
     Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', false, true);
     Requirements::css(CMS_DIR . "/css/screen.css");
     CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder');
 }
    /**
     * Set up the controller
     */
    public function init()
    {
        parent::init();
        Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.js");
        Requirements::javascript(CMS_DIR . '/javascript/CMSMain.GridField.js');
        Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', false, true);
        Requirements::css(CMS_DIR . "/css/screen.css");
        $frameworkDir = FRAMEWORK_DIR;
        Requirements::customScript(<<<JS
\t\t\t_TREE_ICONS = {};
\t\t\t_TREE_ICONS['Folder'] = {
\t\t\t\t\tfileIcon: '{$frameworkDir}/javascript/tree/images/page-closedfolder.gif',
\t\t\t\t\topenFolderIcon: '{$frameworkDir}/javascript/tree/images/page-openfolder.gif',
\t\t\t\t\tclosedFolderIcon: '{$frameworkDir}/javascript/tree/images/page-closedfolder.gif'
\t\t\t};
JS
);
        CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder');
    }
Exemplo n.º 8
0
    /**
     * Set up the controller, in particular, re-sync the File database with the assets folder./
     */
    function init()
    {
        parent::init();
        // Create base folder if it doesnt exist already
        if (!file_exists(ASSETS_PATH)) {
            Filesystem::makeFolder(ASSETS_PATH);
        }
        Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.js");
        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: 'sapphire/javascript/tree/images/page-closedfolder.gif',
\t\t\t\t\topenFolderIcon: 'sapphire/javascript/tree/images/page-openfolder.gif',
\t\t\t\t\tclosedFolderIcon: 'sapphire/javascript/tree/images/page-closedfolder.gif'
\t\t\t};
JS
);
        CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder');
    }
Exemplo n.º 9
0
	/**
	 * Set up the controller, in particular, re-sync the File database with the assets folder./
	 */
	public function init() {
		parent::init();
		
		// Create base folder if it doesnt exist already
		if(!file_exists(ASSETS_PATH)) Filesystem::makeFolder(ASSETS_PATH);

		Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.js");
		Requirements::javascript(CMS_DIR . '/javascript/CMSMain.GridField.js');
		Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', false, true);
		Requirements::css(CMS_DIR . "/css/screen.css");
		$frameworkDir = FRAMEWORK_DIR;
		Requirements::customScript(<<<JS
			_TREE_ICONS = {};
			_TREE_ICONS['Folder'] = {
					fileIcon: '$frameworkDir/javascript/tree/images/page-closedfolder.gif',
					openFolderIcon: '$frameworkDir/javascript/tree/images/page-openfolder.gif',
					closedFolderIcon: '$frameworkDir/javascript/tree/images/page-closedfolder.gif'
			};
JS
		);
		
		CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder');
	}
Exemplo n.º 10
0
<?php

/*
LeftAndMain::require_css(basename(__DIR__) . '/css/markstrap.css');
LeftAndMain::require_javascript(basename(__DIR__) . '/javascript/markstrap.js');
*/
// Set the site locale
i18n::set_locale('en_AU');
// CMS Batch Actions
CMSBatchActionHandler::register('hidefrommenus', 'CMSBatchAction_HideFromMenus');
CMSBatchActionHandler::register('hidefromsearch', 'CMSBatchAction_HideFromSearch');
// Visualblocks plugin
HtmlEditorConfig::get('cms')->enablePlugins(array('visualblocks' => '../../../framework/thirdparty/tinymce/plugins/visualblocks/editor_plugin.js'));
HtmlEditorConfig::get('cms')->addButtonsToLine(1, 'visualblocks');
// Remove formatting button
HtmlEditorConfig::get('cms')->addButtonsToLine(1, 'removeformat');
// Codemagic plugin for TinyMCE
HtmlEditorConfig::get('cms')->enablePlugins(array('codemagic' => sprintf('../../../markstrap/thirdparty/codemagic/editor_plugin_src.js')));
HtmlEditorConfig::get('cms')->insertButtonsBefore('fullscreen', 'codemagic');
HtmlEditorConfig::get('cms')->removeButtons('code');
<?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');
 function init()
 {
     // We need to make sure these CMSMain scripts are included first
     Requirements::javascript('cms/javascript/CMSMain.js');
     Requirements::javascript('cms/javascript/CMSMain_left.js');
     Requirements::javascript('cms/javascript/CMSMain_right.js');
     CMSBatchActionHandler::register('batchCmsWorkflowSetEmbargo', 'BatchSetEmbargo');
     CMSBatchActionHandler::register('batchCmsWorkflowSetExpiry', 'BatchSetExpiry');
     CMSBatchActionHandler::register('batchCmsWorkflowResetEmbargo', 'BatchResetEmbargo');
     CMSBatchActionHandler::register('batchCmsWorkflowResetExpiry', 'BatchResetExpiry');
     Requirements::javascript('cmsworkflow/javascript/LeftAndMainCMSWorkflow.js');
     Requirements::customScript("CMSWorkflow.setOption('noPromptForAdmin', " . Convert::raw2json(!self::$prompt_admin_for_comments) . ')');
     RSSFeed::linkToFeed(Director::absoluteURL('admin/cms/changes.rss'), 'All content changes');
 }