コード例 #1
0
ファイル: fieldstatic.php プロジェクト: rusidea/analitika
 /**
  * Render the field as XHTML
  *
  * @params array     $params Additional HTML specific parameters
  * @params Doku_Form $form   The target Doku_Form object
  * @params int       $formid unique identifier of the form which contains this field
  */
 public function renderfield($params, Doku_Form $form, $formid)
 {
     if (!isset($this->opt['display'])) {
         $this->opt['display'] = $this->opt['label'];
     }
     parent::renderfield($params, $form, $formid);
 }
コード例 #2
0
ファイル: fieldsubmit.php プロジェクト: rusidea/analitika
 /**
  * Render the field as XHTML
  *
  * @params array     $params Additional HTML specific parameters
  * @params Doku_Form $form   The target Doku_Form object
  * @params int       $formid unique identifier of the form which contains this field
  */
 public function renderfield($params, Doku_Form $form, $formid)
 {
     if (!isset(helper_plugin_bureaucracy_fieldsubmit::$captcha_displayed[$formid])) {
         helper_plugin_bureaucracy_fieldsubmit::$captcha_displayed[$formid] = true;
         /** @var helper_plugin_captcha $helper */
         $helper = null;
         if (@is_dir(DOKU_PLUGIN . 'captcha')) {
             $helper = plugin_load('helper', 'captcha');
         }
         if (!is_null($helper) && $helper->isEnabled()) {
             $form->addElement($helper->getHTML());
         }
     }
     $attr = array();
     if (isset($this->opt['id'])) {
         $attr['id'] = $this->opt['id'];
     }
     $this->tpl = form_makeButton('submit', '', '@@DISPLAY|' . $this->getLang('submit') . '@@', $attr);
     parent::renderfield($params, $form, $formid);
 }
コード例 #3
0
 /**
  * Render the field as XHTML
  *
  * Creates a single line input field or select field
  *
  * @params array     $params Additional HTML specific parameters
  * @params Doku_Form $form   The target Doku_Form object
  * @params int       $formid unique identifier of the form which contains this field
  */
 public function renderfield($params, Doku_Form $form, $formid)
 {
     $this->prepareColumns($this->args);
     if (isset($this->tpl)) {
         parent::renderfield($params, $form, $formid);
     } else {
         // Is an enum type, otherwise $this->tpl would be set in __construct
         $this->_handlePreload();
         if (!$form->_infieldset) {
             $form->startFieldset('');
         }
         if ($this->error) {
             $params['class'] = 'bureaucracy_error';
         }
         $params = array_merge($this->opt, $params);
         $params['value'] = preg_split('/\\s*,\\s*/', $params['value'], -1, PREG_SPLIT_NO_EMPTY);
         if (count($params['value']) === 0) {
             $params['value'] = $params['args'][0];
         }
         if (!isset($this->opt['optional'])) {
             $this->additional['required'] = 'required';
         }
         $form->addElement(call_user_func_array('form_makeListboxField', $this->_parse_tpl(array('@@NAME@@[]', $params['args'], $params['value'], '@@DISPLAY@@', '', '@@CLASS@@', $this->additional), $params)));
     }
 }
コード例 #4
0
ファイル: fieldyesno.php プロジェクト: rusidea/analitika
 /**
  * Render the field as XHTML
  *
  * @params array     $params Additional HTML specific parameters
  * @params Doku_Form $form   The target Doku_Form object
  * @params int       $formid unique identifier of the form which contains this field
  */
 public function renderfield($params, Doku_Form $form, $formid)
 {
     $id = 'bureaucracy__' . md5(rand());
     if (isset($this->opt['id'])) {
         $id = $this->opt['id'];
     }
     $params = array_merge(array('value' => false), $this->opt, $params);
     $check = $params['value'] ? 'checked="checked"' : '';
     $this->tpl = '<label class="@@CLASS@@" for="' . $id . '"><span>@@DISPLAY@@</span>' . '<input type="hidden" name="@@NAME@@" value="0" />' . '<input type="checkbox" name="@@NAME@@" value="1" id="' . $id . '" ' . $check . ' />' . '</label>';
     parent::renderfield($params, $form, $formid);
 }