*/ /** * All DokuWiki plugins to extend the admin function * need to inherit from this class */ class admin_plugin_csvtodwpages extends AdminPlugin { /** * Version: see lang.php */ protected $params; protected $paramcount; private $nl = "\n"; /** * access for managers */ function forAdminOnly() { return false; } /** * return sort order for position in admin menu */ function getMenuSort() { return 1; } /** * handle user request */ function handle() { global $INPUT; global $params; global $paramcount; $fieldnames = array('csvdw_namespace','csvdw_delim','csvdw_pagename','csvdw_csvdata','csvdw_csvtemplate','csvdw_overwrite','csvdw_dummyrun' ,'csvdw_trim'); if ($INPUT->has('csvdw_submit') && checkSecurityToken()) { foreach ($fieldnames as $key) { if (!blank($INPUT->param($key))){ $paramcount++; $params[$key] = $INPUT->param($key); } } } } /** * output appropriate html */ function html() { global $params; global $paramcount; $fieldcount = 0; // update the label when the namespace is changed echo ""; echo $this->locale_xhtml('intro') . $this->nl; echo '
'; // if all form values recieved, let's explode! if ($paramcount == $fieldcount) { $this->_csvexploder(); } elseif ($paramcount > $fieldcount) { // something weird going on echo '