当前位置: 首页>>代码示例>>PHP>>正文


PHP Doku_Form类代码示例

本文整理汇总了PHP中Doku_Form的典型用法代码示例。如果您正苦于以下问题:PHP Doku_Form类的具体用法?PHP Doku_Form怎么用?PHP Doku_Form使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Doku_Form类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showTemplateSwitcher

 /**
  * Builds a select box with all available templates
  *  (unless excluded in 'excludeTemplates')
  *  or show only two templates for mobile switcher: standard plus mobile template
  *
  * @author Anika Henke <anika@selfthinker.org>
  */
 public function showTemplateSwitcher()
 {
     global $conf;
     global $ID;
     global $ACT;
     if ($ACT != 'show') {
         return;
     }
     $mobileSwitch = $this->getConf('mobileSwitch');
     $mobileTpl = $this->getConf('mobileTemplate');
     if ($mobileSwitch && $mobileTpl) {
         // templates for mobile switcher
         $templates = array($mobileTpl => $this->getLang('switchMobile'), $this->origTpl => $this->getLang('switchFull'));
     } else {
         // all templates (minus excluded templates)
         $excludeTemplates = array_map('trim', explode(",", $this->getConf('excludeTemplates')));
         $templates = array_diff($this->getTemplates(), $excludeTemplates);
     }
     $form = new Doku_Form(array('id' => 'tpl__switcher', 'title' => $this->getLang('switchTpl'), 'action' => wl($ID)));
     $form->addHidden('act', 'select');
     $form->addElement(form_makeListboxField('tpl', $templates, $conf['template'], $this->getLang('template'), '', '', array('class' => 'quickselect')));
     $form->addElement(form_makeButton('submit', '', $this->getLang('switch'), array('name' => 'switch')));
     $out = '<div class="plugin_loadskin">';
     $out .= $form->getForm();
     $out .= '</div>';
     return $out;
 }
开发者ID:iiet,项目名称:dokuwiki-plugin-loadskin,代码行数:34,代码来源:helper.php

示例2: _render

 function _render($act)
 {
     global $ID;
     $form = new Doku_Form(array('id' => 'forcessllogin1', 'action' => 'https://' . $this->host() . DOKU_BASE . DOKU_SCRIPT, 'method' => 'get'));
     $form->addHidden('id', $ID);
     $form->addHidden('do', $act);
     if ($this->getConf('cert')) {
         if (strpos($this->getLang('certinfo'), '{{name}}') !== false) {
             $form->addElement('<p>' . str_replace('{{name}}', $this->getConf('cert'), $this->getLang('certinfo')) . '</p>' . NL);
         } else {
             $form->addElement('<p>' . $this->getLang('certinfo') . " " . $this->getConf('cert') . '</p>' . NL);
         }
     }
     if ($this->getConf('ca')) {
         if (strpos($this->getLang('ca'), '{{name}}') !== false) {
             $form->addElement('<p>' . str_replace('{{name}}', $this->getConf('ca'), $this->getLang('cainfo')) . '</p>' . NL);
         } else {
             $form->addElement('<p>' . $this->getLang('cainfo') . " <a href='" . $this->getConf('ca') . "'>" . $this->getConf('ca') . "</a></p>" . NL);
         }
     }
     $form->addElement(form_makeButton('submit', '', $this->getLang('submit'), array('accesskey' => 'h', 'title' => $this->getLang('submittitle'), id => 'focus__this')));
     $form->printForm();
     $form = new Doku_Form(array('id' => 'forcessllogin2', 'method' => 'get'));
     $form->addElement(form_makeButton('submit', '', $this->getLang('cancel'), array('accesskey' => 'c', 'title' => $this->getLang('canceltitle'))));
     $form->printForm();
 }
开发者ID:jomat,项目名称:dokuwiki-plugin-forcessllogin,代码行数:26,代码来源:action.php

