当前位置: 首页>>代码示例>>PHP>>正文


PHP i18n::get_tinymce_lang方法代码示例

本文整理汇总了PHP中i18n::get_tinymce_lang方法的典型用法代码示例。如果您正苦于以下问题:PHP i18n::get_tinymce_lang方法的具体用法?PHP i18n::get_tinymce_lang怎么用?PHP i18n::get_tinymce_lang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在i18n的用法示例。


在下文中一共展示了i18n::get_tinymce_lang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     parent::init();
     // 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" => (SSViewer::current_theme() ? "themes/" . SSViewer::current_theme() : project()) . "/css/editor.css", "BaseURL" => Director::absoluteBaseURL(), "Lang" => i18n::get_tinymce_lang()));
     }
     Requirements::javascript('cms/javascript/CMSMain.js');
     Requirements::javascript('cms/javascript/CMSMain_left.js');
     Requirements::javascript('cms/javascript/CMSMain_right.js');
     Requirements::javascript('sapphire/javascript/UpdateURL.js');
     /**
      * HACK ALERT: Project-specific requirements
      * 
      * We need a better way of including all of the CSS that *might* be used by this application.
      * Perhaps the ajax responses can include some instructions to go get more CSS / JavaScript?
      */
     Requirements::css("survey/css/SurveyFilter.css");
     Requirements::javascript("survey/javascript/SurveyResponses.js");
     Requirements::javascript("survey/javascript/FormResponses.js");
     Requirements::javascript("parents/javascript/NotifyMembers.js");
     Requirements::css("tourism/css/SurveyCMSMain.css");
     Requirements::javascript("tourism/javascript/QuotasReport.js");
     Requirements::javascript("sapphire/javascript/ReportField.js");
     Requirements::javascript("ptraining/javascript/BookingList.js");
     Requirements::javascript("forum/javascript/ForumAccess.js");
     Requirements::javascript('gallery/javascript/GalleryPage_CMS.js');
 }
开发者ID:ramziammar,项目名称:websites,代码行数:28,代码来源:CMSMain.php

示例2: 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");
 }
开发者ID:ramziammar,项目名称:websites,代码行数:35,代码来源:NewsletterAdmin.php

示例3: 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()));
     }
 }
开发者ID:ramziammar,项目名称:websites,代码行数:32,代码来源:ReportAdmin.php

示例4: 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');
 }
开发者ID:roed,项目名称:silverstripe-newsletter,代码行数:32,代码来源:NewsletterAdmin.php

示例5: 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>';
    }
开发者ID:EduardMa,项目名称:silverstripe-bootstrap_extra_fields,代码行数:32,代码来源:BootstrapGeoLocationField.php

