From: <var...@us...> - 2009-02-24 15:43:59
|
Revision: 6548 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6548&view=rev Author: vargenau Date: 2009-02-24 15:43:52 +0000 (Tue, 24 Feb 2009) Log Message: ----------- Display error message if no argument provided Modified Paths: -------------- trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/PageGroup.php trunk/lib/plugin/RecentReferrers.php trunk/lib/plugin/TitleSearch.php Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2009-02-24 15:42:01 UTC (rev 6547) +++ trunk/lib/plugin/FullTextSearch.php 2009-02-24 15:43:52 UTC (rev 6548) @@ -71,8 +71,9 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (empty($args['s'])) - return ''; + if (empty($args['s'])) { + return HTML::div(array('class' => "error"), "Please provide 's' argument to the plugin."); + } extract($args); $query = new TextSearchQuery($s, $case_exact, $regex); @@ -166,68 +167,6 @@ } } - -// $Log: not supported by cvs2svn $ -// Revision 1.28 2007/06/07 17:02:42 rurban -// fix display of pagenames containing ":" in certain lists -// -// Revision 1.27 2007/01/04 16:46:40 rurban -// Only notes -// -// Revision 1.26 2005/11/14 22:33:04 rurban -// print ignored stoplist words -// -// Revision 1.25 2005/09/11 14:55:05 rurban -// implement fulltext stoplist -// -// Revision 1.24 2004/11/26 18:39:02 rurban -// new regex search parser and SQL backends (90% complete, glob and pcre backends missing) -// -// Revision 1.23 2004/11/23 15:17:19 rurban -// better support for case_exact search (not caseexact for consistency), -// plugin args simplification: -// handle and explode exclude and pages argument in WikiPlugin::getArgs -// and exclude in advance (at the sql level if possible) -// handle sortby and limit from request override in WikiPlugin::getArgs -// ListSubpages: renamed pages to maxpages -// -// Revision 1.22 2004/05/28 11:01:58 rurban -// support to disable highlighting -// example: s=ReiniUrban&hilight=0&noheader=1 -// -// Revision 1.21 2004/04/18 01:11:52 rurban -// more numeric pagename fixes. -// fixed action=upload with merge conflict warnings. -// charset changed from constant to global (dynamic utf-8 switching) -// -// Revision 1.20 2004/02/28 21:14:08 rurban -// generally more PHPDOC docs -// see http://xarch.tu-graz.ac.at/home/rurban/phpwiki/xref/ -// fxied WikiUserNew pref handling: empty theme not stored, save only -// changed prefs, sql prefs improved, fixed password update, -// removed REPLACE sql (dangerous) -// moved gettext init after the locale was guessed -// + some minor changes -// -// Revision 1.19 2004/02/26 04:27:39 rurban -// wrong limit notification -// -// Revision 1.18 2004/02/26 04:24:03 rurban -// simplify quiet handling by using PageList -// -// Revision 1.17 2004/02/26 04:03:39 rurban -// added quiet, limit and exclude to FullTextSearch, -// fixed explodePageList with previously unloaded PageList -// -// Revision 1.16 2004/02/17 12:11:36 rurban -// added missing 4th basepage arg at plugin->run() to almost all plugins. This caused no harm so far, because it was silently dropped on normal usage. However on plugin internal ->run invocations it failed. (InterWikiSearch, IncludeSiteMap, ...) -// -// Revision 1.15 2003/01/18 21:41:01 carstenklapp -// Code cleanup: -// Reformatting & tabs to spaces; -// Added copyleft, getVersion, getDescription, rcs_id. -// - // Local Variables: // mode: php // tab-width: 8 Modified: trunk/lib/plugin/PageGroup.php =================================================================== --- trunk/lib/plugin/PageGroup.php 2009-02-24 15:42:01 UTC (rev 6547) +++ trunk/lib/plugin/PageGroup.php 2009-02-24 15:43:52 UTC (rev 6548) @@ -2,6 +2,7 @@ rcs_id('$Id$'); /** Copyright 1999,2000,2001,2002,2004 $ThePhpWikiProgrammingTeam + Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent This file is part of PhpWiki. @@ -95,15 +96,13 @@ $args = $this->getArgs($argstr, $request); extract($args); - $html=""; if (empty($parent)) { // FIXME: WikiPlugin has no way to report when // required args are missing? $error_text = fmt("%s: %s", "WikiPlugin_" .$this->getName(), $error_text); $error_text .= " " . sprintf(_("A required argument '%s' is missing."), 'parent'); - $html = $error_text; - return $html; + return HTML::div(array('class' => "error"), $error_text); } $directions = array ('next' => _("Next"), 'previous' => _("Previous"), @@ -209,28 +208,6 @@ } }; -// $Log: not supported by cvs2svn $ -// Revision 1.8 2004/06/14 11:31:39 rurban -// renamed global $Theme to $WikiTheme (gforge nameclash) -// inherit PageList default options from PageList -// default sortby=pagename -// use options in PageList_Selectable (limit, sortby, ...) -// added action revert, with button at action=diff -// added option regex to WikiAdminSearchReplace -// -// Revision 1.7 2004/05/03 15:53:20 rurban -// Support [] links, but no [name|page] links yet -// Support subpages -// -// Revision 1.6 2004/02/17 12:11:36 rurban -// added missing 4th basepage arg at plugin->run() to almost all plugins. This caused no harm so far, because it was silently dropped on normal usage. However on plugin internal ->run invocations it failed. (InterWikiSearch, IncludeSiteMap, ...) -// -// Revision 1.5 2003/01/18 21:49:00 carstenklapp -// Code cleanup: -// Reformatting & tabs to spaces; -// Added copyleft, getVersion, getDescription, rcs_id. -// - // Local Variables: // mode: php // tab-width: 8 Modified: trunk/lib/plugin/RecentReferrers.php =================================================================== --- trunk/lib/plugin/RecentReferrers.php 2009-02-24 15:42:01 UTC (rev 6547) +++ trunk/lib/plugin/RecentReferrers.php 2009-02-24 15:43:52 UTC (rev 6548) @@ -31,7 +31,9 @@ } function run($dbi, $argstr, &$request, $basepage) { - if (!ACCESS_LOG) return; + if (!ACCESS_LOG) { + return HTML::div(array('class' => "error"), "Error: no ACCESS_LOG"); + } $args = $this->getArgs($argstr, $request); $table = HTML::table(array('cellpadding' => 1, 'cellspacing' => 2, @@ -71,4 +73,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/plugin/TitleSearch.php =================================================================== --- trunk/lib/plugin/TitleSearch.php 2009-02-24 15:42:01 UTC (rev 6547) +++ trunk/lib/plugin/TitleSearch.php 2009-02-24 15:43:52 UTC (rev 6548) @@ -2,6 +2,7 @@ rcs_id('$Id$'); /** Copyright 1999,2000,2001,2002,2004,2005 $ThePhpWikiProgrammingTeam + Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent This file is part of PhpWiki. @@ -72,8 +73,9 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (empty($args['s'])) - return ''; + if (empty($args['s'])) { + return HTML::div(array('class' => "error"), "Please provide 's' argument to the plugin."); + } $query = new TextSearchQuery($args['s'], $args['case_exact'], $args['regex']); $pages = $dbi->titleSearch($query,$args['sortby'],$args['limit'],$args['exclude']); @@ -117,64 +119,6 @@ } }; -// $Log: not supported by cvs2svn $ -// Revision 1.29 2007/01/02 13:23:30 rurban -// note to deprecate livesearch hack -// -// Revision 1.28 2005/09/10 21:33:08 rurban -// support enhanced API -// -// Revision 1.27 2005/02/03 05:09:57 rurban -// livesearch.js support -// -// Revision 1.26 2004/11/27 14:39:05 rurban -// simpified regex search architecture: -// no db specific node methods anymore, -// new sql() method for each node -// parallel to regexp() (which returns pcre) -// regex types bitmasked (op's not yet) -// new regex=sql -// clarified WikiDB::quote() backend methods: -// ->quote() adds surrounsing quotes -// ->qstr() (new method) assumes strings and adds no quotes! (in contrast to ADODB) -// pear and adodb have now unified quote methods for all generic queries. -// -// Revision 1.25 2004/11/26 18:39:02 rurban -// new regex search parser and SQL backends (90% complete, glob and pcre backends missing) -// -// Revision 1.24 2004/11/25 08:30:58 rurban -// dont extract args -// -// Revision 1.23 2004/11/23 15:17:19 rurban -// better support for case_exact search (not caseexact for consistency), -// plugin args simplification: -// handle and explode exclude and pages argument in WikiPlugin::getArgs -// and exclude in advance (at the sql level if possible) -// handle sortby and limit from request override in WikiPlugin::getArgs -// ListSubpages: renamed pages to maxpages -// -// Revision 1.22 2004/11/23 13:35:49 rurban -// add case_exact search -// -// Revision 1.21 2004/02/17 12:11:36 rurban -// added missing 4th basepage arg at plugin->run() to almost all plugins. This caused no harm so far, because it was silently dropped on normal usage. However on plugin internal ->run invocations it failed. (InterWikiSearch, IncludeSiteMap, ...) -// -// Revision 1.20 2003/11/02 20:42:35 carstenklapp -// Allow for easy page creation when search returns no matches. -// Based on cuthbertcat's patch, SF#655090 2002-12-17. -// -// Revision 1.19 2003/03/07 02:50:16 dairiki -// Fixes for new javascript redirect. -// -// Revision 1.18 2003/02/21 04:16:51 dairiki -// Don't NORETURN from redirect. -// -// Revision 1.17 2003/01/18 22:08:01 carstenklapp -// Code cleanup: -// Reformatting & tabs to spaces; -// Added copyleft, getVersion, getDescription, rcs_id. -// - // Local Variables: // mode: php // tab-width: 8 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |