/** * @return \Nette\Utils\Html */ public function getControl() { $control = parent::getControl(); $control->class[] = 'editor-input ckeditor'; $control->data('novalidate', ''); return $control; }
public function getValue() { $args = new ContentEditorArgs(); $args->setValue(parent::getValue()); $this->eventManager->dispatchEvent(ContentEditorEvents::onContentEditorSave, $args); $value = $args->getValue(); return $value; }
/** * @param string $apiKey * @param string $secretKey * @param string $label * @throws Exception */ public function __construct($apiKey, $secretKey, $label = NULL) { parent::__construct($label); $this->setApiKey($apiKey); $this->setSecretKey($secretKey); $this->setOmitted(); $this->addRule(array($this, 'validateRecaptcha'), ''); }
/** * Generates control"s HTML element. * @return Html */ public function getControl() { $container = Html::el(); $container->add(parent::getControl()->style("width: 100%;")); $script = Html::el(); if ($this->type == 'min') { $script->setHtml('<script type="text/javascript" src="/ckeditor/ckeditor.js"></script> <script type="text/javascript"> CKEDITOR.replace( "' . $this->getHtmlId() . '", { toolbar : [ { name: "clipboard", items : [ "Cut","Copy","PasteText","-","Undo","Redo" ] }, { name: "basicstyles", items : [ "Bold","Italic","-","RemoveFormat" ] } , { name: "document", items : [ "Source" ] }, ], filebrowserBrowseUrl : "/ckeditor/filemanager/browser/default/browser.html?Connector=/ckeditor/filemanager/connectors/php/connector.php", filebrowserImageBrowseUrl : "/ckeditor/filemanager/browser/default/browser.html?Type=Image&Connector=/ckeditor/filemanager/connectors/php/connector.php", filebrowserFlashBrowseUrl : "/ckeditor/filemanager/browser/default/browser.html?Type=Flash&Connector=/ckeditor/filemanager/connectors/php/connector.php" }); </script> '); } else { $script->setHtml('<script type="text/javascript" src="/ckeditor/ckeditor.js"></script> <script type="text/javascript"> CKEDITOR.replace( "' . $this->getHtmlId() . '", { toolbar : [ { name: "clipboard", items : [ "Cut","Copy","PasteText","-","Undo","Redo" ] }, { name: "basicstyles", items : [ "Bold","Italic","Strike","Subscript","Superscript","-","RemoveFormat" ] } , { name: "insert", items : [ "Image","Youtube","Table","HorizontalRule" ] }, { name: "styles", items : [ "Styles","Format","Font","FontSize","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyRight" ] }, { name: "paragraph", items : [ "NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote" ] }, { name: "links", items : [ "Link","Unlink","Anchor" ] }, { name: "colors", items : [ "TextColor","BGColor" ] }, { name: "document", items : [ "Source" ] }, ], filebrowserBrowseUrl : "/ckeditor/filemanager/browser/default/browser.html?Connector=/ckeditor/filemanager/connectors/php/connector.php", filebrowserImageBrowseUrl : "/ckeditor/filemanager/browser/default/browser.html?Type=Image&Connector=/ckeditor/filemanager/connectors/php/connector.php", filebrowserFlashBrowseUrl : "/ckeditor/filemanager/browser/default/browser.html?Type=Flash&Connector=/ckeditor/filemanager/connectors/php/connector.php", extraAllowedContent: "a span" }); </script> '); } $container->add($script); return $container; }
/** * Adds multi-line text input control to the form. * @param string control name * @param string label * @param int width of the control * @param int height of the control in text lines * @return Nette\Forms\Controls\TextArea */ public function addTextArea($name, $label = NULL, $cols = NULL, $rows = NULL) { $control = new Controls\TextArea($label); $control->setAttribute('cols', $cols)->setAttribute('rows', $rows); return $this[$name] = $control; }
/** * @return \Nette\Utils\Html */ public function getControl() { $control = parent::getControl(); $control->appendAttribute('class', ['editor-input', 'ckeditor']); return $control; }
/** * Adds multi-line text input control to the form. * @param string control name * @param string label * @param int width of the control * @param int height of the control in text lines * @return Nette\Forms\Controls\TextArea */ public function addTextArea($name, $label = NULL, $cols = NULL, $rows = NULL) { $control = new Controls\TextArea($label); if ($cols || $rows) { trigger_error(__METHOD__ . '() parameters $cols and $rows are deprecated, use setAttribute(...).', E_USER_DEPRECATED); $control->setAttribute('cols', $cols)->setAttribute('rows', $rows); } return $this[$name] = $control; }
/** * @param string $label */ public function __construct($label = NULL) { parent::__construct($label); $this->setOmitted(); $this->addRule([$this, 'validateRecaptcha']); }