示例6: include_js

    /**
     * This basically merges HtmlEditorField::include_js() and HTMLEditorConfig::generateJS() to output all
     * configuration sets to a customTinyMceConfigs javascript array.
     * This is output in addition to the standard ssTinyMceConfig because a) we can't stop the default output
     * with extensions; and b) the default setting is still used for any HTMLEditorField that doesn't specify
     * it's own config.
     *
     * Calls Requirements::javascript() to load the scripts.
     */
    public static function include_js()
    {
        require_once 'tinymce/tiny_mce_gzip.php';
        $availableConfigs = HtmlEditorConfig::get_available_configs_map();
        $pluginsForTag = array();
        $languages = array();
        //$allConfigs = array();
        $settingsJS = '';
        $externalPluginsForJS = array();
        $activeConfig = HtmlEditorConfig::get_active();
        foreach ($availableConfigs as $identifier => $friendlyName) {
            $configObj = CustomHtmlEditorConfig::get($identifier);
            $internalPluginsForJS = array();
            $configObj->getConfig()->setOption('language', i18n::get_tinymce_lang());
            if (!$configObj->getConfig()->getOption('content_css')) {
                $configObj->getConfig()->setOption('content_css', $activeConfig->getOption('content_css'));
            }
            $settings = $configObj->getSettings();
            foreach ($configObj->getPlugins() as $plugin => $path) {
                if (!$path) {
                    $pluginsForTag[$plugin] = $plugin;
                    $internalPluginsForJS[$plugin] = $plugin;
                } else {
                    $internalPluginsForJS[$plugin] = '-' . $plugin;
                    $externalPluginsForJS[$plugin] = sprintf('tinymce.PluginManager.load("%s", "%s");' . "\n", $plugin, $path);
                }
            }
            $language = $configObj->getConfig()->getOption('language');
            if ($language) {
                $languages[$language] = $language;
            }
            $settings['plugins'] = implode(',', $internalPluginsForJS);
            $buttons = $configObj->getButtons();
            foreach ($buttons as $i => $buttons) {
                $settings['theme_advanced_buttons' . $i] = implode(',', $buttons);
            }
            $settingsJS .= "customTinyMceConfigs['" . $identifier . "'] = " . Convert::raw2json($settings) . ";\n";
        }
        if (Config::inst()->get('HtmlEditorField', 'use_gzip')) {
            $tag = TinyMCE_Compressor::renderTag(array('url' => THIRDPARTY_DIR . '/tinymce/tiny_mce_gzip.php', 'plugins' => implode(',', $pluginsForTag), 'themes' => 'advanced', 'languages' => implode(',', $languages)), true);
            preg_match('/src="([^"]*)"/', $tag, $matches);
            Requirements::javascript($matches[1]);
        } else {
            Requirements::javascript(MCE_ROOT . 'tiny_mce_src.js');
        }
        $externalPluginsJS = implode('', $externalPluginsForJS);
        $script = <<<JS
\t\t\tif((typeof tinyMCE != 'undefined')) {
\t\t\t\t{$externalPluginsJS}

\t\t\t\tif (typeof customTinyMceConfigs == 'undefined') {
\t\t\t\t\tvar customTinyMceConfigs = [];
\t\t\t\t}
\t\t\t\t{$settingsJS}
\t\t\t}

JS;
        Requirements::customScript($script, 'htmlEditorConfigs');
    }
开发者ID:helpfulrobot,项目名称:nathancox-customhtmleditorfield,代码行数:68,代码来源:CustomHTMLEditorLeftAndMainExtension.php

示例7: init

 public function init()
 {
     parent::init();
     Requirements::css(CMS_DIR . '/css/ReportAdmin.css');
     // Set custom options for TinyMCE specific to ReportAdmin
     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');
 }
开发者ID:rixrix,项目名称:silverstripe-cms,代码行数:10,代码来源:ReportAdmin.php

示例8: init

 public function init()
 {
     parent::init();
     //set the report we are currently viewing from the URL
     $this->reportClass = isset($this->urlParams['ReportClass']) && $this->urlParams['ReportClass'] !== 'index' ? $this->urlParams['ReportClass'] : null;
     $allReports = SS_Report::get_reports();
     $this->reportObject = isset($allReports[$this->reportClass]) ? $allReports[$this->reportClass] : null;
     // Set custom options for TinyMCE specific to ReportAdmin
     HtmlEditorConfig::get('cms')->setOption('content_css', 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(FRAMEWORK_DIR . '/javascript/HtmlEditorField.js');
     Requirements::javascript(REPORTS_DIR . '/javascript/ReportAdmin.js');
 }
开发者ID:helpfulrobot,项目名称:silverstripe-reports,代码行数:14,代码来源:ReportAdmin.php

示例9: init

 /**
  * Sets Requirements and checks for Permissions.
  * Subclass this function to add custom Requirements.
  */
 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/CMSMain_left.js");
     Requirements::javascript("cms/javascript/GenericDataAdmin_left.js");
     Requirements::javascript("cms/javascript/GenericDataAdmin_right.js");
     Requirements::javascript("cms/javascript/SideTabs.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()));
     }
     Requirements::css("cms/css/GenericDataAdmin.css");
     //For wrightgroup workshop
     Requirements::css("writework/css/WorkshopCMSLayout.css");
 }
开发者ID:ramziammar,项目名称:websites,代码行数:24,代码来源:GenericDataAdmin.php

