Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29180 Modified Files: ExternalSearch.php Log Message: add argument button_position, to be able to place it right (new default) or left. and to be able to add the "s" input form additionally on useimage. off with button_position=none Index: ExternalSearch.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/ExternalSearch.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -2 -b -p -d -r1.12 -r1.13 --- ExternalSearch.php 28 Nov 2004 20:42:33 -0000 1.12 +++ ExternalSearch.php 8 Oct 2006 12:49:49 -0000 1.13 @@ -2,5 +2,5 @@ rcs_id('$Id$'); /** - Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam + Copyright 1999,2000,2001,2002,2006 $ThePhpWikiProgrammingTeam This file is part of PhpWiki. @@ -31,4 +31,6 @@ rcs_id('$Id$'); name="Go Godzilla All Over It" */ +if (!defined("EXTERNALSEARCH_DEFAULT_BUTTON_POSITION")) + define("EXTERNALSEARCH_DEFAULT_BUTTON_POSITION", "right"); class WikiPlugin_ExternalSearch @@ -70,5 +72,7 @@ extends WikiPlugin 'width' => false, 'height' => false, - 'debug' => false + 'debug' => false, + 'button_position' => EXTERNALSEARCH_DEFAULT_BUTTON_POSITION, + // 'left' or 'right' ); } @@ -111,4 +115,8 @@ extends WikiPlugin 'name' => 'url', 'value' => $this->_url))); + $s = HTML::input(array('type' => 'text', + 'value' => $this->_s, + 'name' => 's', + 'size' => $formsize)); if (!empty($args["useimage"])) { //FIXME: This does not work with Gecko @@ -118,4 +126,7 @@ extends WikiPlugin if (!empty($height)) $button->setAttr('height',$height); + // on button_position => none display no input form + if ($button_position == 'right') + $form->pushContent($s); $form->pushContent(HTML::button(array('type' => 'button', 'class' => 'button', @@ -123,12 +134,20 @@ extends WikiPlugin ), $button)); + if ($button_position == 'left') + $form->pushContent($s); } else { - $form->pushContent(HTML::input(array('type' => 'submit', + if ($button_position != 'left' and $button_position != 'right') + return $this->error(fmt("Invalid argument: %s=%s", + 'button_position', $button_position)); + $button = HTML::input(array('type' => 'submit', 'class' => 'button', - 'value' => $this->_name))); - $form->pushContent(HTML::input(array('type' => 'text', - 'value' => $this->_s, - 'name' => 's', - 'size' => $formsize))); + 'value' => $this->_name)); + if ($button_position == 'left') { + $form->pushContent($button); + $form->pushContent($s); + } elseif ($button_position == 'right') { + $form->pushContent($s); + $form->pushContent($button); + } } return $form; @@ -137,4 +156,8 @@ extends WikiPlugin // $Log$ +// Revision 1.13 2006年10月08日 12:49:49 rurban +// add argument button_position, to be able to place it right (new default) or left. +// and to be able to add the "s" input form additionally on useimage. off with button_position=none +// // Revision 1.12 2004年11月28日 20:42:33 rurban // Optimize PearDB _extract_version_data and _extract_page_data.