Esempio n. 1
0
 public function __construct($name, $label, $options = null)
 {
     Asset::wysiwyg();
     parent::__construct($name, $label, $options);
     $this->setView('administr/form::textarea');
     $this->options['class'] = array_get($this->getOptions(), 'class') . ' administr-wysiwyg';
 }
Esempio n. 2
0
 /**
  * Constructor.
  *
  * @param string $name
  * @param string $pluginKey
  * @param array $buttons
  */
 public function __construct($name, $pluginKey = 'blog', array $buttons = array())
 {
     parent::__construct($name);
     $this->pluginKey = $pluginKey;
     $this->textFormatService = BOL_TextFormatService::getInstance();
     // init list of buttons
     if (!empty($buttons)) {
         $this->buttons = $buttons;
     }
     // remove image and video buttons
     if (!$this->textFormatService->isRichMediaAllowed()) {
         $imageIndex = array_search(BOL_TextFormatService::WS_BTN_IMAGE, $this->buttons);
         if ($imageIndex !== false) {
             unset($this->buttons[$imageIndex]);
         }
         $videoIndex = array_search(BOL_TextFormatService::WS_BTN_VIDEO, $this->buttons);
         if ($videoIndex !== false) {
             unset($this->buttons[$videoIndex]);
         }
     }
     $stringValidator = new StringValidator(0, 50000);
     $stringValidator->setErrorMessage(OW::getLanguage()->text('base', 'text_is_too_long', array('max_symbols_count' => 50000)));
     $this->addValidator($stringValidator);
 }
Esempio n. 3
0
 public function __construct()
 {
     parent::__construct();
     $this->set('list', false);
     $this->data('module', 'format-code');
 }
Esempio n. 4
0
 public function __construct($name)
 {
     parent::__construct($name);
     OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('photo')->getStaticCssUrl() . 'edit_photo.css');
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('photo')->getStaticJsUrl() . 'codemirror.min.js');
 }