示例10: init

	public function init() {
		parent::init();
		
		Requirements::javascript(CMS_DIR . '/javascript/ReportAdmin_left.js');
		Requirements::javascript(CMS_DIR . '/javascript/ReportAdmin_right.js');

		Requirements::css(CMS_DIR . '/css/ReportAdmin.css');		
		
		// 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' => project() . '/css/editor.css',
				'BaseURL' => Director::absoluteBaseURL(),
				'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');
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:21,代码来源:ReportAdmin.php

示例11: init

 function init()
 {
     if (Member::currentUser()) {
         CustomHtmlEditorConfig::set_active(Member::currentUser()->getHtmlEditorConfigForCMS());
     }
     Requirements::block(MCE_ROOT . 'tiny_mce_src.js');
     Requirements::block(FRAMEWORK_DIR . "/javascript/HtmlEditorField.js");
     // Set default values in the config if missing.  These things can't be defined in the config
     // file because insufficient information exists when that is being processed
     $htmlEditorConfig = CustomHtmlEditorConfig::get_active();
     $htmlEditorConfig->setOption('language', i18n::get_tinymce_lang());
     if (!$htmlEditorConfig->getOption('content_css')) {
         $cssFiles = array();
         $cssFiles[] = FRAMEWORK_ADMIN_DIR . '/css/editor.css';
         // Use theme from the site config
         if (class_exists('SiteConfig') && ($config = SiteConfig::current_site_config()) && $config->Theme) {
             $theme = $config->Theme;
         } elseif (Config::inst()->get('SSViewer', 'theme_enabled') && Config::inst()->get('SSViewer', 'theme')) {
             $theme = Config::inst()->get('SSViewer', 'theme');
         } else {
             $theme = false;
         }
         if ($theme) {
             $cssFiles[] = THEMES_DIR . "/{$theme}/css/editor.css";
         } else {
             if (project()) {
                 $cssFiles[] = project() . '/css/editor.css';
             }
         }
         // Remove files that don't exist
         foreach ($cssFiles as $k => $cssFile) {
             if (!file_exists(BASE_PATH . '/' . $cssFile)) {
                 unset($cssFiles[$k]);
             }
         }
         $htmlEditorConfig->setOption('content_css', implode(',', $cssFiles));
     }
     CustomHtmlEditorConfig::require_js();
 }
开发者ID:mediaweb,项目名称:silverstripe-tinymce4,代码行数:39,代码来源:LeftAndMainTinyExtension.php

示例12: 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');
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:35,代码来源:CMSMain.php

