예제 #1
0
파일: select.php 프로젝트: s-kalaus/ekernel
 public function __construct($name, $param = array())
 {
     parent::__construct($name, $param);
     if (isset($param['chosen']) && $param['chosen'] != false) {
         if (!$param['chosen'] instanceof data) {
             $param['chosen'] = new data();
         }
         if (!isset($param['chosen']->css)) {
             $param['chosen']->css = true;
         }
         $this->chosen = $param['chosen'];
     }
     if (isset($param['uniform'])) {
         if (!$param['uniform'] instanceof data) {
             $param['uniform'] = new data();
         }
         if (!isset($param['uniform']->css)) {
             $param['uniform']->css = true;
         }
         $this->uniform = $param['uniform'];
     }
     if (isset($param['multiple'])) {
         $this->multiple = $param['multiple'];
     }
 }
예제 #2
0
 public function __construct($name, $param = array())
 {
     parent::__construct($name, $param);
     if (isset($param['markitup'])) {
         if (!$param['markitup'] instanceof data) {
             $param['markitup'] = new data(is_array($param['markitup']) ? $param['markitup'] : array());
         }
         if (!isset($param['markitup']->opt)) {
             $param['markitup']->opt = new data();
         }
         if (!isset($param['markitup']->set)) {
             $param['markitup']->set = new data();
         }
         if (!isset($param['markitup']->style)) {
             $param['markitup']->style = 'html';
         }
         if (!isset($param['markitup']->skin)) {
             $param['markitup']->skin = 'markitup';
         }
         if (!isset($param['markitup']->class)) {
             $param['markitup']->class = '';
         }
         $param['markitup']->set = array('def' => array(), 'html' => array('onShiftEnter' => array('keepDefault' => false, 'replaceWith' => "<br />\n"), 'onCtrlEnter' => array('keepDefault' => false, 'openWith' => "\n<p>", 'closeWith' => "</p>\n"), 'onTab' => array('keepDefault' => false, 'openWith' => '	 '), 'markupSet' => array(array('name' => 'Heading 1', 'key' => '1', 'openWith' => '<h1(!( class="[![Class]!]")!)>', 'closeWith' => '</h1>', 'placeHolder' => 'Your title here...'), array('name' => 'Heading 2', 'key' => '2', 'openWith' => '<h2(!( class="[![Class]!]")!)>', 'closeWith' => '</h2>', 'placeHolder' => 'Your title here...'), array('name' => 'Heading 3', 'key' => '3', 'openWith' => '<h3(!( class="[![Class]!]")!)>', 'closeWith' => '</h3>', 'placeHolder' => 'Your title here...'), array('name' => 'Heading 4', 'key' => '4', 'openWith' => '<h4(!( class="[![Class]!]")!)>', 'closeWith' => '</h4>', 'placeHolder' => 'Your title here...'), array('name' => 'Heading 5', 'key' => '5', 'openWith' => '<h5(!( class="[![Class]!]")!)>', 'closeWith' => '</h5>', 'placeHolder' => 'Your title here...'), array('name' => 'Heading 6', 'key' => '6', 'openWith' => '<h6(!( class="[![Class]!]")!)>', 'closeWith' => '</h6>', 'placeHolder' => 'Your title here...'), array('name' => 'Paragraph', 'openWith' => '<p(!( class="[![Class]!]")!)>', 'closeWith' => '</p>'), array('separator' => '---------------'), array('name' => 'Bold', 'key' => 'B', 'openWith' => '(!(<strong>|!|<b>)!)', 'closeWith' => '(!(</strong>|!|</b>)!)'), array('name' => 'Italic', 'key' => 'I', 'openWith' => '(!(<em>|!|<i>)!)', 'closeWith' => '(!(</em>|!|</i>)!)'), array('name' => 'Stroke through', 'key' => 'S', 'openWith' => '<del>', 'closeWith' => '</del>'), array('separator' => '---------------'), array('name' => 'Ul', 'openWith' => "<ul>\n", 'closeWith' => "</ul>\n"), array('name' => 'Ol', 'openWith' => "<ol>\n", 'closeWith' => "</ol>\n"), array('name' => 'Li', 'openWith' => '<li>', 'closeWith' => '</li>'), array('separator' => '---------------'), array('name' => 'Picture', 'key' => 'P', 'replaceWith' => '<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />'), array('name' => 'Link', 'key' => 'L', 'openWith' => '<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', 'closeWith' => '</a>', 'placeHolder' => 'Your text to link...'), array('separator' => '---------------'), array('name' => 'Clean', 'className' => 'clean', 'replaceWith' => new Zend\Json\Expr('function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") }')), array('name' => 'Preview', 'className' => 'preview', 'call' => 'preview'))));
         $param['markitup']->opt = $param['markitup']->set->def;
         $param['markitup']->opt = $param['markitup']->set->{$param['markitup']->style};
         if (!$param['markitup']->set_style) {
             $param['markitup']->set_style = '/' . DIR_KERNEL . '/ctl/markitup/sets/' . $this->markitup->style . '/style.css';
         }
         $this->markitup = $param['markitup'];
     }
     if (isset($param['ckeditor'])) {
         if (!$param['ckeditor'] instanceof data) {
             $param['ckeditor'] = new data(is_array($param['ckeditor']) ? $param['ckeditor'] : array());
         }
         if (!isset($param['ckeditor']->opt)) {
             $param['ckeditor']->opt = new data();
         }
         if (!isset($param['ckeditor']->set)) {
             $param['ckeditor']->set = new data();
         }
         if (!isset($param['ckeditor']->style)) {
             $param['ckeditor']->style = 'full';
         }
         if (!isset($param['ckeditor']->class)) {
             $param['ckeditor']->class = '';
         }
         $param['ckeditor']->set = array('def' => array('width' => '100%', 'allowedContent' => true, 'forcePasteAsPlainText' => true), 'full' => array('toolbar' => array(array('name' => 'basicstyles', 'items' => array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', 'Blockquote', '-', 'RemoveFormat')), array('name' => 'styles', 'items' => array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock')), array('name' => 'paragraph', 'items' => array('NumberedList', 'BulletedList', 'Outdent', 'Indent')), array('name' => 'links', 'items' => array('Link', 'Unlink', 'Anchor')), array('name' => 'insert', 'items' => array('Image', 'Flash')), '/', array('name' => 'clipboard', 'items' => array('PasteText', 'PasteFromWord')), array('name' => 'styles', 'items' => array('Format', 'Font', 'FontSize')), array('name' => 'colors1', 'items' => array('TextColor', 'BGColor')), array('name' => 'colors2', 'items' => array('Table')), array('name' => 'tools1', 'items' => array('PageBreak')), array('name' => 'tools2', 'items' => array('Maximize')), array('name' => 'tools3', 'items' => array('Source'))), 'plugins' => 'dialogadvtab,basicstyles,colorbutton,resize,toolbar,elementspath,list,indent,enterkey,filebrowser,flash,font,format,htmlwriter,wysiwygarea,image,justify,link,liststyle,maximize,pagebreak,pastetext,pastefromword,removeformat,sourcearea,table,tabletools,blockquote'), 'small' => array());
         $param['ckeditor']->opt = $param['ckeditor']->set->def;
         $param['ckeditor']->opt = $param['ckeditor']->set->{$param['ckeditor']->style};
         $this->ckeditor = $param['ckeditor'];
     }
     if (isset($param['cols'])) {
         $this->cols = $param['cols'];
     }
     if (isset($param['rows'])) {
         $this->rows = $param['rows'];
     }
 }
 /**
  * @param string $name
  * @param string $label
  * @param string $value
  * @param string $info_text
  * @param bool $checked
  * @param bool $required
  * @param string $class CSS rule class
  */
 public function __construct($params)
 {
     extract($params);
     parent::__construct($params);
     if ($this->default_value == $params['value']) {
         $params['checked'] = true;
     }
     if (!empty($params['class'])) {
         $this->classes[] = $params['class'];
     }
     $this->classes[] = 'radio';
     $params['class'] = $this->get_classes_string();
     if (!empty($params['required'])) {
         $params['data-required'] = true;
     }
     unset($params['required']);
     if (!empty($this->extra_html)) {
         foreach ($this->extra_html as $html_param => $value) {
             $params[$html_param] = $value;
         }
         unset($params['extra_html']);
     }
     $this->html = form_radio($params);
 }
예제 #4
0
파일: input.php 프로젝트: s-kalaus/ekernel
 public function __construct($name, $param = array())
 {
     parent::__construct($name, $param);
     $this->type = isset($param['type']) ? $param['type'] : 'text';
 }
 public function __construct($label, $params, $required = false, $info_text = null)
 {
     parent::__construct($params['name'], $label, $required, $info_text);
     if ($this->default_value) {
         $params['checked'] = true;
     }
     $params['class'] = ' form-control';
     $this->html = form_radio($params);
 }