Revision: 7302
http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7302&view=rev
Author: vargenau
Date: 2010-03-04 10:48:07 +0000 (Thu, 04 Mar 2010)
Log Message:
-----------
Replace tabs by spaces; remove EOL spaces
Modified Paths:
--------------
trunk/lib/plugin/AddComment.php
trunk/lib/plugin/AllPages.php
trunk/lib/plugin/AllUsers.php
trunk/lib/plugin/AnalyseAccessLogSql.php
trunk/lib/plugin/AppendText.php
trunk/lib/plugin/AsciiMath.php
trunk/lib/plugin/AsciiSVG.php
trunk/lib/plugin/BackLinks.php
trunk/lib/plugin/BlogArchives.php
trunk/lib/plugin/BlogJournal.php
trunk/lib/plugin/BoxRight.php
trunk/lib/plugin/CacheTest.php
trunk/lib/plugin/Calendar.php
trunk/lib/plugin/CalendarList.php
trunk/lib/plugin/Chart.php
trunk/lib/plugin/CreateBib.php
trunk/lib/plugin/CreatePage.php
trunk/lib/plugin/CreateToc.php
trunk/lib/plugin/Diff.php
trunk/lib/plugin/DynamicIncludePage.php
trunk/lib/plugin/EditMetaData.php
trunk/lib/plugin/ExternalSearch.php
trunk/lib/plugin/FileInfo.php
trunk/lib/plugin/FoafViewer.php
trunk/lib/plugin/FrameInclude.php
trunk/lib/plugin/FullTextSearch.php
trunk/lib/plugin/GoTo.php
trunk/lib/plugin/GoogleMaps.php
trunk/lib/plugin/GooglePlugin.php
trunk/lib/plugin/GraphViz.php
trunk/lib/plugin/HtmlConverter.php
trunk/lib/plugin/Imdb.php
trunk/lib/plugin/IncludePage.php
trunk/lib/plugin/IncludePages.php
trunk/lib/plugin/IncludeSiteMap.php
trunk/lib/plugin/InterWikiSearch.php
trunk/lib/plugin/JabberPresence.php
trunk/lib/plugin/LdapSearch.php
trunk/lib/plugin/LinkDatabase.php
trunk/lib/plugin/LinkSearch.php
trunk/lib/plugin/ListPages.php
trunk/lib/plugin/ListRelations.php
trunk/lib/plugin/MediawikiTable.php
trunk/lib/plugin/ModeratedPage.php
trunk/lib/plugin/MostPopular.php
trunk/lib/plugin/NewPagesPerUser.php
trunk/lib/plugin/NoCache.php
trunk/lib/plugin/OldStyleTable.php
trunk/lib/plugin/OrphanedPages.php
trunk/lib/plugin/PageDump.php
trunk/lib/plugin/PageGroup.php
trunk/lib/plugin/PageHistory.php
trunk/lib/plugin/PageInfo.php
trunk/lib/plugin/PageTrail.php
trunk/lib/plugin/PasswordReset.php
trunk/lib/plugin/PhotoAlbum.php
trunk/lib/plugin/PhpWeather.php
trunk/lib/plugin/Ploticus.php
trunk/lib/plugin/PluginManager.php
trunk/lib/plugin/PopUp.php
trunk/lib/plugin/PopularNearby.php
trunk/lib/plugin/PopularTags.php
trunk/lib/plugin/PreferenceApp.php
trunk/lib/plugin/Processing.php
trunk/lib/plugin/RandomPage.php
trunk/lib/plugin/RateIt.php
trunk/lib/plugin/RawHtml.php
trunk/lib/plugin/RecentChanges.php
trunk/lib/plugin/RecentChangesCached.php
trunk/lib/plugin/RecentComments.php
trunk/lib/plugin/RecentReferrers.php
trunk/lib/plugin/RedirectTo.php
trunk/lib/plugin/RelatedChanges.php
trunk/lib/plugin/RichTable.php
trunk/lib/plugin/RssFeed.php
trunk/lib/plugin/SearchHighlight.php
trunk/lib/plugin/SemanticRelations.php
trunk/lib/plugin/SemanticSearch.php
trunk/lib/plugin/SemanticSearchAdvanced.php
trunk/lib/plugin/SiteMap.php
trunk/lib/plugin/SpellCheck.php
trunk/lib/plugin/SqlResult.php
trunk/lib/plugin/SyncWiki.php
trunk/lib/plugin/SyntaxHighlighter.php
trunk/lib/plugin/SystemInfo.php
trunk/lib/plugin/TeX2png.php
trunk/lib/plugin/Template.php
trunk/lib/plugin/TexToPng.php
trunk/lib/plugin/TitleSearch.php
trunk/lib/plugin/Transclude.php
trunk/lib/plugin/TranslateText.php
trunk/lib/plugin/UnfoldSubpages.php
trunk/lib/plugin/UpLoad.php
trunk/lib/plugin/UriResolver.php
trunk/lib/plugin/UserPreferences.php
trunk/lib/plugin/UserRatings.php
trunk/lib/plugin/VisualWiki.php
trunk/lib/plugin/WantedPages.php
trunk/lib/plugin/WatchPage.php
trunk/lib/plugin/WhoIsOnline.php
trunk/lib/plugin/WikiAdminChmod.php
trunk/lib/plugin/WikiAdminChown.php
trunk/lib/plugin/WikiAdminMarkup.php
trunk/lib/plugin/WikiAdminPurge.php
trunk/lib/plugin/WikiAdminRemove.php
trunk/lib/plugin/WikiAdminRename.php
trunk/lib/plugin/WikiAdminSearchReplace.php
trunk/lib/plugin/WikiAdminSelect.php
trunk/lib/plugin/WikiAdminSetAcl.php
trunk/lib/plugin/WikiAdminSetExternal.php
trunk/lib/plugin/WikiAdminUtils.php
trunk/lib/plugin/WikiBlog.php
trunk/lib/plugin/WikiForm.php
trunk/lib/plugin/WikiFormRich.php
trunk/lib/plugin/WikiForum.php
trunk/lib/plugin/WikiPoll.php
trunk/lib/plugin/WikicreoleTable.php
trunk/lib/plugin/YouTube.php
trunk/lib/plugin/_AuthInfo.php
trunk/lib/plugin/_BackendInfo.php
trunk/lib/plugin/_GroupInfo.php
trunk/lib/plugin/_Retransform.php
trunk/lib/plugin/_WikiTranslation.php
trunk/lib/plugin/text2png.php
Modified: trunk/lib/plugin/AddComment.php
===================================================================
--- trunk/lib/plugin/AddComment.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/AddComment.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -2,7 +2,7 @@
rcs_id('$Id$');
/*
* Copyright (C) 2004 $ThePhpWikiProgrammingTeam
- *
+ *
* This file is part of PhpWiki.
*
* PhpWiki is free software; you can redistribute it and/or modify
@@ -59,7 +59,7 @@
// 'add' - only show entry box for new comment
// 'show,add' - show old comments, then entry box
// 'add,show' - show entry box followed by list of comments
- // jshide - boolean - quick javascript expansion of the comments
+ // jshide - boolean - quick javascript expansion of the comments
// and addcomment box
function getDefaultArguments() {
@@ -80,7 +80,7 @@
// Get our form args.
$comment = $request->getArg("comment");
$request->setArg('comment', false);
-
+
if ($request->isPost() and !empty($comment['addcomment'])) {
$this->add($request, $comment, 'comment'); // noreturn
}
@@ -125,12 +125,12 @@
$div->pushContent($show);
break;
case 'add':
- global $WikiTheme;
- if (!$WikiTheme->DUMP_MODE) {
- $add = $this->showForm($request, $args, 'addcomment');
- //if ($args['jshide']) $add->setAttr('style','display:none;');
- $div->pushContent($add);
- }
+ global $WikiTheme;
+ if (!$WikiTheme->DUMP_MODE) {
+ $add = $this->showForm($request, $args, 'addcomment');
+ //if ($args['jshide']) $add->setAttr('style','display:none;');
+ $div->pushContent($add);
+ }
break;
default:
return $this->error(sprintf("Bad mode ('%s')", $show));
@@ -139,7 +139,7 @@
$html->pushContent($div);
return $html;
}
-
+
};
// For emacs users
Modified: trunk/lib/plugin/AllPages.php
===================================================================
--- trunk/lib/plugin/AllPages.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/AllPages.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -56,7 +56,7 @@
'userpages' => false
));
}
-
+
// info arg allows multiple columns
// info=mtime,hits,summary,version,author,locked,minor,markup or all
// exclude arg allows multiple pagenames exclude=HomePage,RecentChanges
@@ -72,53 +72,53 @@
$timer = new DebugTimer;
}
$caption = _("All pages in this wiki ({total} total):");
-
+
if ( !empty($args['userpages']) ) {
$pages = PageList::allUserPages($args['include_empty'],
$args['sortby'], ''
- );
- $caption = _("List of user-created pages ({total} total):");
- $args['count'] = $request->getArg('count');
+ );
+ $caption = _("List of user-created pages ({total} total):");
+ $args['count'] = $request->getArg('count');
} elseif ( !empty($args['owner']) ) {
$pages = PageList::allPagesByOwner($args['owner'], $args['include_empty'],
$args['sortby'], ''
- );
- $caption = fmt("List of pages owned by [%s] ({total} total):",
- WikiLink($args['owner'] == '[]'
- ? $request->_user->getAuthenticatedId()
- : $args['owner'],
- 'if_known'));
- $args['count'] = $request->getArg('count');
- $pages->_options['count'] = $args['count'];
+ );
+ $caption = fmt("List of pages owned by [%s] ({total} total):",
+ WikiLink($args['owner'] == '[]'
+ ? $request->_user->getAuthenticatedId()
+ : $args['owner'],
+ 'if_known'));
+ $args['count'] = $request->getArg('count');
+ $pages->_options['count'] = $args['count'];
} elseif ( !empty($args['author']) ) {
$pages = PageList::allPagesByAuthor($args['author'], $args['include_empty'],
- $args['sortby'], ''
- );
- $caption = fmt("List of pages last edited by [%s] ({total} total):",
- WikiLink($args['author'] == '[]'
- ? $request->_user->getAuthenticatedId()
- : $args['author'],
- 'if_known'));
- $args['count'] = $request->getArg('count');
- $pages->_options['count'] = $args['count'];
+ $args['sortby'], ''
+ );
+ $caption = fmt("List of pages last edited by [%s] ({total} total):",
+ WikiLink($args['author'] == '[]'
+ ? $request->_user->getAuthenticatedId()
+ : $args['author'],
+ 'if_known'));
+ $args['count'] = $request->getArg('count');
+ $pages->_options['count'] = $args['count'];
} elseif ( !empty($args['creator']) ) {
$pages = PageList::allPagesByCreator($args['creator'], $args['include_empty'],
$args['sortby'], ''
- );
- $caption = fmt("List of pages created by [%s] ({total} total):",
- WikiLink($args['creator'] == '[]'
- ? $request->_user->getAuthenticatedId()
- : $args['creator'],
- 'if_known'));
- $args['count'] = $request->getArg('count');
- $pages->_options['count'] = $args['count'];
+ );
+ $caption = fmt("List of pages created by [%s] ({total} total):",
+ WikiLink($args['creator'] == '[]'
+ ? $request->_user->getAuthenticatedId()
+ : $args['creator'],
+ 'if_known'));
+ $args['count'] = $request->getArg('count');
+ $pages->_options['count'] = $args['count'];
//} elseif ($pages) {
// $args['count'] = count($pages);
} else {
- if (! $request->getArg('count'))
+ if (! $request->getArg('count'))
$args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
- else
- $args['count'] = $request->getArg('count');
+ else
+ $args['count'] = $request->getArg('count');
}
if (empty($args['count']) and !empty($pages))
$args['count'] = count($pages);
@@ -132,7 +132,7 @@
if ($pages !== false)
$pagelist->addPageList($pages);
else
- $pagelist->addPages( $dbi->getAllPages($args['include_empty'], $args['sortby'],
+ $pagelist->addPages( $dbi->getAllPages($args['include_empty'], $args['sortby'],
$args['limit']) );
if (defined('DEBUG') && DEBUG && $args['debug']) {
return HTML($pagelist,
Modified: trunk/lib/plugin/AllUsers.php
===================================================================
--- trunk/lib/plugin/AllUsers.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/AllUsers.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -25,9 +25,9 @@
/**
* Based on AllPages and WikiGroup.
*
- * We list all users,
- * either homepage users (prefs stored in a page),
- * users with db prefs and
+ * We list all users,
+ * either homepage users (prefs stored in a page),
+ * users with db prefs and
* externally authenticated users with a db users table, if auth_user_exists is defined.
*/
class WikiPlugin_AllUsers
Modified: trunk/lib/plugin/AnalyseAccessLogSql.php
===================================================================
--- trunk/lib/plugin/AnalyseAccessLogSql.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/AnalyseAccessLogSql.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -66,12 +66,12 @@
$query = '';
$backend_type = $request->_dbi->_backend->backendType();
switch ($backend_type) {
- case 'mysql':
+ case 'mysql':
$Referring_URL = "left(referer,length(referer)-instr(reverse(referer),'?'))"; break;
- case 'pgsql':
- case 'postgres7':
+ case 'pgsql':
+ case 'postgres7':
$Referring_URL = "substr(referer,0,position('?' in referer))"; break;
- default:
+ default:
$Referring_URL = "referer";
}
switch ($args['mode']) {
@@ -101,12 +101,12 @@
if ($where_conditions<>'')
$where_conditions = 'WHERE '.$where_conditions.' ';
switch ($backend_type) {
- case 'mysql':
+ case 'mysql':
$Referring_Domain = "left(referer, if(locate('/', referer, 8) > 0,locate('/', referer, 8) -1, length(referer)))"; break;
- case 'pgsql':
- case 'postgres7':
+ case 'pgsql':
+ case 'postgres7':
$Referring_Domain = "substr(referer,0,8) || regexp_replace(substr(referer,8), '/.*', '')"; break;
- default:
+ default:
$Referring_Domain = "referer"; break;
}
$query = "SELECT "
@@ -183,13 +183,13 @@
// If PHPSESSID appears in the URI, just display the URI to the left of this
$sessname = session_name();
switch ($backend_type) {
- case 'mysql':
+ case 'mysql':
$Request_URI = "IF(instr(request_uri, '$sessname')=0, request_uri,left(request_uri, instr(request_uri, '$sessname')-2))";
break;
- case 'pgsql':
- case 'postgres7':
+ case 'pgsql':
+ case 'postgres7':
$Request_URI = "regexp_replace(request_uri, '$sessname.*', '')"; break;
- default:
+ default:
$Request_URI = 'request_uri'; break;
}
$now = time();
@@ -239,7 +239,7 @@
return array(
'mode' => 'referring_domains',
// referring_domains, referring_urls, remote_hosts, users, host_users, search_bots, search_bots_hits
- 'caption' => '',
+ 'caption' => '',
// blank means use the mode as the caption/title for the output
'local_referrers' => 'true', // only show external referring sites
'period' => '', // the type of period to report:
@@ -356,19 +356,19 @@
$len = strlen($localhost);
$backend_type = $request->_dbi->_backend->backendType();
switch ($backend_type) {
- case 'mysql':
+ case 'mysql':
$ref_localhost = "left(referer,$len)<>'$localhost'"; break;
- case 'pgsql':
- case 'postgres7':
+ case 'pgsql':
+ case 'postgres7':
$ref_localhost = "substr(referer,0,$len)<>'$localhost'"; break;
- default:
+ default:
$ref_localhost = "";
}
$where_conditions = $where_conditions.$ref_localhost;
}
// The assumed contract is that there is a space at the end of the
- // conditions string, so that following SQL clauses (such as GROUP BY)
+ // conditions string, so that following SQL clauses (such as GROUP BY)
// will not cause a syntax error
if ($where_conditions<>'')
$where_conditions = $where_conditions.' ';
Modified: trunk/lib/plugin/AppendText.php
===================================================================
--- trunk/lib/plugin/AppendText.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/AppendText.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -28,7 +28,7 @@
* See http://sourceforge.net/mailarchive/message.php?msg_id=10141823
* why not to use "text" as parameter. Nasty mozilla bug with mult. radio rows.
*
- * Todo: multiple pages. e.g. AppendText s=~[CategoryINtime~] page=<!plugin TitleSearch intime !>
+ * Todo: multiple pages. e.g. AppendText s=~[CategoryINtime~] page=<!plugin TitleSearch intime !>
*/
class WikiPlugin_AppendText
extends WikiPlugin
@@ -48,7 +48,7 @@
function getDefaultArguments() {
return array('page' => '[pagename]',
- 'pages' => false,
+ 'pages' => false,
's' => '', // Text to append.
'before' => '', // Add before (ignores after if defined)
'after' => '', // Add after line beginning with this
@@ -65,17 +65,17 @@
function run($dbi, $argstr, &$request, $basepage) {
$args = $this->getArgs($argstr, $request);
- if (!$args['pages'] or !$request->isPost()) {
- return $this->_work($args['page'], $args, $dbi, $request);
- } else {
- $html = HTML();
- if ($args['page'] != $basepage)
- $html->pushContent("pages argument overrides page argument. ignored.",HTML::br());
- foreach ($args['pages'] as $pagename) {
- $html->pushContent($this->_work($pagename, $args, $dbi, $request));
- }
- return $html;
- }
+ if (!$args['pages'] or !$request->isPost()) {
+ return $this->_work($args['page'], $args, $dbi, $request);
+ } else {
+ $html = HTML();
+ if ($args['page'] != $basepage)
+ $html->pushContent("pages argument overrides page argument. ignored.",HTML::br());
+ foreach ($args['pages'] as $pagename) {
+ $html->pushContent($this->_work($pagename, $args, $dbi, $request));
+ }
+ return $html;
+ }
}
function _work($pagename, $args, $dbi, &$request) {
@@ -95,7 +95,7 @@
$pagename));
return $message;
}
-
+
$current = $page->getCurrentRevision();
$oldtext = $current->getPackedContent();
$text = $args['s'];
@@ -104,15 +104,15 @@
if (!empty($args['before'])) {
$before = preg_quote($args['before'], "/");
// Insert before
- $newtext = preg_match("/\n${before}/", $oldtext)
+ $newtext = preg_match("/\n${before}/", $oldtext)
? preg_replace("/(\n${before})/",
"\n" . preg_quote($text, "/") . "\\1",
- $oldtext)
+ $oldtext)
: $this->_fallback($text, $oldtext, $args['before'], $message);
} elseif (!empty($args['after'])) {
// Insert after
$after = preg_quote($args['after'], "/");
- $newtext = preg_match("/\n${after}/", $oldtext)
+ $newtext = preg_match("/\n${after}/", $oldtext)
? preg_replace("/(\n${after})/",
"\\1\n" . preg_quote($text, "/"),
$oldtext)
@@ -129,19 +129,19 @@
if ($page->save($newtext, $current->getVersion() + 1, $meta)) {
$message->pushContent(_("Page successfully updated."), HTML::br());
}
-
+
// 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
+ // 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())));
Modified: trunk/lib/plugin/AsciiMath.php
===================================================================
--- trunk/lib/plugin/AsciiMath.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/AsciiMath.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -27,19 +27,19 @@
require_once("lib/ASCIIMathPHP/ASCIIMathPHP.class.php");
}
-/**
+/**
* Render ASCII math as MathML
* Requires ENABLE_XHTML_XML = true
* See http://www.jcphysics.com/ASCIIMath/
* Syntax: http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.xml
* Example: "int_-1^1 sqrt(1-x^2)dx = pi/2"
* => <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow><msubsup><mo>∫</mo><mn>-1</mn><mn>1</mn></msubsup></mrow>
- <msqrt><mrow><mn>1</mn><mo>-</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msqrt>
- <mi>d</mi>
- <mi>x</mi>
- <mo>=</mo>
- <mfrac><mi>π</mi><mo>2</mo></mfrac>
+ <mrow><msubsup><mo>∫</mo><mn>-1</mn><mn>1</mn></msubsup></mrow>
+ <msqrt><mrow><mn>1</mn><mo>-</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msqrt>
+ <mi>d</mi>
+ <mi>x</mi>
+ <mo>=</mo>
+ <mfrac><mi>π</mi><mo>2</mo></mfrac>
</math>
*/
class WikiPlugin_AsciiMath
Modified: trunk/lib/plugin/AsciiSVG.php
===================================================================
--- trunk/lib/plugin/AsciiSVG.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/AsciiSVG.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -44,8 +44,8 @@
function getDefaultArguments() {
return array('width' => 200,
'height' => 200,
- 'script' => false, // one line script. not very likely
- 'onmousemove' => false
+ 'script' => false, // one line script. not very likely
+ 'onmousemove' => false
);
}
function handle_plugin_args_cruft(&$argstr, &$args) {
@@ -67,21 +67,21 @@
$html->pushContent($js);
$WikiTheme->_asciiSVG = 1; // prevent duplicates
}
- // extract <script>
- if (preg_match("/^(.*)<script>(.*)<\/script>/ism", $this->source, $m)) {
- $this->source = $m[1];
- $args['script'] = $m[2];
- }
- $embedargs = array('width' => $args['width'],
- 'height' => $args['height'],
- //'src' => "d.svg",
- 'script' => $this->source);
- // additional onmousemove argument
- if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove'];
+ // extract <script>
+ if (preg_match("/^(.*)<script>(.*)<\/script>/ism", $this->source, $m)) {
+ $this->source = $m[1];
+ $args['script'] = $m[2];
+ }
+ $embedargs = array('width' => $args['width'],
+ 'height' => $args['height'],
+ //'src' => "d.svg",
+ 'script' => $this->source);
+ // additional onmousemove argument
+ if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove'];
// we need script='data' and not script="data"
$embed = new AsciiSVG_HTML("embed", $embedargs);
$html->pushContent($embed);
- if ($args['script']) $html->pushContent(JavaScript($args['script']));
+ if ($args['script']) $html->pushContent(JavaScript($args['script']));
return $html;
}
};
@@ -89,7 +89,7 @@
class AsciiSVG_HTML extends HtmlElement {
function startTag() {
$start = "<" . $this->_tag;
- $this->_setClasses();
+ $this->_setClasses();
foreach ($this->_attr as $attr => $val) {
if (is_bool($val)) {
if (!$val)
@@ -98,7 +98,7 @@
}
$qval = str_replace("\"", '"', $this->_quote((string)$val));
if ($attr == 'script')
- // note the ' not "
+ // note the ' not "
$start .= " $attr='$qval'";
else
$start .= " $attr=\"$qval\"";
Modified: trunk/lib/plugin/BackLinks.php
===================================================================
--- trunk/lib/plugin/BackLinks.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/BackLinks.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -30,16 +30,16 @@
function getName() {
return _("BackLinks");
}
-
+
function getDescription() {
return sprintf(_("List all pages which link to %s."), '[pagename]');
}
-
+
function getVersion() {
return preg_replace("/[Revision: $]/", '',
"\$Revision$");
}
-
+
function getDefaultArguments() {
return array_merge
(
@@ -47,8 +47,8 @@
array('include_self' => false,
'noheader' => false,
'page' => '[pagename]',
- 'linkmore' => '', // If count>0 and limit>0 display a link with
- // the number of all results, linked to the given pagename.
+ 'linkmore' => '', // If count>0 and limit>0 display a link with
+ // the number of all results, linked to the given pagename.
));
}
@@ -70,39 +70,39 @@
if ($info) {
$info = explode(",", $info);
if (in_array('count',$info))
- $args['types']['count'] =
+ $args['types']['count'] =
new _PageList_Column_BackLinks_count('count', _("#"), 'center');
}
- if (!empty($limit))
- $args['limit'] = $limit;
+ if (!empty($limit))
+ $args['limit'] = $limit;
$args['dosort'] = !empty($args['sortby']); // override DB sort (??)
$pagelist = new PageList($info, $exclude, $args);
// support logical AND: page1,page2
- $pages = explodePageList($page);
- $count = count($pages);
- if (count($pages) > 1) {
- // AND: the intersection of all these pages
- $bl = array();
- foreach ($pages as $p) {
- $dp = $dbi->getPage($p);
- $bi = $dp->getBackLinks(false, $sortby, 0, $exclude);
- while ($b = $bi->next()) {
- $name = $b->getName();
- if (isset($bl[$name]))
- $bl[$name]++;
- else
- $bl[$name] = 1;
- }
- }
- foreach ($bl as $b => $v)
- if ($v == $count)
- $pagelist->addPage($b);
- } else {
- $p = $dbi->getPage($page);
- $pagelist->addPages($p->getBackLinks(false, $sortby, 0, $exclude));
- }
- $total = $pagelist->getTotal();
+ $pages = explodePageList($page);
+ $count = count($pages);
+ if (count($pages) > 1) {
+ // AND: the intersection of all these pages
+ $bl = array();
+ foreach ($pages as $p) {
+ $dp = $dbi->getPage($p);
+ $bi = $dp->getBackLinks(false, $sortby, 0, $exclude);
+ while ($b = $bi->next()) {
+ $name = $b->getName();
+ if (isset($bl[$name]))
+ $bl[$name]++;
+ else
+ $bl[$name] = 1;
+ }
+ }
+ foreach ($bl as $b => $v)
+ if ($v == $count)
+ $pagelist->addPage($b);
+ } else {
+ $p = $dbi->getPage($page);
+ $pagelist->addPages($p->getBackLinks(false, $sortby, 0, $exclude));
+ }
+ $total = $pagelist->getTotal();
// Localization note: In English, the differences between the
// various phrases spit out here may seem subtle or negligible
@@ -112,8 +112,8 @@
// distinction as it does with English in this case. :)
if (!$noheader) {
if ($page == $request->getArg('pagename')
- and !$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
// 'browse'ing, 'create'ing or 'edit'ing.
@@ -122,10 +122,10 @@
// the Un~WikiLink~ified (plain) name of the uncreated
// page currently being viewed.
$pagelink = $page;
-
+
if ($pagelist->isEmpty())
return HTML::p(fmt("No other page links to %s yet.", $pagelink));
-
+
if ($total == 1)
$pagelist->setCaption(fmt("One page would link to %s:",
$pagelink));
@@ -140,21 +140,21 @@
$total, $pagelink));
}
else {
- if ($count) {
- $tmp_pages = $pages;
- $p = array_shift($tmp_pages);
- $pagelink = HTML(WikiLink($p, 'auto'));
- foreach ($tmp_pages as $p)
- $pagelink->pushContent(" ",_("AND")," ",WikiLink($p, 'auto'));
- } else
- // BackLinks plugin is being displayed on a normal page.
+ if ($count) {
+ $tmp_pages = $pages;
+ $p = array_shift($tmp_pages);
+ $pagelink = HTML(WikiLink($p, 'auto'));
+ foreach ($tmp_pages as $p)
+ $pagelink->pushContent(" ",_("AND")," ",WikiLink($p, 'auto'));
+ } else
+ // BackLinks plugin is being displayed on a normal page.
$pagelink = WikiLink($page, 'auto');
-
+
if ($pagelist->isEmpty())
return HTML::p(fmt("No page links to %s.", $pagelink));
-
+
//trigger_error("DEBUG: " . $pagelist->getTotal());
-
+
if ($total == 1)
$pagelist->setCaption(fmt("One page links to %s:",
$pagelink));
@@ -166,18 +166,18 @@
// $pagelink));
else
$pagelist->setCaption(fmt("%s pages link to %s:",
- $limit > 0 ? $total : _("Those"),
- $pagelink));
+ $limit > 0 ? $total : _("Those"),
+ $pagelink));
}
}
- if (!empty($args['linkmore'])
- and $dbi->isWikiPage($args['linkmore'])
- and $limit > 0 and $total > $limit
- )
- $pagelist->addCaption(WikiLink($args['linkmore'], "auto", _("More...")));
+ if (!empty($args['linkmore'])
+ and $dbi->isWikiPage($args['linkmore'])
+ and $limit > 0 and $total > $limit
+ )
+ $pagelist->addCaption(WikiLink($args['linkmore'], "auto", _("More...")));
return $pagelist;
}
-
+
};
// how many links from this backLink to other pages
Modified: trunk/lib/plugin/BlogArchives.php
===================================================================
--- trunk/lib/plugin/BlogArchives.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/BlogArchives.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -2,7 +2,7 @@
rcs_id('$Id$');
/*
* Copyright (C) 2004 $ThePhpWikiProgrammingTeam
- *
+ *
* This file is part of PhpWiki.
*
* PhpWiki is free software; you can redistribute it and/or modify
@@ -23,7 +23,7 @@
require_once('lib/plugin/WikiBlog.php');
/**
- * BlogArchives - List monthly links for the current users blog if signed,
+ * BlogArchives - List monthly links for the current users blog if signed,
* or the ADMIN_USER's Blog if not.
* On month=... list the blog titles per month.
*
@@ -51,7 +51,7 @@
function getDefaultArguments() {
return //array_merge
//(
- //PageList::supportedArgs(),
+ //PageList::supportedArgs(),
array('user' => '',
'order' => 'reverse', // latest first
'info' => 'month,numpages', // ignored
@@ -77,9 +77,9 @@
}
if (!$args['user'] or $args['user'] == ADMIN_USER) {
if (BLOG_DEFAULT_EMPTY_PREFIX)
- $args['user'] = ''; // "Blogs/day" pages
+ $args['user'] = ''; // "Blogs/day" pages
else
- $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages
+ $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages
}
$parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR);
@@ -87,15 +87,15 @@
//$pagelist = new PageList($args['info'], $args['exclude'], $args);
//if (!is_array('pagename'), explode(',', $info))
// unset($pagelist->_columns['pagename']);
-
+
$sp = HTML::Raw('· ');
if (!empty($args['month'])) {
$prefix = $parent . $this->_blogPrefix('wikiblog') . SUBPAGE_SEPARATOR . $args['month'];
$pages = $dbi->titleSearch(new TextSearchQuery("^".$prefix, true, 'posix'));
$html = HTML::ul();
while ($page = $pages->next()) {
- $rev = $page->getCurrentRevision(false);
- if ($rev->get('pagetype') != 'wikiblog') continue;
+ $rev = $page->getCurrentRevision(false);
+ if ($rev->get('pagetype') != 'wikiblog') continue;
$blog = $this->_blog($rev);
$html->pushContent(HTML::li(WikiLink($page, 'known', $rev->get('summary'))));
}
@@ -117,13 +117,13 @@
$months = array();
foreach ($blogs as $rev) {
$blog = $this->_blog($rev);
- $mon = $blog['month'];
+ $mon = $blog['month'];
if (empty($months[$mon]))
- $months[$mon] =
+ $months[$mon] =
array('title' => $this->_monthTitle($mon),
'num' => 1,
'month' => $mon,
- 'link' => WikiURL($basepage,
+ 'link' => WikiURL($basepage,
$this->_nonDefaultArgs(array('month' => $mon))));
else
$months[$mon]['num']++;
@@ -137,7 +137,7 @@
return HTML(HTML::h3(_("Blog Archives:")), $html);
else
return $html;
- } else
+ } else
return '';
}
Modified: trunk/lib/plugin/BlogJournal.php
===================================================================
--- trunk/lib/plugin/BlogJournal.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/BlogJournal.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -2,7 +2,7 @@
rcs_id('$Id$');
/*
* Copyright (C) 2005 $ThePhpWikiProgrammingTeam
- *
+ *
* This file is part of PhpWiki.
*
* PhpWiki is free software; you can redistribute it and/or modify
@@ -23,10 +23,10 @@
require_once('lib/plugin/WikiBlog.php');
/**
- * BlogJournal - Include the latest blog entries for the current users blog if signed,
+ * BlogJournal - Include the latest blog entries for the current users blog if signed,
* or the ADMIN_USER's Blog if not.
* UnfoldSubpages for blogs.
- * Rui called this plugin "JournalLast", but this was written completely independent,
+ * Rui called this plugin "JournalLast", but this was written completely independent,
* without having seen the src.
*
* @author: Reini Urban
@@ -73,9 +73,9 @@
}
if (!$args['user'] or $args['user'] == ADMIN_USER) {
if (BLOG_DEFAULT_EMPTY_PREFIX) {
- $args['user'] = ''; // "Blogs/day" pages
+ $args['user'] = ''; // "Blogs/day" pages
} else {
- $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages
+ $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages
}
}
$parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR);
@@ -96,8 +96,8 @@
}
if ($args['user'] == $user->UserName() or $args['user'] == '')
$html->pushContent(Button(array('action'=>'WikiBlog',
- 'mode'=>'add'),
- _("New entry"), $base));
+ 'mode'=>'add'),
+ _("New entry"), $base));
if (!$i)
return HTML(HTML::h3(_("No Blog Entries")), $html);
if (!$args['noheader'])
Modified: trunk/lib/plugin/BoxRight.php
===================================================================
--- trunk/lib/plugin/BoxRight.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/BoxRight.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -49,13 +49,13 @@
// validators have already been handled by displayPage.
return true;
}
-
+
function run($dbi, $argstr, &$request, $basepage) {
if (!$basepage) {
return $this->error("$basepage unset?");
}
include_once("lib/BlockParser.php");
- $page = $request->getPage($basepage);
+ $page = $request->getPage($basepage);
return HTML::div(array('class'=>'boxright'), TransformText($argstr));
}
Modified: trunk/lib/plugin/CacheTest.php
===================================================================
--- trunk/lib/plugin/CacheTest.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/CacheTest.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -2,7 +2,7 @@
rcs_id('$Id$');
/*
* Copyright (C) 2002 Johannes Große
- *
+ *
* This file is part of PhpWiki.
*
* PhpWiki is free software; you can redistribute it and/or modify
Modified: trunk/lib/plugin/Calendar.php
===================================================================
--- trunk/lib/plugin/Calendar.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/Calendar.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -59,21 +59,21 @@
'month_format' => '%B %Y',
'wday_format' => '%a',
'start_wday' => '1', // start now with Monday
- 'display_weeknum' => 0);
+ 'display_weeknum' => 0);
}
/**
- * return links (static only as of action=edit)
+ * return links (static only as of action=edit)
*
* @param string $argstr The plugin argument string.
* @param string $basepage The pagename the plugin is invoked from.
* @return array List of pagenames linked to (or false).
*/
function getWikiPageLinks ($argstr, $basepage) {
- if (isset($this->_links))
+ if (isset($this->_links))
return $this->_links;
else {
- global $request;
+ global $request;
$this->run($request->_dbi, $argstr, $request, $basepage);
return $this->_links;
}
@@ -126,7 +126,7 @@
$fs = $this->args['wday_format'];
$row = HTML::tr();
$row->setattr('class', 'cal-dayname');
- if ($this->args['display_weeknum'])
+ if ($this->args['display_weeknum'])
$row->pushContent(HTML::td(array('class' => 'cal-dayname',
'align' => 'center'),
_("Wk")));
@@ -197,7 +197,7 @@
1, // mday (1-31)
$args['year']);
- $colnum = $args['display_weeknum'] ? 8 : 7;
+ $colnum = $args['display_weeknum'] ? 8 : 7;
$cal = HTML::table(array('cellspacing' => 0,
'cellpadding' => 2,
'class' => 'cal'),
@@ -216,9 +216,9 @@
$tbody = HTML::tbody();
$row = HTML::tr();
- if ($args['display_weeknum'])
+ if ($args['display_weeknum'])
$row->pushContent(HTML::td(array('class' => 'cal-weeknum'),
- ((int)strftime("%U", $time))+1)); // %U problem. starts with 0
+ ((int)strftime("%U", $time))+1)); // %U problem. starts with 0
$col = (7 + $t['tm_wday'] - $args['start_wday']) % 7;
if ($col > 0)
$row->pushContent(HTML::td(array('colspan' => $col)));
@@ -235,9 +235,9 @@
$time += SECONDS_PER_DAY;
$t = localtime($time, 1);
$done = $t['tm_mday'] == 1;
- if (!$col and !$done and $args['display_weeknum'])
- $row->pushContent(HTML::td(array('class' => 'cal-weeknum'),
- ((int)strftime("%U", $time))+1)); // starts with 0
+ if (!$col and !$done and $args['display_weeknum'])
+ $row->pushContent(HTML::td(array('class' => 'cal-weeknum'),
+ ((int)strftime("%U", $time))+1)); // starts with 0
}
if ($row->getContent()) {
Modified: trunk/lib/plugin/CalendarList.php
===================================================================
--- trunk/lib/plugin/CalendarList.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/CalendarList.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -22,19 +22,19 @@
*/
// if not defined in config.ini
-if (!defined('PLUGIN_CALENDARLIST_ORDER'))
- define('PLUGIN_CALENDARLIST_ORDER', 'normal');
+if (!defined('PLUGIN_CALENDARLIST_ORDER'))
+ define('PLUGIN_CALENDARLIST_ORDER', 'normal');
if (!defined('PLUGIN_CALENDARLIST_NEXT_N_DAYS'))
define('PLUGIN_CALENDARLIST_NEXT_N_DAYS','');
-if (!defined('PLUGIN_CALENDARLIST_NEXT_N'))
- define('PLUGIN_CALENDARLIST_NEXT_N', '');
+if (!defined('PLUGIN_CALENDARLIST_NEXT_N'))
+ define('PLUGIN_CALENDARLIST_NEXT_N', '');
if (!defined('PLUGIN_CALENDARLIST_LAST_N_DAYS'))
define('PLUGIN_CALENDARLIST_LAST_N_DAYS','');
-if (!defined('PLUGIN_CALENDARLIST_LAST_N'))
- define('PLUGIN_CALENDARLIST_LAST_N', '');
+if (!defined('PLUGIN_CALENDARLIST_LAST_N'))
+ define('PLUGIN_CALENDARLIST_LAST_N', '');
/**
- * This is a list of calendar appointments.
+ * This is a list of calendar appointments.
* Same arguments as Calendar, so no one is confused
* Uses <dl><dd>DATE<dt>page contents...
* Derived from Calendar.php by Martin Norbäck <martin@...>
@@ -66,16 +66,16 @@
function getDefaultArguments() {
return array('prefix' => '[pagename]',
'date_format' => '%Y-%m-%d',
- 'order' => PLUGIN_CALENDARLIST_ORDER, // normal or reverse (report sequence)
+ 'order' => PLUGIN_CALENDARLIST_ORDER, // normal or reverse (report sequence)
'year' => '',
'month' => '',
'month_offset' => 0,
//support ranges: next n days/events
- 'next_n_days' => PLUGIN_CALENDARLIST_NEXT_N_DAYS, // one or the other, not both
- 'next_n' => PLUGIN_CALENDARLIST_NEXT_N,
+ 'next_n_days' => PLUGIN_CALENDARLIST_NEXT_N_DAYS, // one or the other, not both
+ 'next_n' => PLUGIN_CALENDARLIST_NEXT_N,
// last n days/entries:
- 'last_n_days' => PLUGIN_CALENDARLIST_LAST_N_DAYS, // one or the other, not both
- 'last_n' => PLUGIN_CALENDARLIST_LAST_N,
+ 'last_n_days' => PLUGIN_CALENDARLIST_LAST_N_DAYS, // one or the other, not both
+ 'last_n' => PLUGIN_CALENDARLIST_LAST_N,
'month_format' => '%B %Y',
'wday_format' => '%a',
@@ -83,40 +83,40 @@
}
/**
- * return links (static only as of action=edit)
+ * return links (static only as of action=edit)
*
* @param string $argstr The plugin argument string.
* @param string $basepage The pagename the plugin is invoked from.
* @return array List of pagenames linked to (or false).
*/
function getWikiPageLinks ($argstr, $basepage) {
- if (isset($this->_links))
+ if (isset($this->_links))
return $this->_links;
else {
- global $request;
+ global $request;
$this->run($request->_dbi, $argstr, $request, $basepage);
return $this->_links;
}
}
function _count_events($dbi, $n = 7, $direction = 1) {
- // This is used by the last_n/next_n options to determine the date that
- // accounts for the number of N events in the past/future.
- // RETURNS: date of N-th event or the last item found
- $args = &$this->args; // gather the args array
- $timeTMP = time(); // start with today's date
- $t = $timeTMP; // init the control date variable to now
-
- for ($i=0; $i<=180; $i++) { // loop thru 180 days, past or future
+ // This is used by the last_n/next_n options to determine the date that
+ // accounts for the number of N events in the past/future.
+ // RETURNS: date of N-th event or the last item found
+ $args = &$this->args; // gather the args array
+ $timeTMP = time(); // start with today's date
+ $t = $timeTMP; // init the control date variable to now
+
+ for ($i=0; $i<=180; $i++) { // loop thru 180 days, past or future
$date_string = strftime($args['date_format'], $t);
$page_for_date = $args['prefix'] . SUBPAGE_SEPARATOR . $date_string;
if ($dbi->isWikiPage($page_for_date)) { // if this date has any comments/events
- $timeTMP = $t; // capture the date of this event for return
- if ($n-- <= 0) break; // if we reached the limit, return the date
+ $timeTMP = $t; // capture the date of this event for return
+ if ($n-- <= 0) break; // if we reached the limit, return the date
}
- $t += 24 * 3600 * $direction; // advance one day back or forward
+ $t += 24 * 3600 * $direction; // advance one day back or forward
}
-
+
// return the date of the N-th or last, most past/future event in the range
return $timeTMP;
}
@@ -168,7 +168,7 @@
}
$base = mktime(0, 0, 0, // h, m, s
$args['month'], // month 1-12
- $args['mday'],
+ $args['mday'],
$args['year']); // must have base 1900
// ***************************************************
@@ -223,7 +223,7 @@
for ($i = $start; ($step > 0) ? $i < $end : $i > $end; $i += $step) {
$cal->pushContent($this->_date($dbi, $i));
}
- // end of Plugin CalendarList display logic
+ // end of Plugin CalendarList display logic
// ***************************************************
return $cal;
Modified: trunk/lib/plugin/Chart.php
===================================================================
--- trunk/lib/plugin/Chart.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/Chart.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -62,12 +62,12 @@
function getDefaultArguments() {
return array('width' => 200,
'height' => 200,
- 'type' => 'line', // or 'area', 'bar', 'pie'
+ 'type' => 'line', // or 'area', 'bar', 'pie'
// 'xlabel' => 'x', // TODO
// 'ylabel' => 'y', // TODO
- 'color' => 'green',
- // 'legend' => false, // TODO
- 'data' => false // mandatory
+ 'color' => 'green',
+ // 'legend' => false, // TODO
+ 'data' => false // mandatory
);
}
function handle_plugin_args_cruft(&$argstr, &$args) {
@@ -140,9 +140,9 @@
}
}
- $embedargs = array('width' => $args['width'],
- 'height' => $args['height'],
- 'script' => $source);
+ $embedargs = array('width' => $args['width'],
+ 'height' => $args['height'],
+ 'script' => $source);
$embed = new SVG_HTML("embed", $embedargs);
$html->pushContent($embed);
return $html;
Modified: trunk/lib/plugin/CreateBib.php
===================================================================
--- trunk/lib/plugin/CreateBib.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/CreateBib.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -23,9 +23,9 @@
/**
* CreateBib: Automatically create a BibTex file from page
*
- * Usage:
+ * Usage:
* <?plugin CreateBib pagename||=whatever ?>
- *
+ *
* @author: Lea Viljanen
*/
@@ -52,18 +52,18 @@
function preg_quote ($heading) {
return str_replace(array("/",".","?","*"),
- array('\/','\.','\?','\*'), $heading);
+ array('\/','\.','\?','\*'), $heading);
}
-
+
// Have to include the $starttag and $endtag to the regexps...
- function extractBibTeX (&$content, $starttag, $endtag)
+ function extractBibTeX (&$content, $starttag, $endtag)
{
$bib = array();
$start = false;
$stop = false;
- for ($i=0; $i<count($content); $i++)
+ for ($i=0; $i<count($content); $i++)
{
// $starttag shows when to start
if (preg_match('/^@/',$content[$i],$match)) {
@@ -87,7 +87,7 @@
$articles = array();
for ($i=0; $i<count($content); $i++) {
// Should match "* [WikiPageName] whatever"
- //if (preg_match('/^\s*\*\s+(\[.+\])/',$content[$i],$match))
+ //if (preg_match('/^\s*\*\s+(\[.+\])/',$content[$i],$match))
if (preg_match('/^\s*\*\s+\[(.+)\]/',$content[$i],$match))
{
$articles[] = $match[1];
@@ -95,8 +95,8 @@
}
return $articles;
}
-
+
function dumpFile(&$thispage, $filename) {
include_once("lib/loadsave.php");
$mailified = MailifyPage($thispage);
@@ -126,14 +126,14 @@
$current = $page->getCurrentRevision();
$content = $current->getContent();
- // Prepare the button to trigger dumping
- $dump_url = $request->getURLtoSelf(array("file" => "tube.bib"));
+ // Prepare the button to trigger dumping
+ $dump_url = $request->getURLtoSelf(array("file" => "tube.bib"));
global $WikiTheme;
- $dump_button = $WikiTheme->makeButton("To File",
- $dump_url , 'foo');
+ $dump_button = $WikiTheme->makeButton("To File",
+ $dump_url , 'foo');
$html = HTML::div(array('class' => 'bib','align' => 'left'));
- $html->pushContent($dump_button, ' ');
+ $html->pushContent($dump_button, ' ');
$list = HTML::pre(array('id'=>'biblist', 'class' => 'bib'));
// Let's find the subpages
@@ -162,7 +162,7 @@
$c = $p->getCurrentRevision();
$pagedata = $c->getContent();
$this->dumpFile($pagedata, $request->getArg('file'));
- }
+ }
return $html;
}
Modified: trunk/lib/plugin/CreatePage.php
===================================================================
--- trunk/lib/plugin/CreatePage.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/CreatePage.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -21,12 +21,12 @@
*/
/**
- * This allows you to create a page getting the new pagename from a
- * forms-based interface, and optionally with the initial content from
- * some template, plus expansion of some variables via %%variable%% statements
+ * This allows you to create a page getting the new pagename from a
+ * forms-based interface, and optionally with the initial content from
+ * some template, plus expansion of some variables via %%variable%% statements
* in the template.
*
- * Put <?plugin-form CreatePage ?> at some page, browse this page,
+ * Put <?plugin-form CreatePage ?> at some page, browse this page,
* enter the name of the page to create, then click the button.
*
* Usage: <?plugin-form CreatePage template=SomeTemplatePage vars="year=2004&name=None" ?>
@@ -69,45 +69,45 @@
$s = trim($s);
if (!$s) {
return $this->error(_("Cannot create page with empty name!"));
- }
- // TODO: javascript warning if "/" or SUBPAGE_SEPARATOR in s
- if ($verify) {
- $head = _("CreatePage failed");
- if ($dbi->isWikiPage($verify)) {
- $msg = _("Do you really want to create the page '%s'?");
- } else {
- $msg = _("Do you really want to create the page '%s'?");
- }
- if (isSubPage($s)) {
- $main = subPageSlice(0);
- if (!$dbi->isWikiPage(subPageSlice(0))) {
- $msg .= "\n" . _("The new page you want to create will be a subpage.")
- . "\n" . _("Subpages cannot be created unless the parent page exists.");
- return alert($head, $msg);
- } else {
- $msg .= "\n" . _("The new page you want to create will be a subpage.");
- }
- }
- if (strpos($s, " \/")) {
- $msg .= "\n" . _("Subpages with ending space are not allowed as directory name on Windows.");
- return alert($head, $msg);
- }
- }
+ }
+ // TODO: javascript warning if "/" or SUBPAGE_SEPARATOR in s
+ if ($verify) {
+ $head = _("CreatePage failed");
+ if ($dbi->isWikiPage($verify)) {
+ $msg = _("Do you really want to create the page '%s'?");
+ } else {
+ $msg = _("Do you really want to create the page '%s'?");
+ }
+ if (isSubPage($s)) {
+ $main = subPageSlice(0);
+ if (!$dbi->isWikiPage(subPageSlice(0))) {
+ $msg .= "\n" . _("The new page you want to create will be a subpage.")
+ . "\n" . _("Subpages cannot be created unless the parent page exists.");
+ return alert($head, $msg);
+ } else {
+ $msg .= "\n" . _("The new page you want to create will be a subpage.");
+ }
+ }
+ if (strpos($s, " \/")) {
+ $msg .= "\n" . _("Subpages with ending space are not allowed as directory name on Windows.");
+ return alert($head, $msg);
+ }
+ }
$param = array('action' => 'edit');
if ($template and $dbi->isWikiPage($template)) {
$param['template'] = $template;
- } elseif (!empty($initial_content)) {
+ } elseif (!empty($initial_content)) {
// Warning! Potential URI overflow here on the GET redirect. Better use template.
$param['initial_content'] = $initial_content;
}
- // If the initial_content is too large, pre-save the content in the page
+ // If the initial_content is too large, pre-save the content in the page
// and redirect without that argument.
// URI length limit:
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1
$url = WikiURL($s, $param, 'absurl');
// FIXME: expand vars in templates here.
- if (strlen($url) > 255
+ if (strlen($url) > 255
or ($param['template'])
or preg_match('/%%\w+%%/', $initial_content)) // need variable expansion
{
@@ -116,7 +116,7 @@
$page = $dbi->getPage($s);
$current = $page->getCurrentRevision();
$version = $current->getVersion();
- // overwrite empty (deleted) pages
+ // overwrite empty (deleted) pages
if ($version and !$current->hasDefaultContents() and !$overwrite) {
return $this->error(fmt("%s already exists", WikiLink($s)));
} else {
@@ -129,15 +129,15 @@
$initial_content = $currenttmpl->getPackedContent();
$meta['markup'] = $currenttmpl->_data['markup'];
- if (preg_match('/<noinclude>.+<\/noinclude>/s', $initial_content)) {
- $initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "",
- $initial_content);
- }
+ if (preg_match('/<noinclude>.+<\/noinclude>/s', $initial_content)) {
+ $initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "",
+ $initial_content);
+ }
}
$meta['summary'] = _("Created by CreatePage");
- $content = $this->doVariableExpansion($initial_content, $vars, $s, $request);
+ $content = $this->doVariableExpansion($initial_content, $vars, $s, $request);
- if ($content !== $initial_content) {
+ if ($content !== $initial_content) {
// need to destroy the template so that editpage doesn't overwrite it.
unset($param['template']);
$url = WikiURL($s, $param, 'absurl');
Modified: trunk/lib/plugin/CreateToc.php
===================================================================
--- trunk/lib/plugin/CreateToc.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/CreateToc.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -130,7 +130,7 @@
function preg_quote ($heading) {
return str_replace(array("/",".","?","*"),
- array('\/','\.','\?','\*'), $heading);
+ array('\/','\.','\?','\*'), $heading);
}
// Get HTML header corresponding to current level (level is set of ! or =)
@@ -173,55 +173,55 @@
$level, &$hstart, &$hend, $basepage=false) {
$hstart = 0;
$hend = 0;
- $h = $this->_getHeader($level);
+ $h = $this->_getHeader($level);
$qheading = $this->_quote($heading);
- for ($j=$start_index; $j < count($content); $j++) {
+ for ($j=$start_index; $j < count($content); $j++) {
if (is_string($content[$j])) {
- if (preg_match("/<$h>$qheading<\/$h>/",
- $content[$j]))
- return $j;
+ if (preg_match("/<$h>$qheading<\/$h>/",
+ $content[$j]))
+ return $j;
}
elseif (isa($content[$j], 'cached_link'))
{
- if (method_exists($content[$j],'asXML')) {
- $content[$j]->_basepage = $basepage;
- $content[$j] = $content[$j]->asXML();
- } else
- $content[$j] = $content[$j]->asString();
- // shortcut for single wikiword or link headers
- if ($content[$j] == $heading
- and substr($content[$j-1],-4,4) == "<$h>"
- and substr($content[$j+1],0,5) == "</$h>")
- {
- $hstart = $j-1;
- $hend = $j+1;
- return $j; // single wikiword
- }
- elseif (TOC_FULL_SYNTAX) {
- //DONE: To allow "!! WikiWord link" or !! http://anylink/
- // Check against joined content (after cached_plugininvocation).
- // The first link is the anchor then.
- if (preg_match("/<$h>(?!.*<\/$h>)/", $content[$j-1])) {
- $hstart = $j-1;
- $joined = '';
- for ($k=max($j-1,$start_index);$k<count($content);$k++) {
- if (is_string($content[$k]))
- $joined .= $content[$k];
- elseif (method_exists($content[$k],'asXML'))
- $joined .= $content[$k]->asXML();
- else
- $joined .= $content[$k]->asString();
- if (preg_match("/<$h>$qheading<\/$h>/",$joined)) {
- $hend=$k;
- return $k;
- }
- }
- }
+ if (method_exists($content[$j],'asXML')) {
+ $content[$j]->_basepage = $basepage;
+ $content[$j] = $content[$j]->asXML();
+ } else
+ $content[$j] = $content[$j]->asString();
+ // shortcut for single wikiword or link headers
+ if ($content[$j] == $heading
+ and substr($content[$j-1],-4,4) == "<$h>"
+ and substr($content[$j+1],0,5) == "</$h>")
+ {
+ $hstart = $j-1;
+ $hend = $j+1;
+ return $j; // single wikiword
}
- }
- }
- trigger_error("Heading <$h> $heading </$h> not found\n", E_USER_NOTICE);
- return 0;
+ elseif (TOC_FULL_SYNTAX) {
+ //DONE: To allow "!! WikiWord link" or !! http://anylink/
+ // Check against joined content (after cached_plugininvocation).
+ // The first link is the anchor then.
+ if (preg_match("/<$h>(?!.*<\/$h>)/", $content[$j-1])) {
+ $hstart = $j-1;
+ $joined = '';
+ for ($k=max($j-1,$start_index);$k<count($content);$k++) {
+ if (is_string($content[$k]))
+ $joined .= $content[$k];
+ elseif (method_exists($content[$k],'asXML'))
+ $joined .= $content[$k]->asXML();
+ else
+ $joined .= $content[$k]->asString();
+ if (preg_match("/<$h>$qheading<\/$h>/",$joined)) {
+ $hend=$k;
+ return $k;
+ }
+ }
+ }
+ }
+ }
+ }
+ trigger_error("Heading <$h> $heading </$h> not found\n", E_USER_NOTICE);
+ return 0;
}
/** prevent from duplicate anchors,
@@ -308,9 +308,9 @@
$markup->_basepage);
if ($j and isset($markup->_content[$j])) {
$x = $markup->_content[$j];
- $qheading = $this->_quote($s);
- if ($counter)
- $counterString = $this->_getCounter($tocCounter, $level, $firstlevelstyle);
+ $qheading = $this->_quote($s);
+ if ($counter)
+ $counterString = $this->_getCounter($tocCounter, $level, $firstlevelstyle);
if (($hstart === 0) && is_string($markup->_content[$j])) {
if ($backlink) {
if ($counter)
@@ -387,18 +387,18 @@
// Check if user is allowed to get the Page.
if (!mayAccessPage ('view', $pagename)) {
- return $this->error(sprintf(_("Illegal access to page %s: no read access"),
- $pagename));
+ return $this->error(sprintf(_("Illegal access to page %s: no read access"),
+ $pagename));
}
$page = $dbi->getPage($pagename);
$current = $page->getCurrentRevision();
//FIXME: I suspect this only to crash with Apache2
if (!$current->get('markup') or $current->get('markup') < 2) {
- if (in_array(php_sapi_name(),array('apache2handler','apache2filter'))) {
+ if (in_array(php_sapi_name(),array('apache2handler','apache2filter'))) {
trigger_error(_("CreateToc disabled for old markup"), E_USER_WARNING);
return '';
- }
+ }
}
$content = $current->getContent();
$html = HTML::div(array('class' => 'toc', 'id'=> GenerateId("toc")));
@@ -445,17 +445,17 @@
(str_repeat($indentstr,$indent)),$li));
}
}
- $list->setAttr('style','display:'.($jshide?'none;':'block;'));
+ $list->setAttr('style','display:'.($jshide?'none;':'block;'));
$open = DATA_PATH.'/'.$WikiTheme->_findFile("images/folderArrowOpen.png");
$close = DATA_PATH.'/'.$WikiTheme->_findFile("images/folderArrowClosed.png");
if ($noheader) {
} else {
$toctoggleid = GenerateId("toctoggle");
- if ($extracollapse)
- $toclink = HTML(_("Table of Contents"),
- " ",
+ if ($extracollapse)
+ $toclink = HTML(_("Table of Contents"),
+ " ",
HTML::a(array('name'=>'TOC')),
- HTML::img(array(
+ HTML::img(array(
'id'=>$toctoggleid,
'class'=>'wikiaction',
'title'=>_("Click to display to TOC"),
@@ -463,15 +463,15 @@
'border' => 0,
'alt' => 'toctoggle',
'src' => $jshide ? $close : $open )));
- else
- $toclink = HTML::a(array('name'=>'TOC',
- 'class'=>'wikiaction',
- 'title'=>_("Click to display"),
- 'onclick'=>"toggletoc(this, '".$open."', '".$close."', '".$toclistid."')"),
- _("Table of Contents"),
- HTML::span(array('style'=>'display:none',
- 'id'=>$toctoggleid)," "));
- $html->pushContent(HTML::p(array('class'=>'toctitle'), $toclink));
+ else
+ $toclink = HTML::a(array('name'=>'TOC',
+ 'class'=>'wikiaction',
+ 'title'=>_("Click to display"),
+ 'onclick'=>"toggletoc(this, '".$open."', '".$close."', '".$toclistid."')"),
+ _("Table of Contents"),
+ HTML::span(array('style'=>'display:none',
+ 'id'=>$toctoggleid)," "));
+ $html->pushContent(HTML::p(array('class'=>'toctitle'), $toclink));
}
$html->pushContent($list);
if (count($headers) == 0) {
Modified: trunk/lib/plugin/Diff.php
===================================================================
--- trunk/lib/plugin/Diff.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/Diff.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -20,7 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
- * lib/diff.php converted to a plugin by electrawn,
+ * lib/diff.php converted to a plugin by electrawn,
* plugin cleaned up by rurban,
* code by dairiki
*
@@ -67,7 +67,7 @@
$iswikipage = (isWikiWord($author) && $dbi->isWikiPage($author));
$authorlink = $iswikipage ? WikiLink($author) : $author;
-
+
$linked_version = WikiLink($rev, 'existing', $rev->getVersion());
$row->pushContent(HTML::td(fmt("version %s", $linked_version)),
HTML::td($WikiTheme->getLastModifiedMessage($rev,
@@ -78,7 +78,7 @@
}
return $row;
}
-
+
function run($dbi, $argstr, &$request, $basepage) {
extract($this->getArgs($argstr, $request));
if (is_array($versions)) {
@@ -89,10 +89,10 @@
// Check if user is allowed to get the Page.
if (!mayAccessPage ('view', $pagename)) {
- return $this->error(sprintf(_("Illegal access to page %s: no read access"),
+ return $this->error(sprintf(_("Illegal access to page %s: no read access"),
$pagename));
}
-
+
// abort if page doesn't exist
$page = $request->getPage($pagename);
$current = $page->getCurrentRevision();
@@ -147,11 +147,11 @@
break;
}
}
-
+
$new_link = WikiLink($new, '', $new_version);
$old_link = $old ? WikiLink($old, '', $old_version) : $old_version;
$page_link = WikiLink($page);
-
+
$html = HTML(HTML::p(fmt("Differences between %s and %s of %s.",
$new_link, $old_link, $page_link)));
@@ -171,7 +171,7 @@
}
$html->pushContent($otherdiffs);
-
+
if ($old and $old->getVersion() == 0)
$old = false;
@@ -182,7 +182,7 @@
if ($new && $old) {
$diff = new Diff($old->getContent(), $new->getContent());
-
+
if ($diff->isEmpty()) {
$html->pushContent(HTML::hr(),
HTML::p(_("Content of versions "), $old->getVersion(),
Modified: trunk/lib/plugin/DynamicIncludePage.php
===================================================================
--- trunk/lib/plugin/DynamicIncludePage.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/DynamicIncludePage.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -45,15 +45,15 @@
}
function getDefaultArguments() {
- return array_merge
+ return array_merge
(WikiPlugin_IncludePage::getDefaultArguments(),
- array(
+ array(
'state' => false, // initial state: false <=> [+], true <=> [-]
));
}
-
+
function run($dbi, $argstr, &$request, $basepage) {
- global $WikiTheme;
+ global $WikiTheme;
$args = $this->getArgs($argstr, $request, false);
$page =& $args['page'];
if (ENABLE_AJAX) {
@@ -74,15 +74,15 @@
$png = $WikiTheme->_findData('images/folderArrow'.
($args['state'] ? 'Open' : 'Closed').
'.png');
- $icon = HTML::img(array('id' => $id.'-img',
+ $icon = HTML::img(array('id' => $id.'-img',
'src' => $png,
'onclick' => ENABLE_AJAX
- ? "showHideAsync('".$ajaxuri."','$id')"
+ ? "showHideAsync('".$ajaxuri."','$id')"
: "showHideFolder('$id')",
'border' => 0,
- 'alt' => _("Click to hide/show"),
- 'title' => _("Click to hide/show")));
- $header = HTML::p(array('class' => 'transclusion-title',
+ 'alt' => _("Click to hide/show"),
+ 'title' => _("Click to hide/show")));
+ $header = HTML::p(array('class' => 'transclusion-title',
'style' => "text-decoration: none;"),
$icon,
fmt(" %s :", WikiLink($page)));
@@ -93,7 +93,7 @@
$body->setAttr('style', 'display:none');
if (ENABLE_AJAX)
return HTML($header, $body); // async (load in background and insert)
- else
+ else
return HTML($header, $body); // sync (load but display:none)
}
}
Modified: trunk/lib/plugin/EditMetaData.php
===================================================================
--- trunk/lib/plugin/EditMetaData.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/EditMetaData.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -41,7 +41,7 @@
require_once('lib/plugin/_BackendInfo.php');
-class WikiPlugin_EditMetaData
+class WikiPlugin_EditMetaData
extends WikiPlugin__BackendInfo
{
function getName () {
@@ -74,68 +74,68 @@
$p = $dbi->getPage($page);
$pagemeta = $p->getMetaData();
$this->chunk_split = false;
-
+
// Look at arguments to see if submit was entered. If so,
// process this request before displaying.
//
- if ($request->isPost()
- and $request->_user->isAdmin()
- and $request->getArg('metaedit'))
- {
+ if ($request->isPost()
+ and $request->_user->isAdmin()
+ and $request->getArg('metaedit'))
+ {
$metafield = trim($request->getArg('metafield'));
$metavalue = trim($request->getArg('metavalue'));
$meta = $request->getArg('meta');
$changed = 0;
// meta[__global[_upgrade][name]] => 1030.13
foreach ($meta as $key => $val) {
- if ($val != $pagemeta[$key]
- and !in_array($key, $this->readonly_pagemeta))
- {
- $changed++;
+ if ($val != $pagemeta[$key]
+ and !in_array($key, $this->readonly_pagemeta))
+ {
+ $changed++;
$p->set($key, $val);
}
}
if ($metafield and !in_array($metafield, $this->readonly_pagemeta)) {
- // __global[_upgrade][name] => 1030.13
+ // __global[_upgrade][name] => 1030.13
if (preg_match('/^(.*?)\[(.*?)\]$/', $metafield, $matches)) {
list(, $array_field, $array_key) = $matches;
$array_value = $pagemeta[$array_field];
$array_value[$array_key] = $metavalue;
if ($pagemeta[$array_field] != $array_value) {
- $changed++;
- $p->set($array_field, $array_value);
+ $changed++;
+ $p->set($array_field, $array_value);
}
} elseif ($pagemeta[$metafield] != $metavalue) {
- $changed++;
+ $changed++;
$p->set($metafield, $metavalue);
}
}
if ($changed) {
$dbi->touch();
- $url = $request->getURLtoSelf(false,
+ $url = $request->getURLtoSelf(false,
array('meta','metaedit','metafield','metavalue'));
- $request->redirect($url);
- // The rest of the output will not be seen due to the
- // redirect.
- return '';
- }
+ $request->redirect($url);
+ // The rest of the output will not be seen due to the
+ // redirect.
+ return '';
+ }
}
// Now we show the meta data and provide entry box for new data.
$html = HTML();
//$html->pushContent(HTML::h3(fmt("Existing page-level metadata for %s:",
- // $page)));
- //$dl = $this->_display_values('', $pagemeta);
+ // $page)));
+ //$dl = $this->_display_values('', $pagemeta);
//$html->pushContent($dl);
if (!$pagemeta) {
// FIXME: invalid HTML
$html->pushContent(HTML::p(fmt("No metadata for %s", $page)));
- $table = HTML();
+ $table = HTML();
}
else {
- $table = HTML::table(array('border' => 1,
- 'cellpadding' => 2,
- 'cellspacing' => 0));
+ $table = HTML::table(array('border' => 1,
+ 'cellpadding' => 2,
+ 'cellspacing' => 0));
$this->_fixupData($pagemeta);
$table->pushContent($this->_showhash("MetaData('$page')", $pagemeta));
}
@@ -151,9 +151,9 @@
'method' => 'post',
'accept-charset' => $GLOBALS['charset']),
$hiddenfield,
- // edit existing fields
- $table,
- // add new ones
+ // edit existing fields
+ $table,
+ // add new ones
$instructions, HTML::br(),
$keyfield, ' => ', $valfield,
HTML::raw(' '), $button
@@ -167,31 +167,31 @@
}
function _showvalue ($key, $val, $prefix='') {
- if (is_array($val) or is_object($val)) return $val;
- if (in_array($key, $this->hidden_pagemeta)) return '';
- if ($prefix) {
- $fullkey = $prefix . '[' . $key . ']';
- if (substr($fullkey,0,1) == '[') {
- $meta = "meta".$fullkey;
- $fullkey = preg_replace("/\]\[/", "[", substr($fullkey, 1), 1);
- } else {
- $meta = preg_replace("/^([^\[]+)\[/", "meta[$1][", $fullkey, 1);
- }
- } else {
- $fullkey = $key;
- $meta = "meta[".$key."]";
- }
- //$meta = "meta[".$fullkey."]";
+ if (is_array($val) or is_object($val)) return $val;
+ if (in_array($key, $this->hidden_pagemeta)) return '';
+ if ($prefix) {
+ $fullkey = $prefix . '[' . $key . ']';
+ if (substr($fullkey,0,1) == '[') {
+ $meta = "meta".$fullkey;
+ $fullkey = preg_replace("/\]\[/", "[", substr($fullkey, 1), 1);
+ } else {
+ $meta = preg_replace("/^([^\[]+)\[/", "meta[$1][", $fullkey, 1);
+ }
+ } else {
+ $fullkey = $key;
+ $meta = "meta[".$key."]";
+ }
+ //$meta = "meta[".$fullkey."]";
$arr = array('name' => $meta, 'value' => $val);
- if (strlen($val) > 20)
- $arr['size'] = strlen($val);
- if (in_array($key, $this->readonly_pagemeta)) {
- $arr['readonly'] = 'readonly';
- return HTML::input($arr);
- } else {
- return HTML(HTML::em($fullkey), HTML::br(),
- HTML::input($arr));
- }
+ if (strlen($val) > 20)
+ $arr['size'] = strlen($val);
+ if (in_array($key, $this->readonly_pagemeta)) {
+ $arr['readonly'] = 'readonly';
+ return HTML::input($arr);
+ } else {
+ return HTML(HTML::em($fullkey), HTML::br(),
+ HTML::input($arr));
+ }
}
};
Modified: trunk/lib/plugin/ExternalSearch.php
===================================================================
--- trunk/lib/plugin/ExternalSearch.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/ExternalSearch.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -72,8 +72,8 @@
'width' => false,
'height' => false,
'debug' => false,
- 'button_position' => EXTERNALSEARCH_DEFAULT_BUTTON_POSITION,
- // 'left' or 'right'
+ 'button_position' => EXTERNALSEARCH_DEFAULT_BUTTON_POSITION,
+ // 'left' or 'right'
);
}
@@ -114,10 +114,10 @@
$form->pushContent(HTML::input(array('type' => 'hidden',
'name' => 'url',
'value' => $this->_url)));
- $s = HTML::input(array('type' => 'text',
- 'value' => $this->_s,
- 'name' => 's',
- 'size' => $formsize));
+ $s = HTML::input(array('type' => 'text',
+ 'value' => $this->_s,
+ 'name' => 's',
+ 'size' => $formsize));
if (!empty($args["useimage"])) {
//FIXME: This does not work with Gecko
$button = HTML::img(array('src' => $useimage, 'alt' => 'imagebutton'));
@@ -126,29 +126,29 @@
if (!empty($height))
$button->setAttr('height',$height);
// on button_position => none display no input form
- if ($button_position == 'right')
- $form->pushContent($s);
+ if ($button_position == 'right')
+ $form->pushContent($s);
$form->pushContent(HTML::button(array('type' => 'button',
'class' => 'button',
'value' => $this->_name,
),
$button));
- if ($button_position == 'left')
- $form->pushContent($s);
+ if ($button_position == 'left')
+ $form->pushContent($s);
} else {
if ($button_position != 'left' and $button_position != 'right')
- return $this->error(fmt("Invalid argument: %s=%s",
+ return $this->error(fmt("Invalid argument: %s=%s",
'button_position', $button_position));
$button = HTML::input(array('type' => 'submit',
'class' => 'button',
'value' => $this->_name));
- if ($button_position == 'left') {
- $form->pushContent($button);
- $form->pushContent($s);
- } elseif ($button_position == 'right') {
- $form->pushContent($s);
- $form->pushContent($button);
- }
+ if ($button_position == 'left') {
+ $form->pushContent($button);
+ $form->pushContent($s);
+ } elseif ($button_position == 'right') {
+ $form->pushContent($s);
+ $form->pushContent($button);
+ }
}
return $form;
}
Modified: trunk/lib/plugin/FileInfo.php
===================================================================
--- trunk/lib/plugin/FileInfo.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/FileInfo.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -3,7 +3,7 @@
/*
* Copyright 2005,2007 $ThePhpWikiProgrammingTeam
* Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
- *
+ *
* This file is part of PhpWiki.
*
* PhpWiki is free software; you can redistribute it and/or modify
@@ -27,7 +27,7 @@
*
* Usage:
* <?plugin FileInfo file=Upload:setup.exe display=version,date ?>
- * <?plugin FileInfo file=Upload:setup.exe display=name,version,date
+ * <?plugin FileInfo file=Upload:setup.exe display=name,version,date
* format="%s (version: %s, date: %s)" ?>
*
* @author: ReiniUrban
@@ -53,14 +53,14 @@
return array(
'file' => false, // relative path from PHPWIKI_DIR. (required)
'display' => false, // version,phonysize,size,date,mtime,owner,name,path,dirname,link. (required)
- 'format' => false, // printf format string with %s only, all display modes
- 'quiet' => false // print no error if file not found
- // from above vars return strings (optional)
+ 'format' => false, // printf format string with %s only, all display modes
+ 'quiet' => false // print no error if file not found
+ // from above vars return strings (optional)
);
}
function run($dbi, $argstr, &$request, $basepage) {
- $args = $this->getArgs($argstr, $request);
+ $args = $this->getArgs($argstr, $request);
extract($args);
if (!$file)
return $this->error(sprintf(_("A required argument '%s' is missing."), 'file'));
@@ -74,96 +74,96 @@
if (defined('PHPWIKI_DIR')) {
chdir(PHPWIKI_DIR);
}
- if (!file_exists($file)) {
- if ($quiet) {
- return HTML::raw('');
- } else {
+ if (!file_exists($file)) {
+ if ($quiet) {
+ return HTML::raw('');
+ } else {
return $this->error(sprintf(_("File '%s' not found."), $file));
- }
- }
- // sanify $file name
- $realfile = realpath($file);
- // Hmm, allow ADMIN to check a local file? Only if its locked
- if (string_starts_with($realfile, realpath(getUploadDataPath()))) {
- $isuploaded = 1;
- } else {
- $page = $dbi->getPage($basepage);
- $user = $request->getUser();
- if ($page->getOwner() != ADMIN_USER or !$page->get('locked')) {
- // For convenience we warn the admin
- if ($quiet and $user->isAdmin())
- return HTML::span(array('title' => _("Output suppressed. FileInfoPlugin with local files require a locked page.")),
- HTML::em(_("page not locked")));
- else
- return $this->error("Invalid path \"$file\". Only ADMIN can allow local paths, and the page must be locked.");
- }
- }
- $s = array();
- $modes = explode(",", $display);
- foreach ($modes as $mode) {
- switch ($mode) {
- case 'version': $s[] = $this->exeversion($file); break;
- case 'size': $s[] = filesize($file); break;
- case 'phonysize':$s[] = $this->phonysize(filesize($file)); break;
- case 'date': $s[] = strftime("%x %X", filemtime($file)); break;
- case 'mtime': $s[] = filemtime($file); break;
- case 'owner': $o = posix_getpwuid(fileowner($file)); $s[] = $o['name']; break;
- case 'group': $o = posix_getgrgid(filegroup($file)); $s[] = $o['name']; break;
- case 'name': $s[] = basename($file); break;
- case 'path': $s[] = $file; break;
- case 'dirname': $s[] = dirname($file); break;
- case 'magic': $s[] = $this->magic($file); break;
- case 'mime-typ': $s[] = $this->mime_type($file); break;
- case 'link':
- if ($is_Upload) {
- $s[] = " [".$args['file'] . "]";
- } elseif ($isuploaded) {
- // will fail with user uploads
- $s[] = " [Upload:".basename($file)."]";
- } else {
- $s[] = " [".basename($file)."] ";
- }
- break;
- default:
- if (!$quiet) {
- return $this->error(sprintf(_("Unsupported argument: %s=%s"), 'display', $mode));
- } else {
+ }
+ }
+ // sanify $file name
+ $realfile = realpath($file);
+ // Hmm, allow ADMIN to check a local file? Only if its locked
+ if (string_starts_with($realfile, realpath(getUploadDataPath()))) {
+ $isuploaded = 1;
+ } else {
+ $page = $dbi->getPage($basepage);
+ $user = $request->getUser();
+ if ($page->getOwner() != ADMIN_USER or !$page->get('locked')) {
+ // For convenience we warn the admin
+ if ($quiet and $user->isAdmin())
+ return HTML::span(array('title' => _("Output suppressed. FileInfoPlugin with local files require a locked page.")),
+ HTML::em(_("page not locked")));
+ else
+ return $this->error("Invalid path \"$file\". Only ADMIN can allow local paths, and the page must be locked.");
+ }
+ }
+ $s = array();
+ $modes = explode(",", $display);
+ foreach ($modes as $mode) {
+ switch ($mode) {
+ case 'version': $s[] = $this->exeversion($file); break;
+ case 'size': $s[] = filesize($file); break;
+ case 'phonysize':$s[] = $this->phonysize(filesize($file)); break;
+ case 'date': $s[] = strftime("%x %X", filemtime($file)); break;
+ case 'mtime': $s[] = filemtime($file); break;
+ case 'owner': $o = posix_getpwuid(fileowner($file)); $s[] = $o['name']; break;
+ case 'group': $o = posix_getgrgid(filegroup($file)); $s[] = $o['name']; break;
+ case 'name': $s[] = basename($file); break;
+ case 'path': $s[] = $file; break;
+ case 'dirname': $s[] = dirname($file); break;
+ case 'magic': $s[] = $this->magic($file); break;
+ case 'mime-typ': $s[] = $this->mime_type($file); break;
+ case 'link':
+ if ($is_Upload) {
+ $s[] = " [".$args['file'] . "]";
+ } elseif ($isuploaded) {
+ // will fail with user uploads
+ $s[] = " [Upload:".basename($file)."]";
+ } else {
+ $s[] = " [".basename($file)."] ";
+ }
+ break;
+ default:
+ if (!$quiet) {
+ return $this->error(sprintf(_("Unsupported argument: %s=%s"), 'display', $mode));
+ } else {
return HTML::raw('');
}
- break;
- }
- }
+ break;
+ }
+ }
chdir($dir);
- if (!$format) {
- $format = '';
- foreach ($s as $x) { $format .= " %s"; }
- }
- array_unshift($s, $format);
- // $x, array($i,$j) => sprintf($x, $i, $j)
+ if (!$format) {
+ $format = '';
+ foreach ($s as $x) { $format .= " %s"; }
+ }
+ array_unshift($s, $format);
+ // $x, array($i,$j) => sprintf($x, $i, $j)
$result = call_user_func_array("sprintf", $s);
- if (in_array('link', $modes)) {
- require_once("lib/InlineParser.php");
- return TransformInline($result, 2, $basepage);
- } else {
- return HTML::raw($result);
- }
+ if (in_array('link', $modes)) {
+ require_once("lib/InlineParser.php");
+ return TransformInline($result, 2, $basepage);
+ } else {
+ return HTML::raw($result);
+ }
}
function magic($file) {
- if (function_exists('finfo_file') or loadPhpExtension('fileinfo')) {
- // Valid finfo_open (i.e. libmagic) options:
- // FILEINFO_NONE | FILEINFO_SYMLINK | FILEINFO_MIME | FILEINFO_COMPRESS | FILEINFO_DEVICES |
- // FILEINFO_CONTINUE | FILEINFO_PRESERVE_ATIME | FILEINFO_RAW
- $f = finfo_open(/*FILEINFO_MIME*/);
- $result = finfo_file(realpath($file));
- finfo_close($res);
- return $result;
- }
- return '';
+ if (function_exists('finfo_file') or loadPhpExtension('fileinfo')) {
+ // Valid finfo_open (i.e. libmagic) options:
+ // FILEINFO_NONE | FILEINFO_SYMLINK | FILEINFO_MIME | FILEINFO_COMPRESS | FILEINFO_DEVICES |
+ // FILEINFO_CONTINUE | FILEINFO_PRESERVE_ATIME | FILEINFO_RAW
+ $f = finfo_open(/*FILEINFO_MIME*/);
+ $result = finfo_file(realpath($file));
+ finfo_close($res);
+ return $result;
+ }
+ return '';
}
function mime_type($file) {
- return '';
+ return '';
}
function _formatsize ($n, $factor, $suffix = '') {
@@ -190,28 +190,28 @@
}
function exeversion($file) {
- if (!isWindows()) return "?";
- if (class_exists('ffi') or loadPhpExtension('ffi'))
- return $this->exeversion_ffi($file);
- if (function_exists('res_list_type') or loadPhpExtension('win32std'))
- return $this->exeversion_resopen($file);
- return exeversion_showver($file);
- return '';
+ if (!isWindows()) return "?";
+ if (class_exists('ffi') or loadPhpExtension('ffi'))
+ return $this->exeversion_ffi($file);
+ if (function_exists('res_list_type') or loadPhpExtension('win32std'))
+ return $this->exeversion_resopen($file);
+ return exeversion_showver($file);
+ return '';
}
// http://www.codeproject.com/dll/showver.asp
function exeversion_showver($file) {
- $path = realpath($file);
- $result = `showver $path`;
- return "?";
+ $path = realpath($file);
+ $result = `showver $path`;
+ return "?";
}
function exeversion_ffi($file) {
- if (!DEBUG)
- return "?"; // not yet stable
-
- if (function_exists('ffi') or loadPhpExtension('ffi')) {
- $win32_idl = "
+ if (!DEBUG)
+ return "?"; // not yet stable
+
+ if (function_exists('ffi') or loadPhpExtension('ffi')) {
+ $win32_idl = "
struct VS_FIXEDFILEINFO {
DWORD dwSignature;
DWORD dwStrucVersion;
@@ -228,88 +228,88 @@
DWORD dwFileDateLS;
};
struct VS_VERSIONINFO { struct VS_VERSIONINFO
- WORD wLength;
- WORD wValueLength;
- WORD wType;
- WCHAR szKey[1];
- WORD Padding1[1];
- VS_FIXEDFILEINFO Value;
- WORD Padding2[1];
- WORD Children[1];
+ WORD wLength;
+ WORD wValueLength;
+ WORD wType;
+ WCHAR szKey[1];
+ WORD Padding1[1];
+ VS_FIXEDFILEINFO Value;
+ WORD Padding2[1];
+ WORD Children[1];
};
[lib='kernel32.dll'] DWORD GetFileVersionInfoSizeA(char *szFileName, DWORD *dwVerHnd);
[lib='kernel32.dll'] int GetFileVersionInfoA(char *sfnFile, DWORD dummy, DWORD size, struct VS_VERSIONINFO *pVer);
";
$ffi = new ffi($win32_idl);
$dummy = 0; // &DWORD
- $size = $ffi->GetFileVersionInfoSizeA($file, $dummy);
- //$pVer = str_repeat($size+1);
- $pVer = new ffi_struct($ffi, "VS_VERSIONINFO");
- if ($ffi->GetFileVersionInfoA($file, 0, $size, $pVer)
- and $pVer->wValueLength) {
- // analyze the VS_FIXEDFILEINFO(Value);
- // $pValue = new ffi_struct($ffi, "VS_FIXEDFILEINFO");
- $pValue =& $pVer->Value;
- return sprintf("%d.%d.%d.%d",
- $pValue->dwFileVersionMS >> 16,
- $pValue->dwFileVersionMS & 0xFFFF,
- $pValue->dwFileVersionLS >> 16,
- $pValue->dwFileVersionLS & 0xFFFF);
- }
- }
+ $size = $ffi->GetFileVersionInfoSizeA($file, $dummy);
+ //$pVer = str_repeat($size+1);
+ $pVer = new ffi_struct($ffi, "VS_VERSIONINFO");
+ if ($ffi->GetFileVersionInfoA($file, 0, $size, $pVer)
+ and $pVer->wValueLength) {
+ // analyze the VS_FIXEDFILEINFO(Value);
+ // $pValue = new ffi_struct($ffi, "VS_FIXEDFILEINFO");
+ $pValue =& $pVer->Value;
+ return sprintf("%d.%d.%d.%d",
+ $pValue->dwFileVersionMS >> 16,
+ $pValue->dwFileVersionMS & 0xFFFF,
+ $pValue->dwFileVersionLS >> 16,
+ $pValue->dwFileVersionLS & 0xFFFF);
+ }
+ }
}
// Read "RT_VERSION/VERSIONINFO" exe/dll resource info for MSWin32 binaries
// The "win32std" extension is not ready yet to pass back a VERSIONINFO struct
function exeversion_resopen($file) {
- if (function_exists('res_list_type') or loadPhpExtension('win32std')) {
- // See http://msdn.microsoft.com/workshop/networking/predefined/res.asp
- $v = file_get_contents('res://'.realpath($file).urlencode('/RT_VERSION/#1'));
- if ($v) {
- // This is really a binary VERSIONINFO block, with lots of
- // nul bytes (widechar) which cannot be transported as string.
- return "$v";
- }
+ if (function_exists('res_list_type') or loadPhpExtension('win32std')) {
+ // See http://msdn.microsoft.com/workshop/networking/predefined/res.asp
+ $v = file_get_contents('res://'.realpath($file).urlencode('/RT_VERSION/#1'));
+ if ($v) {
+ // This is really a binary VERSIONINFO block, with lots of
+ // nul bytes (widechar) which cannot be transported as string.
+ return "$v";
+ }
else {
- $h = res_open(realpath($file));
- $v = res_get($h, 'RT_VERSION', 'FileVersion');
- res_close($h);
- if ($v) return $v;
+ $h = res_open(realpath($file));
+ $v = res_get($h, 'RT_VERSION', 'FileVersion');
+ res_close($h);
+ if ($v) return $v;
- $h = res_open(realpath($file));
- $v = res_get($h, '#1', 'RT_VERSION', 1);
- res_close($h);
- if ($v) return $v;
- }
-
- /* The version consists of two 32-bit integers, defined by four 16-bit integers.
- For example, "FILEVERSION 3,10,0,61" is translated into two doublewords:
- 0x0003000a and 0x0000003d, in that order. */
-/*
- $h = res_open(realpath($file));
-
- echo "Res list of '$file': \n";
- $list= res_list_type($h, true);
- if( $list===FALSE ) err( "Can't list type" );
-
- for( $i= 0; $i<count($list); $i++ ) {
- echo $list[$i]."\n";
- $res= res_list($h, $list[$i]);
- for( $j= 0; $j<count($res); $j++ ) {
- echo "\t".$res[$j]."\n";
- }
- }
- echo "Res get: ".res_get( $h, 'A_TYPE', 'A_RC_NAME' )."\n\n";
- res_close( $h );
+ $h = res_open(realpath($file));
+ $v = res_get($h, '#1', 'RT_VERSION', 1);
+ res_close($h);
+ if ($v) return $v;
+ }
+
+ /* The version consists of two 32-bit integers, defined by four 16-bit integers.
+ For example, "FILEVERSION 3,10,0,61" is translated into two doublewords:
+ 0x0003000a and 0x0000003d, in that order. */
+/*
+ $h = res_open(realpath($file));
+
+ echo "Res list of '$file': \n";
+ $list= res_list_type($h, true);
+ if( $list===FALSE ) err( "Can't list type" );
+
+ for( $i= 0; $i<count($list); $i++ ) {
+ echo $list[$i]."\n";
+ $res= res_list($h, $list[$i]);
+ for( $j= 0; $j<count($res); $j++ ) {
+ echo "\t".$res[$j]."\n";
+ }
+ }
+ echo "Res get: ".res_get( $h, 'A_TYPE', 'A_RC_NAME' )."\n\n";
+ res_close( $h );
*/
- if ($v)
- return "$v";
- else
- return "";
- } else {
- return "";
- }
-
+ if ($v)
+ return "$v";
+ else
+ return "";
+ } else {
+ return "";
+ }
+
}
};
Modified: trunk/lib/plugin/FoafViewer.php
===================================================================
--- trunk/lib/plugin/FoafViewer.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/FoafViewer.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -2,7 +2,7 @@
rcs_id('$Id$');
/*
* Copyright (C) 2004 $ThePhpWikiProgrammingTeam
- *
+ *
* This file is part of PhpWiki.
*
* PhpWiki is free software; you can redistribute it and/or modify
@@ -32,7 +32,7 @@
* @author Davey Shafik <http://pear.php.net/user/davey>
* @date 2004-06-07
* @version 0.0.2
-* @bug XML_FOAF 0.2 has problems with named RDF nodes (ie, http://www.ahsonline.com.au/dod/FOAF.rdf).
+* @bug XML_FOAF 0.2 has problems with named RDF nodes (ie, http://www.ahsonline.com.au/dod/FOAF.rdf).
* Davey knows, will be fixing this soon.
* @todo "Friends" component
* @todo Named URLs (DC metadata)
@@ -44,10 +44,10 @@
* FoafViewer: Parse an RDF FOAF file and extract information to render as HTML
* usage: <?plugin FoafViewer foaf=http://www.ahsonline.com.au/dod/rawksuga.rdf original=true?>
* author: Daniel O'Connor <http://www.ahsonline.com.au/dod/FOAF.rdf>
- *
+ *
* phpwiki version based on version 0.0.2 by Daniel O'Connor
*
- * TODO:
+ * TODO:
* - use a template.
* - use the phpwiki internal user foaf data (stored by a UserPreferences extension)
* - fix the pear FOAF Parser or we'll write our own (based on our XmlParser)
@@ -55,7 +55,7 @@
class WikiPlugin_FoafViewer
extends WikiPlugin
{
- // The handler is handled okay. The only problem is that it still
+ // The handler is handled okay. The only problem is that it still
// throws a fatal.
function _error_handler($error) {
if (strstr($error->errstr,"Failed opening required 'XML/FOAF/Parser.php'"))
@@ -84,7 +84,7 @@
'original' => false
);
}
-
+
function run($dbi, $argstr, &$request, $basepage) {
/* ignore fatal on loading */
@@ -123,11 +123,11 @@
if (substr($foaf,0,7) != "http://") {
return $this->error(_("foaf must be a URI starting with http://"));
}
- // Start of output
- if (!empty($original)) {
+ // Start of output
+ if (!empty($original)) {
$request->redirect($foaf);
- }
- else {
+ }
+ else {
$foaffile = url_get_contents($foaf);
if (!$foaffile) {
//TODO: get errormsg
@@ -138,29 +138,29 @@
// Parser FOAF into $foaffile
$parser->parseFromMem($foaffile);
$a = $parser->toArray();
-
+
$html = HTML(HTML::h1(@$a[0]["name"]),
HTML::table(
HTML::thead(),
HTML::tbody(
- @$a[0]["title"] ?
+ @$a[0]["title"] ?
HTML::tr(HTML::td(_("Title")),
HTML::td($a[0]["title"])) : null,
- (@$a[0]["homepage"][0]) ?
+ (@$a[0]["homepage"][0]) ?
$this->iterateHTML($a[0],"homepage",$a["dc"]) : null,
(@$a[0]["weblog"][0]) ?
$this->iterateHTML($a[0],"weblog",$a["dc"]) : null,
//This seems broken?
/*
HTML::tr(HTML::td("Full Name"),
- (@$a[0]["name"][0]) ?
+ (@$a[0]["name"][0]) ?
HTML::td(@$a[0]["name"]) :
(@$a[0]["firstname"][0] && @$a[0]["surname"][0]) ?
HTML::td(@$a[0]["firstname"][0] . " " . @$a[0]["surname"][0])
: null
*/
HTML::tr(HTML::td("Full Name"),
- (@$a[0]["name"][0]) ?
+ (@$a[0]["name"][0]) ?
HTML::td(@$a[0]["name"]) : null
),
(@$a[0]["nick"][0]) ?
@@ -208,12 +208,12 @@
$string = '<a href="http://beta.plink.org/profile/' . $array[$index][$i] . '">'
.'<img src="http://beta.plink.org/images/plink.png" alt="Plink - ' . $array[$index][$i] . '" /></a>';
}
- else if ($index == "depiction") {
+ else if ($index == "depiction") {
$string = '<img src="' . $array[$index][$i] . '" />';
}
- else if ((substr($array[$index][$i],0,7) == "http://") || (substr($array[$index][$i],0,7) == "mailto:")) {
+ else if ((substr($array[$index][$i],0,7) == "http://") || (substr($array[$index][$i],0,7) == "mailto:")) {
$string = '<a href="' . $array[$index][$i] . '"';
-
+
if (@$dc["description"][$array[$index][$i]]) {
$string .= ' title="' . $dc["description"][$array[$index][$i]] . '"';
}
@@ -223,12 +223,12 @@
}
else {
$string .= $array[$index][$i];
- }
+ }
$string .= '</a>';
}
@$html .= "<tr><td>" . $index . "</td><td>" . $string . "</td></tr>";
}
-
+
return HTML::raw($html);
}
}
Modified: trunk/lib/plugin/FrameInclude.php
===================================================================
--- trunk/lib/plugin/FrameInclude.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/FrameInclude.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -87,7 +87,7 @@
return $this->disabled("(action != 'browse')");
if (! $request->isGetOrHead())
return $this->disabled("(method != 'GET')");
-
+
if (!$src and $page) {
if ($page == $request->get('pagename')) {
return $this->error(sprintf(_("recursive inclusion of page %s"),
@@ -129,12 +129,12 @@
'scrolling' => (string)$scrolling,
'noresize' => (bool)$noresize,
));
-
+
if ($marginwidth)
$frame->setArg('marginwidth', $marginwidth);
if ($marginheight)
$frame->setArg('marginheight', $marginheight);
-
+
$tokens = array('CONTENT_FRAME' => $frame,
'ROWS' => $rows,
'COLS' => $cols,
Modified: trunk/lib/plugin/FullTextSearch.php
===================================================================
--- trunk/lib/plugin/FullTextSearch.php 2010-03-04 10:30:39 UTC (rev 7301)
+++ trunk/lib/plugin/FullTextSearch.php 2010-03-04 10:48:07 UTC (rev 7302)
@@ -30,8 +30,8 @@
*
* See also:
* Hooks to search in external documents: ExternalTextSearch
- * Only uploaded: textfiles, PDF, HTML, DOC, XLS, ... or
- * External apps: xapian-omages seems to be the better than lucene,
+ * Only uploaded: textfiles, PDF, HTML, DOC, XLS, ... or
+ * External apps: xapian-omages seems to be the better than lucene,
* lucene.net, swish, nakamazu, ...
*
* See http://sf.net/tracker/index.php?aid=927395&group_id=6121&atid=106121
@@ -63,7 +63,7 @@
'hilight' => true,
'case_exact' => false,
'regex' => 'auto',
- 'sortby' => '-hi_content',
+ 'sortby' => '-hi_content',
'noheader' => false,
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|