/** * Form to request a new password for an existing account * * @author Benoit Chesneau <*****@*****.**> */ function html_resendpwd() { global $lang; global $conf; global $ID; print p_locale_xhtml('resendpwd'); print '<div class="centeralign">' . NL; $form = new Doku_Form(array('id' => 'dw__resendpwd')); $form->startFieldset($lang['resendpwd']); $form->addHidden('do', 'resendpwd'); $form->addHidden('save', '1'); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTextField('login', $_POST['login'], $lang['user'], '', 'block')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeButton('submit', '', $lang['btn_resendpwd'])); $form->endFieldset(); html_form('resendpwd', $form); print '</div>' . NL; }
/** * Return the search form for the namespace and the tag selection * * @return string the HTML code of the search form */ private function getForm() { global $conf, $lang; // Get the list of all namespaces for the dropdown $namespaces = array(); search($namespaces, $conf['datadir'], 'search_namespaces', array()); // build the list in the form value => label from the namespace search result $ns_select = array('' => ''); foreach ($namespaces as $ns) { // only display namespaces the user can access when sneaky index is on if ($ns['perm'] > 0 || $conf['sneaky_index'] == 0) { $ns_select[$ns['id']] = $ns['id']; } } $form = new Doku_Form(array('action' => '', 'method' => 'post', 'class' => 'plugin__tag_search')); // add a paragraph around the inputs in order to get some margin around the form elements $form->addElement(form_makeOpenTag('p')); // namespace select $form->addElement(form_makeMenuField('plugin__tag_search_namespace', $ns_select, $this->getNS(), $lang['namespaces'])); // checkbox for AND $attr = array(); if ($this->useAnd()) { $attr['checked'] = 'checked'; } $form->addElement(form_makeCheckboxField('plugin__tag_search_and', 1, $this->getLang('use_and'), '', '', $attr)); $form->addElement(form_makeCloseTag('p')); // load the tag list - only tags that actually have pages assigned that the current user can access are listed /* @var helper_plugin_tag $my */ if ($my =& plugin_load('helper', 'tag')) { $tags = $my->tagOccurrences(array(), NULL, true); } // sort tags by name ($tags is in the form $tag => $count) ksort($tags); // display error message when no tags were found if (!isset($tags) || $tags == NULL) { $form->addElement(form_makeOpenTag('p')); $form->addElement($this->getLang('no_tags')); $form->addElement(form_makeCloseTag('p')); } else { // the tags table $form->addElement(form_makeOpenTag('div', array('class' => 'table'))); $form->addElement(form_makeOpenTag('table', array('class' => 'inline'))); // print table header $form->addElement(form_makeOpenTag('tr')); $form->addElement(form_makeOpenTag('th')); $form->addElement($this->getLang('include')); $form->addElement(form_makeCloseTag('th')); $form->addElement(form_makeOpenTag('th')); $form->addElement($this->getLang('exclude')); $form->addElement(form_makeCloseTag('th')); $form->addElement(form_makeOpenTag('th')); $form->addElement($this->getLang('tags')); $form->addElement(form_makeCloseTag('th')); $form->addElement(form_makeCloseTag('tr')); // print tag checkboxes foreach ($tags as $tag => $count) { $form->addElement(form_makeOpenTag('tr')); $form->addElement(form_makeOpenTag('td')); $attr = array(); if ($this->isSelected($tag)) { $attr['checked'] = 'checked'; } $form->addElement(form_makeCheckboxField('plugin__tag_search_tags[]', $tag, '+', '', 'plus', $attr)); $form->addElement(form_makeCloseTag('td')); $form->addElement(form_makeOpenTag('td')); $attr = array(); if ($this->isSelected('-' . $tag)) { $attr['checked'] = 'checked'; } $form->addElement(form_makeCheckboxField('plugin__tag_search_tags[]', '-' . $tag, '-', '', 'minus', $attr)); $form->addElement(form_makeCloseTag('td')); $form->addElement(form_makeOpenTag('td')); $form->addElement(hsc($tag) . ' [' . $count . ']'); $form->addElement(form_makeCloseTag('td')); $form->addElement(form_makeCloseTag('tr')); } $form->addElement(form_makeCloseTag('table')); $form->addElement(form_makeCloseTag('div')); // submit button (doesn't use the button form element because it always submits an action which is not // recognized for $preact in inc/actions.php and thus always causes a redirect) $form->addElement(form_makeOpenTag('p')); $form->addElement(form_makeTag('input', array('type' => 'submit', 'value' => $lang['btn_search']))); $form->addElement(form_makeCloseTag('p')); } return $form->getForm(); }
/** * Form to request a new password for an existing account * * @author Benoit Chesneau <*****@*****.**> * @author Andreas Gohr <*****@*****.**> */ function html_resendpwd() { global $lang; global $conf; global $INPUT; $token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth')); if (!$conf['autopasswd'] && $token) { print p_locale_xhtml('resetpwd'); print '<div class="centeralign">' . NL; $form = new Doku_Form(array('id' => 'dw__resendpwd')); $form->startFieldset($lang['btn_resendpwd']); $form->addHidden('token', $token); $form->addHidden('do', 'resendpwd'); $form->addElement(form_makePasswordField('pass', $lang['pass'], '', 'block', array('size' => '50'))); $form->addElement(form_makePasswordField('passchk', $lang['passchk'], '', 'block', array('size' => '50'))); $form->addElement(form_makeButton('submit', '', $lang['btn_resendpwd'])); $form->endFieldset(); html_form('resendpwd', $form); print '</div>' . NL; } else { print p_locale_xhtml('resendpwd'); print '<div class="centeralign">' . NL; $form = new Doku_Form(array('id' => 'dw__resendpwd')); $form->startFieldset($lang['resendpwd']); $form->addHidden('do', 'resendpwd'); $form->addHidden('save', '1'); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTextField('login', $INPUT->post->str('login'), $lang['user'], '', 'block')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeButton('submit', '', $lang['btn_resendpwd'])); $form->endFieldset(); html_form('resendpwd', $form); print '</div>' . NL; } }
function __siteexport_addpage() { global $ID, $conf; $templateSwitching = false; $pdfExport = false; $usenumberedheading = false; $cronEnabled = false; $translationAvailable = false; $usenumberedheading = true; if (($functions =& plugin_load('preload', 'siteexport')) && $functions->__create_preload_function()) { $templateSwitching = true; } if ($functions =& plugin_load('action', 'dw2pdf')) { $pdfExport = true; } // if ( $functions =& plugin_load('renderer', 'nodetailsxhtml' ) ) { // } if ($functions =& plugin_load('cron', 'siteexport')) { $cronEnabled = $functions->canWriteSettings(); } if ($functions =& plugin_load('helper', 'translation')) { $translationAvailable = true; } $regenerateScript = ''; print $this->locale_xhtml('intro'); $form = new Doku_Form('siteexport', null, 'post'); $form->startFieldset($this->getLang('startingNamespace')); $form->addElement(form_makeTextField('ns', $ID, $this->getLang('ns') . ':', 'ns')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTextField('ens', $ID, $this->getLang('ens') . ':', 'ens')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeListboxField('depthType', array("0.0" => $this->getLang('depth.pageOnly'), "1.0" => $this->getLang('depth.allSubNameSpaces'), "2.0" => $this->getLang('depth.specifiedDepth')), empty($_REQUEST['depthType']) ? $this->getLang('depth.allSubNameSpaces') : $_REQUEST['depthType'], $this->getLang('depthType') . ':', 'depthType', null, array_merge(array('class' => 'edit')))); $form->addElement(form_makeTag('br')); $form->addElement(form_makeOpenTag("div", array('style' => 'display:' . ($_REQUEST['depthType'] == "2" ? "block" : "none") . ';', 'id' => 'depthContainer'))); $form->addElement(form_makeTextField('depth', $this->getConf('depth'), $this->getLang('depth') . ':', 'depth')); $form->addElement(form_makeCloseTag("div")); $form->addElement(form_makeTag('br')); $form->addElement(form_makeOpenTag("div", array('style' => 'display:none;', 'id' => 'depthContainer'))); $form->addElement(form_makeCheckboxField('exportLinkedPages', 1, $this->getLang('exportLinkedPages') . ':', 'exportLinkedPages')); $form->addElement(form_makeCloseTag("div")); $form->endFieldset(); $form->addElement(form_makeTag('br')); $form->startFieldset($this->getLang('selectYourOptions')); $form->addElement(form_makeCheckboxField('absolutePath', 1, $this->getLang('absolutePath') . ':', 'absolutePath')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeCheckboxField('exportBody', 1, $this->getLang('exportBody') . ':', 'exportBody')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeCheckboxField('disableCache', 1, $this->getLang('disableCache') . ':', 'disableCache')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeCheckboxField('addParams', 1, $this->getLang('addParams') . ':', 'addParams', null, array_merge(array('checked' => $conf['userewrite'] != 1 ? 'checked' : '')))); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeListboxField('renderer', array_merge(array('', 'xhtml'), plugin_list('renderer')), '', $this->getLang('renderer') . ':', 'renderer', null, array_merge(array('class' => 'edit')))); $form->addElement(form_makeTag('br')); if ($templateSwitching) { $form->addElement(form_makeListboxField('template', $this->__getTemplates(), $conf['template'], $this->getLang('template') . ':', 'template', null, array_merge(array('class' => 'edit')))); $form->addElement(form_makeTag('br')); } else { $form->addElement(form_makeTag('br')); $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;'))); $form->addElement('Can\'t create preload file in \'inc\' directory. Template switching is not available. Plugin disabling is not available.'); $form->addElement(form_makeCloseTag('p')); } $form->addElement(form_makeTag('br')); $form->addElement(form_makeCheckboxField('pdfExport', 1, $this->getLang('pdfExport') . ':', 'pdfExport', null, $pdfExport ? array() : array_merge(array('disabled' => 'disabled')))); if (!$pdfExport) { $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;'))); $form->addElement('In order to use the PDF export, please '); $form->addElement(form_makeOpenTag('a', array('href' => 'http://www.dokuwiki.org/plugin:dw2pdf', 'alt' => 'install plugin', 'target' => '_blank'))); $form->addElement('install the dw2pdf plugin.'); $form->addElement(form_makeCloseTag('a')); $form->addElement(form_makeCloseTag('p')); } $form->addElement(form_makeTag('br')); $form->addElement(form_makeCheckboxField('usenumberedheading', 1, $this->getLang('usenumberedheading') . ':', 'usenumberedheading', null, $usenumberedheading && $pdfExport ? array() : array_merge(array('disabled' => 'disabled')))); $form->addElement(form_makeTag('br')); if (!$usenumberedheading) { $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;'))); $form->addElement('In order to use numbered headings, please '); $form->addElement(form_makeOpenTag('a', array('href' => 'http://www.dokuwiki.org/plugin:nodetailsxhtml', 'alt' => 'install plugin', 'target' => '_blank'))); $form->addElement('install the nodetailsxhtml plugin.'); $form->addElement(form_makeCloseTag('a')); $form->addElement(form_makeCloseTag('p')); } $form->endFieldset(); $form->addElement(form_makeTag('br')); $form->startFieldset($this->getLang('helpCreationOptions')); $form->addElement(form_makeCheckboxField('eclipseDocZip', 1, $this->getLang('eclipseDocZip') . ':', 'eclipseDocZip')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeCheckboxField('JavaHelpDocZip', 1, $this->getLang('JavaHelpDocZip') . ':', 'JavaHelpDocZip')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeCheckboxField('useTocFile', 1, $this->getLang('useTocFile') . ':', 'useTocFile')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeCheckboxField('emptyTocElem', 1, $this->getLang('emptyTocElem') . ':', 'emptyTocElem')); $form->addElement(form_makeTag('br')); if (!$translationAvailable) { $form->addElement(form_makeCheckboxField('TOCMapWithoutTranslation', 1, $this->getLang('TOCMapWithoutTranslation') . ':', 'TOCMapWithoutTranslation')); $form->addElement(form_makeTag('br')); } $form->endFieldset(); $form->addElement(form_makeTag('br')); if ($templateSwitching) { $form->startFieldset($this->getLang('disablePluginsOption')); $form->addElement(form_makeCheckboxField("disableall", 1, 'Disable All:', "disableall", 'forceVisible')); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTag('br')); list($allPlugins, $enabledPlugins) = $this->__getPluginList(); foreach ($allPlugins as $plugin) { $form->addElement(form_makeCheckboxField("disableplugin[]", $plugin, $plugin . ':', "disableplugin_{$plugin}", null, !in_array($plugin, $enabledPlugins) ? array('checked' => 'checked', 'disabled' => 'disabled') : array())); $form->addElement(form_makeTag('br')); } $form->endFieldset(); $form->addElement(form_makeTag('br')); } $form->startFieldset($this->getLang('customOptions')); $form->addElement(form_makeOpenTag('p')); $form->addElement($this->getLang('customOptionsDescription')); $form->addElement(form_makeCloseTag('p')); $form->addElement(form_makeOpenTag('ul', array('id' => 'siteexport__customActions'))); $form->addElement(form_makeCloseTag('ul')); $form->addElement(form_makeTag('br', array('class' => 'clear'))); $form->addElement(form_makeButton('submit', 'addoption', $this->getLang('addCustomOption'), array('style' => 'float:right;'))); $form->endFieldset(); $form->addElement(form_makeTag('br')); $form->startFieldset($this->getLang('startProcess')); $form->addElement(form_makeTextField('copyurl', "", $this->getLang('directDownloadLink') . ':', 'copyurl', null, array('readonly' => 'readonly'))); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTextField('wgeturl', "", $this->getLang('wgetURLLink') . ':', 'wgeturl', null, array('readonly' => 'readonly'))); $form->addElement(form_makeTag('br')); $form->addElement(form_makeTextField('curlurl', "", $this->getLang('curlURLLink') . ':', 'curlurl', null, array('readonly' => 'readonly'))); $form->addElement(form_makeTag('br', array('class' => 'clear'))); $form->addElement(form_makeButton('submit', 'siteexport', $this->getLang('start'), array('style' => 'float:right;'))); $form->endFieldset(); $form->addElement(form_makeTag('br')); $form->startFieldset($this->getLang('status')); $form->addElement(form_makeOpenTag('span', array('id' => 'siteexport__out'))); $form->addElement(form_makeCloseTag('span')); $form->addElement(form_makeOpenTag('span', array('class' => 'siteexport__throbber'))); $form->addElement(form_makeTag('img', array('src' => DOKU_BASE . 'lib/images/loading.gif', 'id' => 'siteexport__throbber'))); $form->addElement(form_makeCloseTag('span')); $form->endFieldset(); $form->addElement(form_makeTag('br')); if ($cronEnabled) { $form->startFieldset($this->getLang('cronSaveProcess')); $form->addElement(form_makeOpenTag('p')); $form->addElement($this->getLang('cronDescription')); $form->addElement(form_makeCloseTag('p')); $form->addElement(form_makeCheckboxField("cronOverwriteExisting", 1, $this->getLang('canOverwriteExisting'), "cronOverwriteExisting")); $form->addElement(form_makeTag('br', array('class' => 'clear'))); $form->addElement(form_makeButton('submit', 'cronDeleteAction', $this->getLang('cronDeleteAction'), array('id' => 'cronDeleteAction', 'style' => 'float:left;display:none'))); $form->addElement(form_makeButton('submit', 'cronSaveAction', $this->getLang('cronSaveAction'), array('id' => 'cronSaveAction', 'style' => 'float:right;'))); $form->addElement(form_makeTag('br', array('class' => 'clear'))); $form->addElement(form_makeOpenTag('a', array('href' => '#cronactions', 'alt' => 'show cron jobs', 'id' => 'showcronjobs', 'target' => '_blank', 'style' => 'float:right;'))); $form->addElement('show all cron jobs'); $form->addElement(form_makeCloseTag('a')); $form->endFieldset(); } $form->printForm(); }