Example #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);
 }
Example #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];
 }
Example #3
0
    <?php 
echo $form->fieldInputInt($model, 'pageSize');
?>
    <?php 
echo $form->field($model, 'pageParamName')->textInput();
echo $form->fieldSetEnd();
?>

<?php 
echo $form->fieldSet(\Yii::t('app', 'Setting the visual editor'));
?>
    <?php 
echo $form->fieldSelect($model, 'ckeditorPreset', \skeeks\yii2\ckeditor\CKEditorPresets::allowPresets());
?>
    <?php 
echo $form->fieldSelect($model, 'ckeditorSkin', \skeeks\yii2\ckeditor\CKEditorPresets::skins());
?>
    <?php 
echo $form->fieldInputInt($model, 'ckeditorHeight');
?>
    <?php 
echo $form->fieldRadioListBoolean($model, 'ckeditorCodeSnippetGeshi')->hint(\Yii::t('app', 'It will be activated this plugin') . ' http://ckeditor.com/addon/codesnippetgeshi');
?>
    <?php 
echo $form->fieldSelect($model, 'ckeditorCodeSnippetTheme', ['monokai_sublime' => 'monokai_sublime', 'default' => 'default', 'arta' => 'arta', 'ascetic' => 'ascetic', 'atelier-dune.dark' => 'atelier-dune.dark', 'atelier-dune.light' => 'atelier-dune.light', 'atelier-forest.dark' => 'atelier-forest.dark', 'atelier-forest.light' => 'atelier-forest.light', 'atelier-heath.dark' => 'atelier-heath.dark', 'atelier-heath.light' => 'atelier-heath.light', 'atelier-lakeside.dark' => 'atelier-lakeside.dark', 'atelier-lakeside.light' => 'atelier-lakeside.light'])->hint('https://highlightjs.org/static/demo/ - ' . \Yii::t('app', 'topics'));
echo $form->fieldSetEnd();
?>

<?php 
echo $form->fieldSet(\Yii::t('app', 'Security'));
?>