Esempio n. 1
0
 /**
  * Initializes the widget options.
  * This method sets the default values for various options.
  */
 protected function _initOptions()
 {
     if ($this->preset) {
         $options = CKEditorPresets::getPresets($this->preset);
     }
     $this->clientOptions = ArrayHelper::merge($options, $this->clientOptions);
 }
Esempio n. 2
0
 /**
  * Настройки для Ckeditor, по умолчанию
  * @return array
  */
 public function getCkeditorOptions()
 {
     $clientOptions = ['height' => $this->ckeditorHeight, 'skin' => $this->ckeditorSkin, 'codeSnippet_theme' => $this->ckeditorCodeSnippetTheme];
     if ($this->ckeditorCodeSnippetGeshi == Cms::BOOL_Y) {
         $clientOptions['codeSnippetGeshi_url'] = '../lib/colorize.php';
         $preset = CKEditorPresets::getPresets($this->ckeditorPreset);
         $extraplugins = ArrayHelper::getValue($preset, 'extraPlugins', "");
         if ($extraplugins) {
             $extraplugins = explode(",", $extraplugins);
         }
         $extraplugins = array_merge($extraplugins, ['codesnippetgeshi']);
         $extraplugins = array_unique($extraplugins);
         $clientOptions['extraPlugins'] = implode(',', $extraplugins);
     }
     return ['preset' => $this->ckeditorPreset, 'clientOptions' => $clientOptions];
 }