Update of /cvsroot/phpwiki/phpwiki/lib/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15844/plugin
Modified Files:
AppendText.php BackLinks.php FullTextSearch.php SystemInfo.php
TitleSearch.php WikiAdminSearchReplace.php WikiBlog.php
Log Message:
new regex search parser and SQL backends (90% complete, glob and pcre backends
missing)
Index: AppendText.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AppendText.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -2 -b -p -d -r1.4 -r1.5
--- AppendText.php 25 Nov 2004 17:20:52 -0000 1.4
+++ AppendText.php 26 Nov 2004 18:39:02 -0000 1.5
@@ -50,4 +50,5 @@ extends WikiPlugin
'before' => '', // Add before (ignores after if
defined)
'after' => '', // Add after line beginning with this
+ 'redirect' => false // Redirect to modified page
);
}
@@ -74,7 +75,7 @@ extends WikiPlugin
$message = HTML();
- if (!$page->exists()) { // create it?
- $message->pushContent(sprintf(_("Page could not be updated. %s
doesn't exist!\n",
- $pagename)));
+ if (!$page->exists()) { // We might want to create it?
+ $message->pushContent(sprintf(_("Page could not be updated. %s
doesn't exist!\n"),
+ $pagename));
return $message;
}
@@ -111,8 +112,22 @@ extends WikiPlugin
$meta['summary'] = sprintf(_("AppendText to %s"), $pagename);
if ($page->save($newtext, $current->getVersion() + 1, $meta)) {
- // if ($basepage == pagename) $errmsg = _("AppendText");
$message->pushContent(_("Page successfully updated."), HTML::br());
- $message->pushContent(_("Go to "));
- $message->pushContent(HTML::em(WikiLink($pagename)));
+ }
+
+ // AppendText has been called from the same page that got modified
+ // so we directly show the page.
+ if ( $request->getArg($pagename) == $pagename ) {
+ // TODO: Just invalidate the cache, if AppendText didn't
+ // change anything before.
+ //
+ return $request->redirect(WikiURL($pagename, false, 'absurl'),
false);
+
+ // The user asked to be redirected to the modified page
+ } elseif ($args['redirect']) {
+ return $request->redirect(WikiURL($pagename, false, 'absurl'),
false);
+
+ } else {
+ $link = HTML::em(WikiLink($pagename));
+ $message->pushContent(HTML::Raw(sprintf(_("Go to %s."),
$link->asXml())));
}
@@ -122,4 +137,16 @@ extends WikiPlugin
// $Log$
+// Revision 1.5 2004/11/26 18:39:02 rurban
+// new regex search parser and SQL backends (90% complete, glob and pcre
backends missing)
+//
+// Revision ext-1.4 2004/11/25 15:39:40 Pascal Giard <evilynux@xxxxxxxxx>
+// * Directly including modified page when AppendText got called from
+// the page to be modified.
+// * Translatable link to page.
+//
+// Revision ext-1.3 2004/11/25 9:44:45 Pascal Giard <evilynux@xxxxxxxxx>
+// * text modified to s to workaround mozilla bug.
+// * Added redirect parameter allowing you to be redirected to the modified
page.
+//
// Revision 1.4 2004/11/25 17:20:52 rurban
// and again a couple of more native db args: backlinks
@@ -131,5 +158,5 @@ extends WikiPlugin
// update from Pascal
//
-// Revision 1.2 2004/11/24 11:22:30 Pascal Giard <evilynux@xxxxxxxxx>
+// Revision ext-1.2 2004/11/24 11:22:30 Pascal Giard <evilynux@xxxxxxxxx>
// * Integrated rurban's modifications.
//
Index: BackLinks.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/BackLinks.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -2 -b -p -d -r1.30 -r1.31
--- BackLinks.php 25 Nov 2004 17:20:52 -0000 1.30
+++ BackLinks.php 26 Nov 2004 18:39:02 -0000 1.31
@@ -60,5 +60,5 @@ extends WikiPlugin
if (empty($page) and $page != '0')
return '';
- // exclude is already expanded in WikiPlugin::getArgs()
+ // exclude is now already expanded in WikiPlugin::getArgs()
if (empty($exclude)) $exclude = array();
if (!$include_self)
@@ -70,5 +70,5 @@ extends WikiPlugin
new _PageList_Column_BackLinks_count('count', _("#"),
'center');
}
- $args['dosort'] = !empty($args['sortby']); // override DB sort
+ $args['dosort'] = !empty($args['sortby']); // override DB sort (??)
$pagelist = new PageList($info, $exclude, $args);
$p = $dbi->getPage($page);
@@ -83,5 +83,5 @@ extends WikiPlugin
if (!$noheader) {
if ($page == $request->getArg('pagename')
- && !$dbi->isWikiPage($page)) {
+ and !$dbi->isWikiPage($page)) {
// BackLinks plugin is more than likely being called
// upon for an empty page on said page, while either
@@ -148,4 +148,7 @@ class _PageList_Column_BackLinks_count e
// $Log$
+// Revision 1.31 2004/11/26 18:39:02 rurban
+// new regex search parser and SQL backends (90% complete, glob and pcre
backends missing)
+//
// Revision 1.30 2004/11/25 17:20:52 rurban
// and again a couple of more native db args: backlinks
Index: FullTextSearch.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/FullTextSearch.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -2 -b -p -d -r1.23 -r1.24
--- FullTextSearch.php 23 Nov 2004 15:17:19 -0000 1.23
+++ FullTextSearch.php 26 Nov 2004 18:39:02 -0000 1.24
@@ -55,6 +55,6 @@ extends WikiPlugin
array('s' => false,
'hilight' => true,
- 'case_exact' => false, //not yet supported
- 'regex' => false, //not yet supported
+ 'case_exact' => false,
+ 'regex' => 'auto',
'noheader' => false,
'exclude' => false, //comma-seperated list of glob
@@ -137,4 +137,7 @@ extends WikiPlugin
// $Log$
+// 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),
Index: SystemInfo.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/SystemInfo.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -2 -b -p -d -r1.20 -r1.21
--- SystemInfo.php 20 Nov 2004 11:28:49 -0000 1.20
+++ SystemInfo.php 26 Nov 2004 18:39:02 -0000 1.21
@@ -40,9 +40,9 @@ rcs_id('$Id$');
* the result. In the page or with WikiPluginCached?
*/
-//require_once "lib/WikiPluginCached.php";
+require_once "lib/WikiPluginCached.php";
class WikiPlugin_SystemInfo
-//extends WikiPluginCached
-extends WikiPlugin
+extends WikiPluginCached
+//extends WikiPlugin
{
function getPluginType() {
@@ -139,17 +139,7 @@ extends WikiPlugin
function pagestats() {
global $request;
- $e = 0;
- $a = 0;
$dbi = $request->getDbh();
- $include_empty = true;
- $iter = $dbi->getAllPages($include_empty);
- while ($page = $iter->next())
- $e++;
- $s = sprintf(_("%d pages"), $e);
- $include_empty = false;
- $iter = $dbi->getAllPages($include_empty);
- while ($page = $iter->next())
- $a++;
- $s .= ", " . sprintf(_("%d not-empty pages"), $a);
+ $s = sprintf(_("%d pages"), $dbi->numPages(true));
+ $s .= ", " . sprintf(_("%d not-empty pages"), $dbi->numPages(false));
// more bla....
// $s .= ", " . sprintf(_("earliest page from %s"), $earliestdate);
@@ -189,5 +179,5 @@ extends WikiPlugin
// total hits per day/month/year
// view/edit rate
- // TODO: see WhoIsOnline hit stats
+ // TODO: see WhoIsOnline hit stats, and sql accesslogs
function accessstats() {
$s = _("not yet");
@@ -455,4 +445,7 @@ function stddev(&$hits, $total = false)
// $Log$
+// Revision 1.21 2004/11/26 18:39:02 rurban
+// new regex search parser and SQL backends (90% complete, glob and pcre
backends missing)
+//
// Revision 1.20 2004/11/20 11:28:49 rurban
// fix a yet unused PageList customPageListColumns bug (merge class not decl
to _types)
Index: TitleSearch.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/TitleSearch.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -2 -b -p -d -r1.24 -r1.25
--- TitleSearch.php 25 Nov 2004 08:30:58 -0000 1.24
+++ TitleSearch.php 26 Nov 2004 18:39:02 -0000 1.25
@@ -50,5 +50,6 @@ extends WikiPlugin
'exclude' => false,
'info' => false,
- 'case_exact' => false
+ 'case_exact' => false,
+ 'regex' => 'auto',
));
}
@@ -63,6 +64,6 @@ extends WikiPlugin
//extract($args);
- $query = new TextSearchQuery($args['s'], $args['case_exact']);
- $pages = $dbi->titleSearch($query, $args['case_exact']);
+ $query = new TextSearchQuery($args['s'], $args['case_exact'],
$args['regex']);
+ $pages = $dbi->titleSearch($query);
$pagelist = new PageList($args['info'], $args['exclude'], $args);
@@ -88,4 +89,7 @@ extends WikiPlugin
// $Log$
+// 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
Index: WikiAdminSearchReplace.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiAdminSearchReplace.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -2 -b -p -d -r1.18 -r1.19
--- WikiAdminSearchReplace.php 23 Nov 2004 15:17:20 -0000 1.18
+++ WikiAdminSearchReplace.php 26 Nov 2004 18:39:02 -0000 1.19
@@ -58,5 +58,5 @@ extends WikiPlugin_WikiAdminSelect
}
- function replaceHelper(&$dbi, $pagename, $from, $to, $case_exact = true,
$regex = false) {
+ function replaceHelper(&$dbi, $pagename, $from, $to, $case_exact=true,
$regex=false) {
$page = $dbi->getPage($pagename);
if ($page->exists()) {// don't replace default contents
@@ -265,4 +265,7 @@ function stri_replace($find,$replace,$st
// $Log$
+// Revision 1.19 2004/11/26 18:39:02 rurban
+// new regex search parser and SQL backends (90% complete, glob and pcre
backends missing)
+//
// Revision 1.18 2004/11/23 15:17:20 rurban
// better support for case_exact search (not caseexact for consistency),
Index: WikiBlog.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiBlog.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -2 -b -p -d -r1.18 -r1.19
--- WikiBlog.php 14 May 2004 20:55:04 -0000 1.18
+++ WikiBlog.php 26 Nov 2004 18:39:02 -0000 1.19
@@ -323,5 +323,5 @@ extends WikiPlugin
$pfxlen = strlen($prefix);
require_once('lib/TextSearchQuery.php');
- $pages = $dbi->titleSearch(new TextSearchQuery($prefix));
+ $pages = $dbi->titleSearch(new TextSearchQuery($prefix, true));
$blogs = array();
@@ -351,4 +351,7 @@ extends WikiPlugin
// $Log$
+// Revision 1.19 2004/11/26 18:39:02 rurban
+// new regex search parser and SQL backends (90% complete, glob and pcre
backends missing)
+//
// Revision 1.18 2004/05/14 20:55:04 rurban
// simplified RecentComments
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
|