hlp = plugin_load('helper', 'tagging');
}
/**
* We allow use by managers
*
* @return bool always false
*/
function forAdminOnly() {
return false;
}
/**
* Handle tag renames
*/
function handle() {
global $INPUT;
if ($INPUT->post->has('old') && $INPUT->post->has('new') && checkSecurityToken()) {
$this->hlp->renameTag($INPUT->post->str('old'), $INPUT->post->str('new'));
}
}
/**
* Draw the interface
*/
function html() {
echo $this->locale_xhtml('intro');
$this->html_form();
echo '
';
$this->html_table();
}
/**
* Show form for renaming tags
*/
protected function html_form() {
global $ID, $INPUT;
$form = new Doku_Form(array('action' => script(), 'method' => 'post', 'class' => 'plugin_tagging'));
$form->addHidden('do', 'admin');
$form->addHidden('page', 'tagging');
$form->addHidden('id', $ID);
$form->startFieldset($this->getLang('admin rename tag'));
$form->addElement(form_makeTextField('old', '', $this->getLang('admin find tag'), '', 'block'));
$form->addElement(form_makeTextField('new', '', $this->getLang('admin new name'), '', 'block'));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('admin save')));
$form->printForm();
}
/**
* Display ALL the tags!
*/
protected function html_table() {
global $ID, $INPUT;
//by default use current page namespace
if (!$INPUT->has('filter')) $INPUT->set('filter', getNS($ID));
$tags = $this->hlp->getAllTags($INPUT->str('filter'));
echo '
'; /** * Show form for filtering the tags by namespaces */ $form = new dokuwiki\Form\Form(); $form->setHiddenField('do', 'admin'); $form->setHiddenField('page', 'tagging'); $form->setHiddenField('id', $ID); $form->addTextInput('filter', $this->getLang('admin filter').': '); $form->addButton('fn[filter]', $this->getLang('admin filter button')); echo $form->toHTML(); echo ' | '; echo '
---|