示例3: tplMetaDataForm

 public function tplMetaDataForm(Doku_Event &$event)
 {
     if ($event->data != 'social_form') {
         return;
     }
     global $ID;
     echo '<div class="plugin_social">';
     echo '<div class="form" id="pluginsocialform" >';
     $form = new Doku_Form(array());
     $form->addHidden('target', 'plugin_social');
     $form->addHidden('id', $ID);
     $form->addHidden('do', 'social_save');
     foreach (helper_plugin_social_meta::$metaEditableKeys as $type => $values) {
         $form->addElement('<div>');
         $form->startFieldset($type);
         foreach ($values as $value) {
             $metadata = $this->helper->meta->getMetaData();
             $name = $this->helper->meta->getMetaPropertyName($type, $value);
             $form->addElement(form_makeTextField($name, $metadata[$name], $name, null, 'block'));
         }
         $form->endFieldset();
         $form->addElement('</div>');
     }
     $form->addElement(form_makeButton('submit', null, $this->getLang('btnSave')));
     html_form('', $form);
     echo '</div>';
     echo '</div>';
     $event->preventDefault();
 }
开发者ID:cevro,项目名称:dokuwiki-plugin-social,代码行数:29,代码来源:action.php

示例4: renderfield

 /**
  * Render the field as XHTML
  *
  * Outputs the represented field using the passed Doku_Form object.
  * Additional parameters (CSS class & HTML name) are passed in $params.
  *
  * @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->_handlePreload();
     if (!$form->_infieldset) {
         $form->startFieldset('');
     }
     if ($this->error) {
         $params['class'] = 'bureaucracy_error';
     }
     $params = array_merge($this->opt, $params);
     list($name, $entries, $value, $label, $id, $class) = $this->_parse_tpl(array('@@NAME@@', $params['args'], '@@VALUE@@', '@@DISPLAY@@', '@@ID@@', '@@CLASS@@'), $params);
     $value = in_array($value, $entries) ? $value : null;
     $valueoffieldwithid = $value !== null ? $value : current($entries);
     // label
     $s = '<label';
     $s .= ' class="radiolabel ' . $class . '"';
     $s .= '><span>' . $label . '</span>';
     $s .= '</label>';
     $form->addElement($s);
     // radio fields
     foreach ($entries as $val) {
         if ($value === $val) {
             $attrs = array('checked' => 'checked');
         } else {
             $attrs = array();
         }
         if ($valueoffieldwithid === $val) {
             $_id = $id;
             //e.g. autofocus with 'focus__this' id
         } else {
             $_id = '';
         }
         $form->addElement(form_makeRadioField($name, $val, $val, $_id, $class, $attrs));
     }
 }
开发者ID:rusidea,项目名称:analitika,代码行数:45,代码来源:fieldradio.php

示例5: html

 function html()
 {
     echo $this->locale_xhtml('intro_clean');
     $form = new Doku_Form(array('method' => 'post'));
     $form->addHidden('page', 'data_clean');
     $form->addHidden('data_go', 'go');
     $form->addElement(form_makeButton('submit', 'admin', $this->getLang('submit_clean')));
     $form->printForm();
 }
开发者ID:stretchyboy,项目名称:dokuwiki-plugin-data,代码行数:9,代码来源:clean.php

示例6: renderfield

 /**
  * Render the field as XHTML
  *
  * Outputs the represented field using the passed Doku_Form object.
  * Additional parameters (CSS class & HTML name) are passed in $params.
  *
  * @params array     $params Additional HTML specific parameters
  * @params Doku_Form $form   The target Doku_Form object
  */
 public function renderfield($params, Doku_Form $form)
 {
     $this->_handlePreload();
     if (!$form->_infieldset) {
         $form->startFieldset('');
     }
     if ($this->error) {
         $params['class'] = 'bureaucracy_error';
     }
     $params = array_merge($this->opt, $params);
     $form->addElement(call_user_func_array('form_makeListboxField', $this->_parse_tpl(array('@@NAME@@', $params['args'], '@@VALUE|' . $params['args'][0] . '@@', '@@DISPLAY@@', '', '@@CLASS@@'), $params)));
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:21,代码来源:select.php

示例7: renderfield

 /**
  * Render the top of the fieldset 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
  */
 function renderfield($params, Doku_Form $form, $formid)
 {
     $form->startFieldset(hsc($this->getParam('display')));
     if (isset($this->depends_on)) {
         $dependencies = array_map('hsc', (array) $this->depends_on);
         if (count($this->depends_on) > 1) {
             $msg = 'Only edit this fieldset if ' . '“<span class="bureaucracy_depends_fname">%s</span>” ' . 'is set to “<span class="bureaucracy_depends_fvalue">%s</span>”.';
         } else {
             $msg = 'Only edit this fieldset if ' . '“<span class="bureaucracy_depends_fname">%s</span>” is set.';
         }
         $form->addElement('<p class="bureaucracy_depends">' . vsprintf($msg, $dependencies) . '</p>');
     }
 }
开发者ID:elaratain,项目名称:dokuwiki-plugin-bureaucracy,代码行数:20,代码来源:fieldfieldset.php

示例8: xhtml

 public function xhtml($editor_id, $do)
 {
     $controls = '<div>';
     if (!$this->read_only) {
         $form = new Doku_Form(array('class' => 'editor_edit_form', 'editor' => $editor_id));
         $form->addElement(form_makeButton('submit', '', 'edit'));
         $controls .= $form->getForm();
         $controls .= '<div class="editor_save_controls">';
         $form = new Doku_Form(array('class' => 'editor_save_form', 'editor' => $editor_id));
         $form->addElement(form_makeButton('submit', 'savecontent', 'save'));
         $controls .= $form->getForm() . cancel_button() . '</div>';
     }
     return $controls . $this->editor_xhtml($editor_id, $do) . '</div>';
 }
开发者ID:roverrobot,项目名称:projects,代码行数:14,代码来源:editor.php

示例9: test_close_fieldset

 function test_close_fieldset()
 {
     $form = new Doku_Form(array('id' => 'dw__testform', 'action' => '/test'));
     $form->startFieldset('Test');
     $form->addHidden('summary', 'changes &c');
     $form->addElement(form_makeTextField('t', 'v', 'Text', 'text__id', 'block'));
     $form->addElement(form_makeCheckboxField('r', '1', 'Check', 'check__id', 'simple'));
     $form->addElement(form_makeButton('submit', 'save', 'Save', array('accesskey' => 's')));
     $form->addElement(form_makeButton('submit', 'cancel', 'Cancel'));
     ob_start();
     $form->printForm();
     $output = ob_get_contents();
     ob_end_clean();
     $this->assertEquals($this->_ignoreTagWS($output), $this->_ignoreTagWS($this->_realoutput()));
 }
开发者ID:kbuildsyourdotcom,项目名称:Door43,代码行数:15,代码来源:form_form.test.php

示例10: xhtml_action

function xhtml_action($action, $title, $hidden_fields = array(), $fields = array())
{
    $hidden_fields['do'] = $action;
    $name = preg_replace('/[^0-9A-Za-z_]+/', '_', $title);
    $formID = "PROJECTS_{$name_form}";
    $form = new Doku_Form(array('id' => $formID));
    foreach ($hidden_fields as $name => $value) {
        $form->addHidden($name, $value);
    }
    foreach ($fields as $field) {
        $form->addElement($field);
    }
    $form->addElement("<a href=\"\" class=\"action_link\">{$title}</a>");
    return '<span class="action">' . $form->getForm() . '</span>';
}
开发者ID:roverrobot,项目名称:projects,代码行数:15,代码来源:xhtml.php

示例11: renderfield

 /**
  * Render the field as XHTML
  *
  * @params array     $params Additional HTML specific parameters
  * @params Doku_Form $form   The target Doku_Form object
  */
 public function renderfield($params, Doku_Form $form)
 {
     if (!syntax_plugin_bureaucracy_field_submit::$captcha_displayed) {
         syntax_plugin_bureaucracy_field_submit::$captcha_displayed = 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());
         }
     }
     $this->tpl = form_makeButton('submit', '', '@@DISPLAY|' . $this->getLang('submit') . '@@');
     parent::renderfield($params, $form);
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:22,代码来源:submit.php