示例13: init

 /**
  * @uses LeftAndMainExtension->init()
  * @uses LeftAndMainExtension->accessedCMS()
  * @uses CMSMenu
  */
 function init()
 {
     parent::init();
     SSViewer::setOption('rewriteHashlinks', false);
     // set language
     $member = Member::currentUser();
     if (!empty($member->Locale)) {
         i18n::set_locale($member->Locale);
     }
     if (!empty($member->DateFormat)) {
         i18n::set_date_format($member->DateFormat);
     }
     if (!empty($member->TimeFormat)) {
         i18n::set_time_format($member->TimeFormat);
     }
     // can't be done in cms/_config.php as locale is not set yet
     CMSMenu::add_link('Help', _t('LeftAndMain.HELP', 'Help', 'Menu title'), self::$help_link);
     // Allow customisation of the access check by a extension
     // Also all the canView() check to execute Controller::redirect()
     if (!$this->canView() && !$this->response->isFinished()) {
         // When access /admin/, we should try a redirect to another part of the admin rather than be locked out
         $menu = $this->MainMenu();
         foreach ($menu as $candidate) {
             if ($candidate->Link && $candidate->Link != $this->Link() && $candidate->MenuItem->controller && singleton($candidate->MenuItem->controller)->canView()) {
                 return $this->redirect($candidate->Link);
             }
         }
         if (Member::currentUser()) {
             Session::set("BackURL", null);
         }
         // if no alternate menu items have matched, return a permission error
         $messageSet = array('default' => _t('LeftAndMain.PERMDEFAULT', "Please choose an authentication method and enter your credentials to access the CMS."), 'alreadyLoggedIn' => _t('LeftAndMain.PERMALREADY', "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' => _t('LeftAndMain.PERMAGAIN', "You have been logged out of the CMS.  If you would like to log in again, enter a username and password below."));
         return Security::permissionFailure($this, $messageSet);
     }
     // Don't continue if there's already been a redirection request.
     if ($this->redirectedTo()) {
         return;
     }
     // Audit logging hook
     if (empty($_REQUEST['executeForm']) && !$this->request->isAjax()) {
         $this->extend('accessedCMS');
     }
     // Set the members html editor config
     HtmlEditorConfig::set_active(Member::currentUser()->getHtmlEditorConfigForCMS());
     // Set default values in the config if missing.  These things can't be defined in the config
     // file because insufficient information exists when that is being processed
     $htmlEditorConfig = HtmlEditorConfig::get_active();
     $htmlEditorConfig->setOption('language', i18n::get_tinymce_lang());
     if (!$htmlEditorConfig->getOption('content_css')) {
         $cssFiles = array();
         $cssFiles[] = FRAMEWORK_ADMIN_DIR . '/css/editor.css';
         // Use theme from the site config
         if (class_exists('SiteConfig') && ($config = SiteConfig::current_site_config()) && $config->Theme) {
             $theme = $config->Theme;
         } elseif (SSViewer::current_theme()) {
             $theme = SSViewer::current_theme();
         } else {
             $theme = false;
         }
         if ($theme) {
             $cssFiles[] = THEMES_DIR . "/{$theme}/css/editor.css";
         } else {
             if (project()) {
                 $cssFiles[] = project() . '/css/editor.css';
             }
         }
         // Remove files that don't exist
         foreach ($cssFiles as $k => $cssFile) {
             if (!file_exists(BASE_PATH . '/' . $cssFile)) {
                 unset($cssFiles[$k]);
             }
         }
         $htmlEditorConfig->setOption('content_css', implode(',', $cssFiles));
     }
     // Using uncompressed files as they'll be processed by JSMin in the Requirements class.
     // Not as effective as other compressors or pre-compressed+finetuned files,
     // but overall the unified minification into a single file brings more performance benefits
     // than a couple of saved bytes (after gzip) in individual files.
     // We also re-compress already compressed files through JSMin as this causes weird runtime bugs.
     Requirements::combine_files('lib.js', array(THIRDPARTY_DIR . '/jquery/jquery.js', FRAMEWORK_DIR . '/javascript/jquery-ondemand/jquery.ondemand.js', FRAMEWORK_ADMIN_DIR . '/javascript/lib.js', THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js', THIRDPARTY_DIR . '/json-js/json2.js', THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js', THIRDPARTY_DIR . '/jquery-cookie/jquery.cookie.js', THIRDPARTY_DIR . '/jquery-query/jquery.query.js', THIRDPARTY_DIR . '/jquery-form/jquery.form.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-notice/jquery.notice.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/jsizes/lib/jquery.sizes.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/jlayout/lib/jlayout.border.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/jlayout/lib/jquery.jlayout.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.adapter.jquery.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.html4.js', THIRDPARTY_DIR . '/jstree/jquery.jstree.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.jquery.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-hoverIntent/jquery.hoverIntent.js', FRAMEWORK_ADMIN_DIR . '/javascript/jquery-changetracker/lib/jquery.changetracker.js', FRAMEWORK_DIR . '/javascript/TreeDropdownField.js', FRAMEWORK_DIR . '/javascript/DateField.js', FRAMEWORK_DIR . '/javascript/HtmlEditorField.js', FRAMEWORK_DIR . '/javascript/TabSet.js', FRAMEWORK_DIR . '/javascript/i18n.js', FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js', FRAMEWORK_DIR . '/javascript/GridField.js'));
     if (Director::isDev()) {
         Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/leaktools.js');
     }
     HTMLEditorField::include_js();
     Requirements::combine_files('leftandmain.js', array_unique(array_merge(array(FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Panel.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Tree.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Ping.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Content.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.EditForm.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Menu.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Preview.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.BatchActions.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.FieldHelp.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.TreeDropdownField.js'), Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang', true, true), Requirements::add_i18n_javascript(FRAMEWORK_ADMIN_DIR . '/javascript/lang', true, true))));
     // TODO Confuses jQuery.ondemand through document.write()
     if (Director::isDev()) {
         Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/src/jquery.entwine.inspector.js');
     }
     Requirements::css(FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-notice/jquery.notice.css');
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     Requirements::css(FRAMEWORK_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.css');
     Requirements::css(THIRDPARTY_DIR . '/jstree/themes/apple/style.css');
     Requirements::css(FRAMEWORK_DIR . '/css/TreeDropdownField.css');
     Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/screen.css');
//.........这里部分代码省略.........
开发者ID:prostart,项目名称:cobblestonepath,代码行数:101,代码来源:LeftAndMain.php

示例14: init

 /**
  * @uses LeftAndMainDecorator->init()
  * @uses LeftAndMainDecorator->accessedCMS()
  * @uses CMSMenu
  */
 function init()
 {
     parent::init();
     SSViewer::setOption('rewriteHashlinks', false);
     // set language
     $member = Member::currentUser();
     if (!empty($member->Locale)) {
         i18n::set_locale($member->Locale);
     }
     if (!empty($member->DateFormat)) {
         i18n::set_date_format($member->DateFormat);
     }
     if (!empty($member->TimeFormat)) {
         i18n::set_time_format($member->TimeFormat);
     }
     // can't be done in cms/_config.php as locale is not set yet
     CMSMenu::add_link('Help', _t('LeftAndMain.HELP', 'Help', PR_HIGH, 'Menu title'), self::$help_link);
     // set reading lang
     if (Object::has_extension('SiteTree', 'Translatable') && !$this->isAjax()) {
         Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
     }
     // Allow customisation of the access check by a decorator
     // Also all the canView() check to execute Director::redirect()
     if (!$this->canView() && !$this->response->isFinished()) {
         // When access /admin/, we should try a redirect to another part of the admin rather than be locked out
         $menu = $this->MainMenu();
         foreach ($menu as $candidate) {
             if ($candidate->Link && $candidate->Link != $this->Link() && $candidate->MenuItem->controller && singleton($candidate->MenuItem->controller)->canView()) {
                 return Director::redirect($candidate->Link);
             }
         }
         if (Member::currentUser()) {
             Session::set("BackURL", null);
         }
         // if no alternate menu items have matched, return a permission error
         $messageSet = array('default' => _t('LeftAndMain.PERMDEFAULT', "Please choose an authentication method and enter your credentials to access the CMS."), 'alreadyLoggedIn' => _t('LeftAndMain.PERMALREADY', "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' => _t('LeftAndMain.PERMAGAIN', "You have been logged out of the CMS.  If you would like to log in again, enter a username and password below."));
         return Security::permissionFailure($this, $messageSet);
     }
     // Don't continue if there's already been a redirection request.
     if (Director::redirected_to()) {
         return;
     }
     // Audit logging hook
     if (empty($_REQUEST['executeForm']) && !$this->isAjax()) {
         $this->extend('accessedCMS');
     }
     // Set the members html editor config
     HtmlEditorConfig::set_active(Member::currentUser()->getHtmlEditorConfigForCMS());
     // Set default values in the config if missing.  These things can't be defined in the config
     // file because insufficient information exists when that is being processed
     $htmlEditorConfig = HtmlEditorConfig::get_active();
     $htmlEditorConfig->setOption('language', i18n::get_tinymce_lang());
     if (!$htmlEditorConfig->getOption('content_css')) {
         $cssFiles = 'cms/css/editor.css';
         // Use theme from the site config
         if (($config = SiteConfig::current_site_config()) && $config->Theme) {
             $theme = $config->Theme;
         } elseif (SSViewer::current_theme()) {
             $theme = SSViewer::current_theme();
         } else {
             $theme = false;
         }
         if ($theme) {
             $cssFiles .= ',' . THEMES_DIR . "/{$theme}/css/editor.css";
         } else {
             if (project()) {
                 $cssFiles .= ',' . project() . '/css/editor.css';
             }
         }
         $htmlEditorConfig->setOption('content_css', $cssFiles);
     }
     Requirements::css(CMS_DIR . '/css/typography.css');
     Requirements::css(CMS_DIR . '/css/layout.css');
     Requirements::css(CMS_DIR . '/css/cms_left.css');
     Requirements::css(CMS_DIR . '/css/cms_right.css');
     Requirements::css(SAPPHIRE_DIR . '/css/Form.css');
     if (isset($_REQUEST['debug_firebug'])) {
         // Firebug is a useful console for debugging javascript
         // Its available as a Firefox extension or a javascript library
         // for easy inclusion in other browsers (just append ?debug_firebug=1 to the URL)
         Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/firebug-lite/firebug.js');
     } else {
         // By default, we include fake-objects for all firebug calls
         // to avoid javascript errors when referencing console.log() etc in javascript code
         Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/firebug-lite/firebugx.js');
     }
     Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototypefix/intro.js');
     Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
     Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototypefix/outro.js');
     Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
     Requirements::javascript(SAPPHIRE_DIR . '/javascript/jquery_improvements.js');
     Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
     //import all of jquery ui
     Requirements::javascript(CMS_DIR . '/thirdparty/jquery-layout/jquery.layout.js');
     Requirements::javascript(CMS_DIR . '/thirdparty/jquery-layout/jquery.layout.state.js');
//.........这里部分代码省略.........
开发者ID:rodneyway,项目名称:silverstripe-cms,代码行数:101,代码来源:LeftAndMain.php

示例15: array

}
//(v2.4) Log errors to an email address
//SS_Log::add_writer(new SS_LogEmailWriter('me@mydomain.com'), SS_Log::ERR);
//
//(v2.4) Log errors to a file
//SS_Log::add_writer(new SS_LogFileWriter('error_log.txt'), SS_Log::ERR);
//
/**
 * Extended URL rules for the CMS module
 * 
 * @package cms
 */
Director::addRules(50, array('processes//$Action/$ID/$Batch' => 'BatchProcess_Controller', 'admin/help//$Action/$ID' => 'CMSHelp', 'admin/bulkload//$Action/$ID/$OtherID' => 'BulkLoaderAdmin', 'admin/cms//$Action/$ID/$OtherID' => 'CMSMain', 'PageComment//$Action/$ID' => 'PageComment_Controller', 'dev/buildcache/$Action' => 'RebuildStaticCacheTask'));
CMSMenu::add_director_rules();
// Default CMS HTMLEditorConfig
HtmlEditorConfig::get('cms')->setOptions(array('friendly_name' => 'Default CMS', 'priority' => '50', 'mode' => 'none', 'language' => i18n::get_tinymce_lang(), 'body_class' => 'typography', 'document_base_url' => Director::absoluteBaseURL(), 'urlconverter_callback' => "nullConverter", 'setupcontent_callback' => "sapphiremce_setupcontent", 'cleanup_callback' => "sapphiremce_cleanup", 'use_native_selects' => true, 'valid_elements' => "@[id|class|style|title],#a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align],address[class|align],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class]", 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]"));
HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen');
HtmlEditorConfig::get('cms')->enablePlugins(array('ssbuttons' => '../../../cms/javascript/tinymce_ssbuttons/editor_plugin_src.js'));
HtmlEditorConfig::get('cms')->insertButtonsBefore('formatselect', 'styleselect');
HtmlEditorConfig::get('cms')->insertButtonsBefore('advcode', 'ssimage', 'ssflash', 'sslink', 'unlink', 'anchor', 'separator');
HtmlEditorConfig::get('cms')->insertButtonsAfter('advcode', 'fullscreen', 'separator');
HtmlEditorConfig::get('cms')->removeButtons('tablecontrols');
HtmlEditorConfig::get('cms')->addButtonsToLine(3, 'tablecontrols');
// Register default side reports
SS_Report::register("SideReport", "SideReport_EmptyPages");
SS_Report::register("SideReport", "SideReport_RecentlyEdited");
SS_Report::register("SideReport", "SideReport_ToDo");
if (class_exists('SubsiteReportWrapper')) {
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("BrokenLinksReport")', -20);
} else {
    SS_Report::register('ReportAdmin', 'BrokenLinksReport', -20);
开发者ID:Raiser,项目名称:Praktikum,代码行数:31,代码来源:_config.php


注:本文中的i18n::get_tinymce_lang方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。