Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv26187/lib/plugin Modified Files: AllPages.php AllUsers.php FrameInclude.php MostPopular.php UserPreferences.php WikiAdminRemove.php Added Files: PhpWeather.php RedirectTo.php WikiAdminSelect.php Log Message: LANG still broken, working on better locale handling. improved PageList: added checkbox, sortby added <?plugin-head for FrameInclude and RedirectTo fixed some minor UserPreferences quirks solidified templates added PhpWeather added a new generic WikiAdminSelect to simulate the commandline: work with sets of pages, pass the request to underlying WikiAdmin* plugins --- NEW FILE: PhpWeather.php --- <?php // -*-php-*- rcs_id('$Id PhpWeather.php 2002年08月26日 15:30:13 rurban$'); /** * This plugin requires a separate program called PHPWeather. * For more information and to download PHPWeather, * See: http://sourceforge.net/projects/phpweather/ * * There are still some problems with this plugin. * * Make sure you download the latest CVS version of PHPWeather from * http://phpweather.sourceforge.net/downloads/ * * Coming soon: When no ICAO code is provided, a popup of cities will be presented. * * Usage: * <?plugin PhpWeather?> * <?plugin PhpWeather icao=KJFK ?> * <?plugin PhpWeather icao=LOWG lang=en version=1.61 location=Graz-Thalerhof-Flughafen ?> */ // Name the PHPWeather folder 'phpweather' and put it anywhere inside // phpwiki, such as the plugin folder if (!defined('PHPWEATHER_FOLDER')) { if (ereg('/sourcefourge\.net/', SERVER_NAME)) { define('PHPWEATHER_FOLDER', '/home/groups/p/ph/phpwiki/htdocs/demo/lib/plugin/phpweather'); define('PHPWEATHER_VERSION', 1.92); } elseif (isWindows()) { //define('PHPWEATHER_FOLDER', 'V:/home/rurban/phpweather-1.61'); //define('PHPWEATHER_VERSION', 1.61); define('PHPWEATHER_FOLDER', 'V:/home/rurban/phpweather'); define('PHPWEATHER_VERSION', 1.92); } else { // defaults to a parallel dir to phpwiki define('PHPWEATHER_VERSION', 1.92); define('PHPWEATHER_FOLDER', PHPWIKI_DIR . '../phpweather'); } } class WikiPlugin_PhpWeather extends WikiPlugin { function getName () { return _("PhpWeather"); } function getDescription () { return _("The PhpWeather plugin provides weather reports from the Internet."); } function getDefaultArguments() { global $LANG; return array('icao' => 'KJFK', 'language' => $LANG == 'C' ? 'en' : $LANG, 'version' => PHPWEATHER_VERSION, 'location' => '', // needed for version < 1.9 'popups' => 0 ); } function run($dbi, $argstr, $request) { extract($this->getArgs($argstr, $request)); $html = HTML::form(array('action' => $request->getURLtoSelf(), 'method' => "POST")); if ($version > 1.7) { // The newer version as class require_once(PHPWEATHER_FOLDER . '/phpweather.php'); $w = new phpweather(array() /*$properties*/); } else { // The old and latest stable release (currently 1.61) @include(PHPWEATHER_FOLDER . "/locale_$language.inc"); @include(PHPWEATHER_FOLDER . '/config-dist.inc'); @include(PHPWEATHER_FOLDER . '/config.inc'); include(PHPWEATHER_FOLDER . '/phpweather.inc'); $cities = array( 'BGTL' => 'Thule A. B., Greenland', 'EGKK' => 'London / Gatwick Airport, United Kingdom', 'EKCH' => 'Copenhagen / Kastrup, Denmark', 'ENGM' => 'Oslo / Gardermoen, Norway', 'ESSA' => 'Stockholm / Arlanda, Sweden', 'FCBB' => 'Brazzaville / Maya-Maya, Congo', 'LEMD' => 'Madrid / Barajas, Spain', 'LFPB' => 'Paris / Le Bourget, France', 'LHBP' => 'Budapest / Ferihegy, Hungary', 'LIRA' => 'Roma / Ciampino, Italy', 'LMML' => 'Luqa International Airport, Malta', 'KNYC' => 'New York City, Central Park, NY, United States', 'NZCM' => 'Williams Field, Antarctic', 'UUEE' => 'Moscow / Sheremet\'Ye , Russian Federation', 'RKSS' => 'Seoul / Kimp\'O International Airport, Korea', 'YSSY' => 'Sydney Airport, Australia', 'ZBAA' => 'Beijing, China' ); } if (!$icao) $icao = $request->getArg('icao'); if ($icao) { if ($version > 1.7) { // The newer version as class $w->set_icao($icao); if (!in_array($language,explode(',','en,da,de,hu,no'))) $language = 'en'; $w->set_language($language); $m = $w->print_pretty(); } else { $metar = get_metar($icao); $data = process_metar($metar); // catch output into buffer and return it as string ob_start(); pretty_print_metar($metar, $location); $m = ob_get_contents(); ob_end_clean(); } $html->pushContent(new RawXml($m)); } $popups = $popups || !$icao; if ($popups) { // display the popups: cc and stations $options = HTML(); if ($version > 1.7) { $countries = $GLOBALS['obj']->db->get_countries(); $selected_cc = $request->getArg('cc'); while (list($cc, $country) = each($countries)) { if ($cc == $selected_cc) { $options->pushContent(HTML::option(array('value' => $cc, 'selected' => 'selected'), ($country ? $country : $cc) . "\n")); } else { $options->pushContent(HTML::option(array('value' => $cc), ($country ? $country : $cc) . "\n")); } } if ($selected_cc) $html->pushContent(HTML::input(array('type' => "hidden", 'name' => "old_cc", 'value' => $selected_cc))); $html->pushContent(HTML::select(array('name' => "cc", 'id' => 'cc'), $options)); } if ($selected_cc or $version < 1.7) { $options = HTML(); $country = ''; if ($version > 1.7) $cities = $GLOBALS['obj']->db->get_icaos($selected_cc, $country); $selected_icao = $request->getArg('icao'); while (list($icao, $name) = each($cities)) { if ($icao == $selected_icao) { $options->pushContent(HTML::option(array('value' => $icao, 'selected' => 'selected'), ($name ? $name : $icao) . "\n")); } else { $options->pushContent(HTML::option(array('value' => $icao), ($name ? $name : $icao) . "\n")); } } if ($selected_icao) $html->pushContent(HTML::input(array('type' => "hidden",'name' => "old_icao",'value' => $selected_icao))); $html->pushContent(HTML::select(array('name' => "icao", 'id' => 'icao'), $options)); } $html->pushContent(HTML::input(array('type' => "submit"))); } // trigger_error("required argument 'icao' missing"); return $html; } } // For emacs users // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?> --- NEW FILE: RedirectTo.php --- <?php // -*-php-*- rcs_id('$Id: RedirectTo.php,v 1.1 2002年08月27日 21:51:31 rurban Exp $'); /* Copyright 2002 $ThePhpWikiProgrammingTeam This file is part of PhpWiki. PhpWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PhpWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PhpWiki; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * RedirectTo: * Usage: <?plugin-head RedirectTo href=http://www.internet-technology.de/fourwins_de.htm ?> * or <?plugin-head RedirectTo page=AnotherPage ?> * at the VERY FIRST LINE in the content! Otherwise it will be ignored. * Author: Reini Urban <ru...@x-...> * */ class WikiPlugin_RedirectTo extends WikiPlugin { function getName() { return _("RedirectTo"); } function getDescription() { return _("Redirects to another url or page."); } function getDefaultArguments() { return array( 'href' => '', // 'type' => 'Temp' // or 'Permanent' // s far ignored 'page' => false, 'args' => false, // pass more args to the page. TestMe! ); } function run($dbi, $argstr, $request) { $args = ($this->getArgs($argstr, $request)); $href = $args['href']; $page = $args['page']; if (!$href and !$page) return $this->error(sprintf(_("href=%s parameter missing"), 'href')); // FIXME: unmunged url hack if ($href) $url = preg_replace('/href=(.*)\Z/','1ドル',$argstr); else { $url = $request->getURLtoSelf(array_merge(array('pagename' => $page), $args['args'])); } if ($page == $request->getArg($pagename)) { return $this->error(sprintf(_("Recursive redirect to self %s"), $url)); } return $request->redirect($url); } }; // For emacs users // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?> --- NEW FILE: WikiAdminSelect.php --- <?php // -*-php-*- rcs_id('$Id: WikiAdminSelect.php,v 1.1 2002年08月27日 21:51:31 rurban Exp $'); /* Copyright 2002 $ThePhpWikiProgrammingTeam This file is part of PhpWiki. PhpWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PhpWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PhpWiki; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * Allows selection of multiple pages which get passed to other WikiAdmin plugins then. * Usage: <?plugin WikiAdminSelect?> * Author: Reini Urban <ru...@x-...> * * KNOWN ISSUES: * Just a framework, nothing more. * Future versions will support PagePermissions. */ // maybe display more attributes with this class... require_once('lib/PageList.php'); class WikiPlugin_WikiAdminSelect extends WikiPlugin { function getName() { return _("WikiAdminSelect"); } function getDescription() { return _("Allows selection of multiple pages which get passed to other WikiAdmin plugins."); } function getDefaultArguments() { return array('s' => '*', 'only' => '', 'exclude' => '', 'info' => 'all', 'debug' => false); } function collectPages(&$list, &$dbi) { $allPages = $dbi->getAllPages(); while ($pagehandle = $allPages->next()) { $pagename = $pagehandle->getName(); if (empty($list[$pagename])) $list[$pagename] = 0; } } function run($dbi, $argstr, $request) { $args = $this->getArgs($argstr, $request); if (!empty($args['only'])) $only = explodePageList($args['only']); else $only = false; if (!empty($args['exclude'])) $exclude = explodePageList($args['exclude']); else $exclude = false; $info = $args['info']; $this->debug = $args['debug']; if (!empty($args['s'])) { $s = $args['s']; $sl = explodePageList($args['s']); $this->_list = array(); if ($sl) { $request->setArg('verify',1); foreach ($sl as $name) { $this->_list[$name] = 1; } } } else { $s = '*'; $this->_list = array(); } $this->debug = $args['debug']; // array_multisort($this->_list, SORT_NUMERIC, SORT_DESC); $pagename = $request->getArg('pagename'); // GetUrlToSelf() with all given params //$uri = $GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']; // without s would be better. $uri = $request->getURLtoSelf($request->debugVars(),array('verify')); $form = HTML::form(array('action' => $uri, 'method' => 'POST')); if ($request->getArg('submit') == 'WikiAdminSelect') $p = false; else $p = $request->getArg('p'); //$p = @$GLOBALS['HTTP_POST_VARS']['p']; $form->pushContent(HTML::p(array('class' => 'wikitext'), _("Select: "), HTML::input(array('type' => 'text', 'name' => 's', 'value' => $s)), HTML::input(array('type' => 'submit', 'name' => 'WikiAdminSelect', 'value' => _("Go"))))); if ($request->isPost() and $request->getArg('verify') and !empty($p)) { // List all selected pages again. foreach ($p as $page => $name) { $this->_list[$name] = 1; } } elseif ($request->isPost() and $request->_user->isAdmin() and !empty($p) and $request->getArg('action') == 'WikiAdminSelect') { // handle external plugin $l = new WikiPluginLoader(); $plugin_action = $request->getArg('submit'); $plugin = $l->getPlugin($plugin_action); $ul = HTML::ul(); foreach ($p as $page => $name) { $plugin_args = "run_page=$name"; $request->setArg($plugin_action,1); $request->setArg('p',array($page => $name)); $action_result = $plugin->run($dbi, $plugin_args, $request); $ul->pushContent(HTML::li(fmt("Selected page '%s' passed to '%s'.", $name, $select))); $ul->pushContent(HTML::ul(HTML::li($action_result))); } } elseif (empty($args['s'])) { // List all pages to select from. $this->collectPages($this->_list, &$dbi); } $pagelist = new PageList_Selectable($info ? 'checkbox,'.$info : 'checkbox', $exclude); $pagelist->addPageList($this->_list); $form->pushContent($pagelist->getContent()); $form->pushContent(HiddenGets(array('s'))); // debugging params, ... if (! $request->getArg('verify')) { $form->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'action', 'value' => 'verify'))); $form->pushContent(Button('submit:verify', _("Select pages"), 'wikiadmin'), Button('submit:cancel', _("Cancel"), 'button')); } else { global $Theme; $form->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'action', 'value' => 'WikiAdminSelect'))); // Add the Buttons for all registered WikiAdmin plugins $fs = new fileSet(PHPWIKI_DIR . '/lib/plugin', 'WikiAdmin*.php'); $actions = $fs->getFiles(); foreach ($actions as $f) { $f = preg_replace('/.php$/','', $f); $s = preg_replace('/^WikiAdmin/','', $f); $form->pushContent(Button("submit:$f", _($s), "wikiadmin")); $form->pushContent($Theme->getButtonSeparator()); } $form->pushContent(Button('submit:cancel', _("Cancel"), 'button')); } if (! $request->getArg('select')) { return $form; } else { ; //return $action_result; } } } // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?> Index: AllPages.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AllPages.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -2 -b -p -d -r1.12 -r1.13 --- AllPages.php 15 Feb 2002 17:53:01 -0000 1.12 +++ AllPages.php 27 Aug 2002 21:51:31 -0000 1.13 @@ -50,5 +50,5 @@ extends WikiPlugin if ($debug) { $time = round($time_end - $time_start, 3); - return HTML::p(fmt("elapsed time: %s s", $time), $pagelist); + return HTML($pagelist,HTML::p(fmt("Elapsed time: %s s", $time))); } else { return $pagelist; Index: AllUsers.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AllUsers.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -2 -b -p -d -r1.1 -r1.2 --- AllUsers.php 23 Aug 2002 18:29:30 -0000 1.1 +++ AllUsers.php 27 Aug 2002 21:51:31 -0000 1.2 @@ -75,5 +75,5 @@ extends WikiPlugin if ($debug) { $time = round($time_end - $time_start, 3); - return HTML::p($pagelist, fmt("elapsed time: %s s", $time)); + return HTML($pagelist,HTML::p(fmt("Elapsed time: %s s", $time))); } else { return $pagelist; Index: FrameInclude.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/FrameInclude.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -2 -b -p -d -r1.2 -r1.3 --- FrameInclude.php 24 Aug 2002 13:18:56 -0000 1.2 +++ FrameInclude.php 27 Aug 2002 21:51:31 -0000 1.3 @@ -74,5 +74,6 @@ extends WikiPlugin global $Theme; - extract($this->getArgs($argstr, $request)); + $args = ($this->getArgs($argstr, $request)); + extract($args); if (!$src) @@ -101,5 +102,5 @@ extends WikiPlugin //$memo = HTML(HTML::p(array('class' => 'transclusion-title'), // fmt("Included frame from %s", $src))); - if ($Theme == 'Sidebar') { + if (isa($Theme,'Theme_Sidebar')) { // left also"\n". $lefturi = $request->getURLtoSelf('frame=navbar'); @@ -120,11 +121,6 @@ extends WikiPlugin "</FRAMESET>\n"; } - // Other options: - // 1) either change the whole output stream to - // head, $frameset, <nobody>body</nobody> (buffered) - // 2) redirect to ?frameset=pagename - // $request->setArg('framesrc', $src); - // $request->redirect('frameset', $request->getName()); - return $frameset; + $args['FRAMESET'] = $frameset; + return printXML(new Template('frameset', $request, $args)); } }; Index: MostPopular.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/MostPopular.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -2 -b -p -d -r1.20 -r1.21 --- MostPopular.php 8 Feb 2002 20:30:48 -0000 1.20 +++ MostPopular.php 27 Aug 2002 21:51:31 -0000 1.21 @@ -41,6 +41,5 @@ extends WikiPlugin $hits = $page->get('hits'); if ($hits == 0 && $limit > 0) // don't show pages with no hits if most - // popular pages wanted - break; + break; // popular pages wanted $pagelist->addPage($page); } Index: UserPreferences.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/UserPreferences.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -2 -b -p -d -r1.5 -r1.6 --- UserPreferences.php 23 Aug 2002 21:54:30 -0000 1.5 +++ UserPreferences.php 27 Aug 2002 21:51:31 -0000 1.6 @@ -46,16 +46,23 @@ extends WikiPlugin $no_args[$value] = false; } - $no_args['errmsg'] = _("Error: The page with the UserPreferences plugin must be valid WikiWord or a Preferences subpage of the users HomePage. Sorry, UserPreferences cannot be saved."); + $no_args['errmsg'] = HTML(HTML::h2(_("Error: The page with the UserPreferences plugin must be valid WikiWord or a Preferences subpage of the users HomePage. Sorry, UserPreferences cannot be saved."),HTML::hr())); + $no_args['isForm'] = false; return Template('userprefs', $no_args); } if ($user->isAuthenticated() and $args['userid'] == $user->_userid) { if ($request->isPost()) { - if ($request->_prefs) + if ($request->_prefs) { $pref = $request->_prefs; - else // hmm. already handled somewhere else... + } else { // hmm. already handled somewhere else... $pref = new UserPreferences($request->getArg('pref')); + } // Fixme: How to update the Theme? Correct update? - $request->_user->SetPreferences($pref); - $args['errmsg'] = _("Preferences successfully updated."); + $num = $request->_user->SetPreferences($pref); + if (!$num) { + $errmsg = _("No changes."); + } else { + $errmsg = fmt("%d UserPreferences fields successfully updated.", $num); + } + $args['errmsg'] = HTML(HTML::h2($errmsg),HTML::hr()); } $available_themes = array(); Index: WikiAdminRemove.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiAdminRemove.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -2 -b -p -d -r1.3 -r1.4 --- WikiAdminRemove.php 24 Aug 2002 13:18:56 -0000 1.3 +++ WikiAdminRemove.php 27 Aug 2002 21:51:31 -0000 1.4 @@ -32,5 +32,5 @@ rcs_id('$Id$'); */ // maybe display more attributes with this class... -//require_once('lib/PageList.php'); +require_once('lib/PageList.php'); class WikiPlugin_WikiAdminRemove @@ -48,4 +48,7 @@ extends WikiPlugin return array('only' => '', 'exclude' => '', + 'run_page' => false, // why this? forgot it. + 'info' => '', + 'sortby' => '', 'debug' => false); } @@ -59,59 +62,31 @@ extends WikiPlugin } - function addTableHead(&$table) { - $row = HTML::tr(HTML::th(_("Select")), - HTML::th(_("Name"))); - $table->pushContent(HTML::thead($row)); - } - - function addTableBody(&$list, &$table) { - $tbody = HTML::tbody(); - foreach ($list as $pagename => $selected) { - if ($selected) { - $row = HTML::tr(array('class' => 'oddrow'), - HTML::td(HTML::input(array('type' => 'checkbox', - 'name' => "p[$pagename]", - 'value' => $pagename, - 'checked' => '1'))), - HTML::td(WikiLink($pagename))); - } else { - $row = HTML::tr(array('class' => 'evenrow'), - HTML::td(HTML::input(array('type' => 'checkbox', - 'name' => "p[$pagename]", - 'value' => $pagename))), - HTML::td(WikiLink($pagename))); - } - $tbody->pushContent($row); - } - $table->pushContent($tbody); - } - - function formatTable(&$list, &$dbi) { - $table = HTML::table(array('cellpadding' => 2, - 'cellspacing' => 1, - 'border' => 0, - 'class' => 'pagelist')); - $table->pushContent(HTML::caption(array('align'=>'top'), - _("Permanently remove all selected pages."))); - // $this->addTableHead($table); - $this->addTableBody($list, $table); - return $table; - } - function run($dbi, $argstr, $request) { $args = $this->getArgs($argstr, $request); if (!empty($args['only'])) - $this->only = explode(',',$args['only']); + $only = explodePageList($args['only']); + else $only = false; if (!empty($args['exclude'])) - $this->only = explode(',',$args['exclude']); + $exclude = explodePageList($args['exclude']); + else $exclude = false; + $info = $args['info']; $this->debug = $args['debug']; + $this->_list = array(); // array_multisort($this->_list, SORT_NUMERIC, SORT_DESC); $pagename = $request->getArg('pagename'); // GetUrlToSelf() with all given params - $uri = $GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']; + //$uri = $GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']; + $uri = $request->getURLtoSelf($request->debugVars(),array('verify')); $form = HTML::form(array('action' => $uri, 'method' => 'POST')); - $p = $request->getArgs('p'); // $GLOBALS['HTTP_POST_VARS']['p'] + $p = $request->getArg('p'); + // Handle WikiAdminSelect if ($request->isPost() and $request->_user->isAdmin() and + $p and $request->getArg('action') == 'select') { + $request->setArg('verify',1); + foreach ($p as $page => $name) { + $this->_list[$name] = 1; + } + } elseif ($request->isPost() and $request->_user->isAdmin() and $request->getArg('verify')) { // List all to be deleted pages again. @@ -132,7 +107,8 @@ extends WikiPlugin $this->collectPages($this->_list, &$dbi); } - $table = $this->formatTable($this->_list, &$dbi, &$request); - $form->pushContent($table); - $form->pushContent(HiddenInputs($GLOBALS['HTTP_GET_VARS'])); // debugging params, ... + $pagelist = new PageList_Selectable($info ? 'checkbox,'.$info : 'checkbox', $exclude); + $pagelist->addPageList($this->_list); + $form->pushContent($pagelist->getContent()); + $form->pushContent(HiddenGets(array('s','sortby','verify','WikiAdminRemove','remove'))); // if (! USE_PATH_INFO ) $form->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'pagename', 'value' => $pagename))); if (! $request->getArg('verify')) { @@ -141,5 +117,5 @@ extends WikiPlugin Button('submit:cancel', _("Cancel"), 'button')); } else { - $form->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'action', 'value' => 'remove'))); + $form->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'action', 'value' => 'WikiAdminRemove'))); $form->pushContent(Button('submit:remove', _("Remove selected pages"), 'wikiadmin'), Button('submit:cancel', _("Cancel"), 'button'));