示例12: action_button

function action_button($button_name, $action = '', $hidden = NULL)
{
    global $ID;
    $form = new Doku_Form('Form_' . $button_name);
    if (!$action) {
        $action = $button_name;
    }
    $form->addHidden('do', $action);
    if (is_array($hidden)) {
        foreach ($hidden as $key => $value) {
            $form->addHidden($key, $value);
        }
    }
    $form->addElement(form_makeButton('submit', '', $button_name));
    return $form->getForm();
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:16,代码来源:tools.php

示例13: renderfield

 /**
  * Creates the HTML for the field
  *
  * @param array $params
  * @param Doku_Form $form
  * @param int $formid
  */
 public function renderfield($params, Doku_Form $form, $formid)
 {
     if (!$this->column) {
         return;
     }
     // this is what parent does
     $this->_handlePreload();
     if (!$form->_infieldset) {
         $form->startFieldset('');
     }
     if ($this->error) {
         $params['class'] = 'bureaucracy_error';
     }
     // output the field
     $value = new Value($this->column, $this->opt['value']);
     $field = $this->makeField($value, $params['name']);
     $form->addElement($field);
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:25,代码来源:field.php

示例14: renderfield

 /**
  * 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);
 }
开发者ID:rusidea,项目名称:analitika,代码行数:27,代码来源:fieldsubmit.php

示例15: html

 function html()
 {
     $sqlite = $this->dthlp->_getDB();
     if (!$sqlite) {
         return false;
     }
     echo $this->locale_xhtml('admin_intro');
     $sql = "SELECT * FROM aliases ORDER BY name";
     $res = $sqlite->query($sql);
     $rows = $sqlite->res2arr($res);
     $form = new Doku_Form(array('method' => 'post'));
     $form->addHidden('page', 'data_aliases');
     $form->addElement('<table class="inline">' . '<tr>' . '<th>' . $this->getLang('name') . '</th>' . '<th>' . $this->getLang('type') . '</th>' . '<th>' . $this->getLang('prefix') . '</th>' . '<th>' . $this->getLang('postfix') . '</th>' . '<th>' . $this->getLang('enum') . '</th>' . '</tr>');
     // add empty row for adding a new entry
     $rows[] = array('name' => '', 'type' => '', 'prefix' => '', 'postfix' => '', 'enum' => '');
     $cur = 0;
     foreach ($rows as $row) {
         $form->addElement('<tr>');
         $form->addElement('<td>');
         $form->addElement(form_makeTextField('d[' . $cur . '][name]', $row['name'], ''));
         $form->addElement('</td>');
         $form->addElement('<td>');
         $form->addElement(form_makeMenuField('d[' . $cur . '][type]', array('', 'page', 'title', 'mail', 'url', 'dt', 'wiki'), $row['type'], ''));
         $form->addElement('</td>');
         $form->addElement('<td>');
         $form->addElement(form_makeTextField('d[' . $cur . '][prefix]', $row['prefix'], ''));
         $form->addElement('</td>');
         $form->addElement('<td>');
         $form->addElement(form_makeTextField('d[' . $cur . '][postfix]', $row['postfix'], ''));
         $form->addElement('</td>');
         $form->addElement('<td>');
         $form->addElement(form_makeTextField('d[' . $cur . '][enum]', $row['enum'], ''));
         $form->addElement('</td>');
         $form->addElement('</tr>');
         $cur++;
     }
     $form->addElement('</table>');
     $form->addElement(form_makeButton('submit', 'admin', $this->getLang('submit')));
     $form->printForm();
 }
开发者ID:stretchyboy,项目名称:dokuwiki-plugin-data,代码行数:40,代码来源:aliases.php


注:本文中的Doku_Form类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。