You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(43) |
Nov
(73) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(34) |
Feb
(110) |
Mar
(24) |
Apr
(44) |
May
(37) |
Jun
(22) |
Jul
(20) |
Aug
(28) |
Sep
(50) |
Oct
(11) |
Nov
(132) |
Dec
(595) |
2002 |
Jan
(1099) |
Feb
(579) |
Mar
(63) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(125) |
Sep
(101) |
Oct
(25) |
Nov
(34) |
Dec
(47) |
2003 |
Jan
(82) |
Feb
(182) |
Mar
(71) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
(14) |
Oct
(6) |
Nov
(124) |
Dec
(68) |
2004 |
Jan
(64) |
Feb
(191) |
Mar
(199) |
Apr
(298) |
May
(252) |
Jun
(426) |
Jul
(134) |
Aug
(13) |
Sep
(96) |
Oct
(75) |
Nov
(232) |
Dec
(171) |
2005 |
Jan
(205) |
Feb
(165) |
Mar
(8) |
Apr
(74) |
May
(21) |
Jun
(19) |
Jul
(37) |
Aug
(69) |
Sep
(141) |
Oct
(118) |
Nov
(31) |
Dec
(7) |
2006 |
Jan
(5) |
Feb
(10) |
Mar
(35) |
Apr
(24) |
May
(34) |
Jun
(29) |
Jul
(5) |
Aug
(38) |
Sep
(30) |
Oct
(37) |
Nov
(30) |
Dec
(86) |
2007 |
Jan
(414) |
Feb
(40) |
Mar
(18) |
Apr
(10) |
May
(66) |
Jun
(60) |
Jul
(105) |
Aug
(55) |
Sep
(64) |
Oct
(7) |
Nov
(11) |
Dec
(5) |
2008 |
Jan
(26) |
Feb
(28) |
Mar
(79) |
Apr
(34) |
May
(61) |
Jun
(24) |
Jul
(29) |
Aug
(160) |
Sep
(62) |
Oct
(70) |
Nov
(32) |
Dec
(14) |
2009 |
Jan
(140) |
Feb
(135) |
Mar
(153) |
Apr
(53) |
May
(24) |
Jun
(138) |
Jul
(90) |
Aug
(46) |
Sep
(72) |
Oct
(84) |
Nov
(32) |
Dec
(4) |
2010 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(55) |
May
(89) |
Jun
(131) |
Jul
(41) |
Aug
(38) |
Sep
(42) |
Oct
(11) |
Nov
(27) |
Dec
(54) |
2011 |
Jan
(127) |
Feb
(16) |
Mar
(71) |
Apr
(52) |
May
(32) |
Jun
(31) |
Jul
(4) |
Aug
|
Sep
(45) |
Oct
(26) |
Nov
(36) |
Dec
(10) |
2012 |
Jan
(23) |
Feb
(6) |
Mar
(13) |
Apr
(18) |
May
(1) |
Jun
(4) |
Jul
(3) |
Aug
(12) |
Sep
(57) |
Oct
(96) |
Nov
(163) |
Dec
(124) |
2013 |
Jan
(11) |
Feb
(17) |
Mar
(7) |
Apr
(48) |
May
(15) |
Jun
(29) |
Jul
(12) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(3) |
2014 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(8) |
Jun
(90) |
Jul
(104) |
Aug
(12) |
Sep
(81) |
Oct
(139) |
Nov
(111) |
Dec
(64) |
2015 |
Jan
(46) |
Feb
(74) |
Mar
(56) |
Apr
(61) |
May
(3) |
Jun
(7) |
Jul
(11) |
Aug
(5) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
(15) |
2016 |
Jan
(25) |
Feb
(33) |
Mar
(24) |
Apr
(4) |
May
(24) |
Jun
(3) |
Jul
(75) |
Aug
|
Sep
(2) |
Oct
(38) |
Nov
(4) |
Dec
(18) |
2017 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(14) |
Jun
|
Jul
(5) |
Aug
(9) |
Sep
|
Oct
(23) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(9) |
Apr
(60) |
May
(1) |
Jun
|
Jul
(13) |
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(15) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
2021 |
Jan
(24) |
Feb
(33) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(64) |
Jul
(71) |
Aug
(114) |
Sep
(82) |
Oct
(32) |
Nov
(76) |
Dec
(86) |
2022 |
Jan
(162) |
Feb
(41) |
Mar
(11) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2023 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2024 |
Jan
(7) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(90) |
Mar
(19) |
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <var...@us...> - 2015-02-11 17:19:09
|
Revision: 9526 http://sourceforge.net/p/phpwiki/code/9526 Author: vargenau Date: 2015-02-11 17:19:01 +0000 (Wed, 11 Feb 2015) Log Message: ----------- You must be logged in to add blog entries. Modified Paths: -------------- trunk/PhpWiki.wsdl trunk/lib/plugin/WikiBlog.php Modified: trunk/PhpWiki.wsdl =================================================================== --- trunk/PhpWiki.wsdl 2015-02-11 16:08:34 UTC (rev 9525) +++ trunk/PhpWiki.wsdl 2015-02-11 17:19:01 UTC (rev 9526) @@ -360,7 +360,7 @@ <service name="wikiService"> <port name="wikiPortType" binding="tns:wikiBinding"> - <soap:address location="http://phpwiki.fr/SOAP.php" /> + <soap:address location="http://phpwiki.nmu.alcatel.fr/phpwiki/SOAP.php" /> </port> </service> </definitions> Modified: trunk/lib/plugin/WikiBlog.php =================================================================== --- trunk/lib/plugin/WikiBlog.php 2015-02-11 16:08:34 UTC (rev 9525) +++ trunk/lib/plugin/WikiBlog.php 2015-02-11 17:19:01 UTC (rev 9526) @@ -95,9 +95,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - // allow empty pagenames for ADMIN_USER style blogs: "Blog/day" - //if (!$args['pagename']) - // return $this->error(_("No pagename specified")); // Get our form args. $blog = $request->getArg("edit"); @@ -142,21 +139,20 @@ // This is similar to editpage. Shouldn't we use just this for preview? $parent = $posted['pagename']; if (empty($parent)) { - $prefix = ""; // allow empty parent for default "Blog/day" + $prefix = ''; // allow empty parent for default "Blog/day" $parent = HOME_PAGE; } elseif (($parent == 'Blog' or $parent == 'WikiBlog') and $type == 'wikiblog') { // avoid Blog/Blog/2003-01-11/14:03:02+00:00 - $prefix = ""; + $prefix = ''; $parent = ''; // 'Blog'; } elseif ($parent == 'Comment' and $type == "comment") { - $prefix = ""; + $prefix = ''; $parent = ''; // 'Comment'; } elseif ($parent == 'Forum' and $type == "wikiforum") { - $prefix = ""; + $prefix = ''; $parent = ''; // 'Forum'; } else { $prefix = $parent . '/'; } - //$request->finish(fmt("No pagename specified for %s",$type)); $now = time(); $dbi = $request->getDbh(); @@ -222,7 +218,9 @@ // Maybe add the BlogArchives plugin instead for the new interim subpage. $redirected = $prefix . $pagename; if (!$dbi->isWikiPage($redirected)) { - if (!$parent) $parent = HOME_PAGE; + if (!$parent) { + $parent = HOME_PAGE; + } require_once 'lib/loadsave.php'; $pageinfo = array('pagename' => $redirected, 'content' => '<<RedirectTo page="' . $parent . '">>', @@ -231,7 +229,7 @@ ); SavePage($request, $pageinfo, ''); } - $redirected = $prefix . $pagename . '/' . preg_replace("/T.*/", "", "$time"); + $redirected = $prefix . $pagename . '/' . preg_replace("/T.*/", '', "$time"); if (!$dbi->isWikiPage($redirected)) { if (!$parent) $parent = HOME_PAGE; require_once 'lib/loadsave.php'; @@ -350,7 +348,7 @@ function findBlogs(&$dbi, $basepage = '', $type = 'wikiblog') { $prefix = (empty($basepage) - ? "" + ? '' : $basepage . '/') . $this->blogPrefix($type); $pages = $dbi->titleSearch(new TextSearchQuery('"' . $prefix . '"', true, 'none')); @@ -374,6 +372,13 @@ function showForm(&$request, $args, $template = 'blogform') { + $user = $request->getUser(); + if (!($user->isSignedIn())) { + // Cannot create entry + return HTML::p(array('class' => 'warning'), + _('You must be logged in to add blog entries.')); + } + // Show blog-entry form. $args = array('PAGENAME' => $args['pagename'], 'HIDDEN_INPUTS' => This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 16:08:41
|
Revision: 9525 http://sourceforge.net/p/phpwiki/code/9525 Author: vargenau Date: 2015-02-11 16:08:34 +0000 (Wed, 11 Feb 2015) Log Message: ----------- PHP Doc Modified Paths: -------------- trunk/lib/plugin/WikiBlog.php Modified: trunk/lib/plugin/WikiBlog.php =================================================================== --- trunk/lib/plugin/WikiBlog.php 2015-02-11 15:47:25 UTC (rev 9524) +++ trunk/lib/plugin/WikiBlog.php 2015-02-11 16:08:34 UTC (rev 9525) @@ -273,6 +273,12 @@ // Any way to jump back to preview mode??? } + /** + * @param WikiRequest $request + * @param array $args + * @param string $type + * @return XmlContent + */ function showAll(&$request, $args, $type = "wikiblog") { // FIXME: currently blogSearch uses WikiDB->titleSearch to @@ -309,8 +315,13 @@ return $html; } - // Subpage for the basepage. All Blogs/Forum/Comment entries are - // Subpages under this pagename, to find them faster. + /** + * Subpage for the basepage. All Blogs/Forum/Comment entries are + * Subpages under this pagename, to find them faster. + * + * @param string $type + * @return string + */ protected function blogPrefix($type = 'wikiblog') { if ($type == 'wikiblog') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 15:47:27
|
Revision: 9524 http://sourceforge.net/p/phpwiki/code/9524 Author: vargenau Date: 2015-02-11 15:47:25 +0000 (Wed, 11 Feb 2015) Log Message: ----------- Remove themes/blog/templates/blogform.tmpl, identical to themes/default/templates/blogform.tmpl Removed Paths: ------------- trunk/themes/blog/templates/blogform.tmpl Deleted: trunk/themes/blog/templates/blogform.tmpl =================================================================== --- trunk/themes/blog/templates/blogform.tmpl 2015-02-11 15:39:59 UTC (rev 9523) +++ trunk/themes/blog/templates/blogform.tmpl 2015-02-11 15:47:25 UTC (rev 9524) @@ -1,29 +0,0 @@ -<div class="wikiblog wikiblog-form"> -<form action="<?php echo $request->getPostURL()?>" method="post" name="editpage" - accept-charset="UTF-8" id="wikiblog-form"> - <input type="hidden" name="edit[pagename]" value="<?php echo $PAGENAME?>" /> - <input type="hidden" name="mode" value="add" /> - <div class="wikiblog-form"> - <?php echo _("Headline")._(": ") ?><br /> - <input id="wikiblog-summary" required="required" class="wikitext" type="text" style="width:540px" size="60" - maxlength="256" name="edit[summary]" value="" /> - <br /> - <?php if (isset($EDIT_TOOLBAR)) { ?> - <?php echo $EDIT_TOOLBAR ?> - <?php } ?> - <a id="editarea"></a> - <textarea id="edit-content" required="required" class="edit-content" rows="8" style="width:540px" - name="edit[content]"></textarea> - <br /> - <input id="wikiblog-submit" type="submit" value="<?php echo _("Add Entry")?>" - name="edit[save]" class="wikiaction" /> - </div> - -<hr /> -<div class="wiki-edithelp"> - <p><?php echo fmt("See %s tips for editing.", WikiLink(_("Help")."/"._("GoodStyle"))) ?></p> - <?plugin IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1?> -</div> -<?php echo $HIDDEN_INPUTS?> -</form> -</div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 15:40:07
|
Revision: 9523 http://sourceforge.net/p/phpwiki/code/9523 Author: vargenau Date: 2015-02-11 15:39:59 +0000 (Wed, 11 Feb 2015) Log Message: ----------- Check EDIT_TOOLBAR; add <br />; add HTML 5 required Modified Paths: -------------- trunk/themes/blog/templates/blogform.tmpl trunk/themes/default/templates/blogform.tmpl trunk/themes/fusionforge/templates/blogform.tmpl Modified: trunk/themes/blog/templates/blogform.tmpl =================================================================== --- trunk/themes/blog/templates/blogform.tmpl 2015-02-11 14:54:51 UTC (rev 9522) +++ trunk/themes/blog/templates/blogform.tmpl 2015-02-11 15:39:59 UTC (rev 9523) @@ -5,11 +5,14 @@ <input type="hidden" name="mode" value="add" /> <div class="wikiblog-form"> <?php echo _("Headline")._(": ") ?><br /> - <input id="wikiblog-summary" class="wikitext" type="text" style="width:540px" size="60" + <input id="wikiblog-summary" required="required" class="wikitext" type="text" style="width:540px" size="60" maxlength="256" name="edit[summary]" value="" /> - <?php echo $EDIT_TOOLBAR ?> + <br /> + <?php if (isset($EDIT_TOOLBAR)) { ?> + <?php echo $EDIT_TOOLBAR ?> + <?php } ?> <a id="editarea"></a> - <textarea id="edit-content" class="edit-content" rows="8" style="width:540px" + <textarea id="edit-content" required="required" class="edit-content" rows="8" style="width:540px" name="edit[content]"></textarea> <br /> <input id="wikiblog-submit" type="submit" value="<?php echo _("Add Entry")?>" Modified: trunk/themes/default/templates/blogform.tmpl =================================================================== --- trunk/themes/default/templates/blogform.tmpl 2015-02-11 14:54:51 UTC (rev 9522) +++ trunk/themes/default/templates/blogform.tmpl 2015-02-11 15:39:59 UTC (rev 9523) @@ -5,11 +5,14 @@ <input type="hidden" name="mode" value="add" /> <div class="wikiblog-form"> <?php echo _("Headline")._(": ") ?><br /> - <input id="wikiblog-summary" class="wikitext" type="text" style="width:540px" size="60" + <input id="wikiblog-summary" required="required" class="wikitext" type="text" style="width:540px" size="60" maxlength="256" name="edit[summary]" value="" /> - <?php echo $EDIT_TOOLBAR ?> + <br /> + <?php if (isset($EDIT_TOOLBAR)) { ?> + <?php echo $EDIT_TOOLBAR ?> + <?php } ?> <a id="editarea"></a> - <textarea id="edit-content" class="edit-content" rows="8" style="width:540px" + <textarea id="edit-content" required="required" class="edit-content" rows="8" style="width:540px" name="edit[content]"></textarea> <br /> <input id="wikiblog-submit" type="submit" value="<?php echo _("Add Entry")?>" Modified: trunk/themes/fusionforge/templates/blogform.tmpl =================================================================== --- trunk/themes/fusionforge/templates/blogform.tmpl 2015-02-11 14:54:51 UTC (rev 9522) +++ trunk/themes/fusionforge/templates/blogform.tmpl 2015-02-11 15:39:59 UTC (rev 9523) @@ -5,11 +5,14 @@ <input type="hidden" name="mode" value="add" /> <div class="wikiblog-form"> <?php echo _("Headline")._(": ") ?><br /> - <input id="wikiblog-summary" class="wikitext" type="text" style="width:540px" size="60" + <input id="wikiblog-summary" required="required" class="wikitext" type="text" style="width:540px" size="60" maxlength="256" name="edit[summary]" value="" /> - <?php echo $EDIT_TOOLBAR ?> + <br /> + <?php if (isset($EDIT_TOOLBAR)) { ?> + <?php echo $EDIT_TOOLBAR ?> + <?php } ?> <a id="editarea"></a> - <textarea id="edit-content" class="edit-content" rows="8" cols="68" style="width:540px" + <textarea id="edit-content" required="required" class="edit-content" rows="8" cols="68" style="width:540px" name="edit[content]"></textarea> <br /> <input id="wikiblog-submit" type="submit" value="<?php echo _("Add Entry")?>" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 14:54:54
|
Revision: 9522 http://sourceforge.net/p/phpwiki/code/9522 Author: vargenau Date: 2015-02-11 14:54:51 +0000 (Wed, 11 Feb 2015) Log Message: ----------- MAX_FILE_SITE --> MAX_FILE_SIZE Modified Paths: -------------- trunk/locale/de/pgsrc/Hilfe%2FHochLadenPlugin trunk/pgsrc/Help%2FUpLoadPlugin Modified: trunk/locale/de/pgsrc/Hilfe%2FHochLadenPlugin =================================================================== --- trunk/locale/de/pgsrc/Hilfe%2FHochLadenPlugin 2015-02-11 13:32:57 UTC (rev 9521) +++ trunk/locale/de/pgsrc/Hilfe%2FHochLadenPlugin 2015-02-11 14:54:51 UTC (rev 9522) @@ -1,4 +1,4 @@ -Date: Tue, 7 Oct 2014 19:05:52 +0000 +Date: Wed, 11 Feb 2015 15:54:13 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.5.2) Content-Type: application/x-phpwiki; pagename=Hilfe%2FHochLadenPlugin; @@ -38,7 +38,7 @@ # The user must be authenticated to be able to upload. # The filename may not end with certain disallowed extensions, to prevent from abuse. -# MAX_FILE_SITE is configured by the config.ini option MAX_UPLOAD_SIZE, which defaults to 16MB. +# MAX_FILE_SIZE is configured by the config.ini option MAX_UPLOAD_SIZE, which defaults to 16MB. Your webserver and php may add another limit. # Already existing uploaded files are NOT overwritten. # Certain internal php problems for Windows and MacOSX have been fixed with 1.3.9. Modified: trunk/pgsrc/Help%2FUpLoadPlugin =================================================================== --- trunk/pgsrc/Help%2FUpLoadPlugin 2015-02-11 13:32:57 UTC (rev 9521) +++ trunk/pgsrc/Help%2FUpLoadPlugin 2015-02-11 14:54:51 UTC (rev 9522) @@ -1,4 +1,4 @@ -Date: Mon, 3 Nov 2014 15:32:08 +0000 +Date: Wed, 11 Feb 2015 15:53:57 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.5.2) Content-Type: application/x-phpwiki; pagename=Help%2FUpLoadPlugin; @@ -8,8 +8,8 @@ The **~UpLoad** [[Help:WikiPlugin|plugin]] displays an editbox and two buttons. * The first button lets you choose the file to be uploaded at your local filesystem. The text value of this button is localised from your browser. -* The second "Upload" button actually uploads the given filename to the upload directory. -This directory is not browsable, any file there may be accessed by using the "Upload~:" +* The second “Upload” button actually uploads the given filename to the upload directory. +This directory is not browsable, any file there may be accessed by using the “Upload~:” [[InterWikiMap]] prefix to the given filename. This way you can easily inline uploaded images. == Usage == @@ -47,7 +47,7 @@ # The user must be authenticated to be able to upload. # The filename may not end with certain disallowed extensions, to prevent from abuse. -# MAX_FILE_SITE is configured by the config.ini option MAX_UPLOAD_SIZE, which defaults to 16MB. Your webserver and PHP may add another limit. +# MAX_FILE_SIZE is configured by the ##config.ini## option MAX_UPLOAD_SIZE, which defaults to 16MB. Your webserver and PHP may add another limit. # Already existing uploaded files are NOT overwritten. == Example == This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 13:33:05
|
Revision: 9521 http://sourceforge.net/p/phpwiki/code/9521 Author: vargenau Date: 2015-02-11 13:32:57 +0000 (Wed, 11 Feb 2015) Log Message: ----------- Merge for plain Phpwiki and Fusionforge Modified Paths: -------------- trunk/lib/plugin/RateIt.php Modified: trunk/lib/plugin/RateIt.php =================================================================== --- trunk/lib/plugin/RateIt.php 2015-02-11 10:21:22 UTC (rev 9520) +++ trunk/lib/plugin/RateIt.php 2015-02-11 13:32:57 UTC (rev 9521) @@ -179,7 +179,6 @@ ob_end_clean(); // discard any previous output // delete the cache $page = $request->getPage(); - //$page->set('_cached_html', false); $request->cacheControl('MUST-REVALIDATE'); $dbi = $request->getDbh(); $dbi->touch(); @@ -210,8 +209,6 @@ function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; - //$this->_request = & $request; - //$this->_dbi = & $dbi; $user = $request->getUser(); if (defined('FUSIONFORGE') && FUSIONFORGE) { if ($user && is_object($user) && $user->isAuthenticated()) { @@ -393,7 +390,6 @@ $imgId = 'RateIt' . $pageid; $actionImgName = 'RateIt' . $pageid . 'Action'; - //$rdbi =& $this->_rdbi; $rdbi = RatingsDb::getTheRatingsDb(); // check if the imgPrefix icons exist. @@ -405,7 +401,6 @@ $reImgId = $this->_javascript_quote_string($imgId); $reActionImgName = $this->_javascript_quote_string($actionImgName); $rePagename = $this->_javascript_quote_string($pagename); - //$dimension = $args['pagename'] . "rat"; $html = HTML::span(array("class" => "rateit-widget", "id" => $imgId)); for ($i = 0; $i < 2; $i++) { @@ -428,33 +423,13 @@ } } else $canRate = 0 & $canRate; - if (empty($this->avg)) - $this->avg = $rdbi->getAvg($pagename, $dimension); - if (!$this->avg) - $this->avg = 0; - if (empty($this->numusers)) - $this->numusers = $rdbi->getNumUsers($pagename, $dimension); - } else { - if (empty($this->userid)) { - $user = $request->getUser(); - $this->userid = $user->getId(); - } - if (empty($this->rating)) { - $this->rating = $rdbi->getRating($this->userid, $pagename, $dimension); - if (!$this->rating and empty($this->pred)) { - $this->pred = $rdbi->getPrediction($this->userid, $pagename, $dimension); - } - } - } - for ($i = 1; $i <= 10; $i++) { - if (!defined('FUSIONFORGE') && FUSIONFORGE) { - $j = $i / 2; - $a1 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," - . "'$reImgId','$dimension',$j)")); - } - $img_attr = array(); - $img_attr['src'] = $nk[$i % 2]; - if (defined('FUSIONFORGE') && FUSIONFORGE) { + if (empty($this->avg)) $this->avg = $rdbi->getAvg($pagename, $dimension); + if (!$this->avg) $this->avg = 0; + if (empty($this->numusers)) $this->numusers = $rdbi->getNumUsers($pagename, $dimension); + + for ($i = 1; $i <= 10; $i++) { + $img_attr = array(); + $img_attr['src'] = $nk[$i % 2]; if ($canRate) { $jsCanRate = "canRate['$reImgId'] = 1;\n"; $a1 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," @@ -481,7 +456,30 @@ } $a1 = HTML::span(); } - } else { + $img_attr['id'] = $imgId . $i; + $img_attr['alt'] = $img_attr['id']; + $a1->pushContent(HTML::img($img_attr)); + $html->pushContent($a1); + } + $html->pushContent(HTML::raw(" ")); + } else { + if (empty($this->userid)) { + $user = $request->getUser(); + $this->userid = $user->getId(); + } + if (empty($this->rating)) { + $this->rating = $rdbi->getRating($this->userid, $pagename, $dimension); + if (!$this->rating and empty($this->pred)) { + $this->pred = $rdbi->getPrediction($this->userid, $pagename, $dimension); + } + } + + for ($i = 1; $i <= 10; $i++) { + $j = $i / 2; + $a1 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," + . "'$reImgId','$dimension',$j)")); + $img_attr = array(); + $img_attr['src'] = $nk[$i % 2]; if ($this->rating) { $img_attr['src'] = $ok[$i % 2]; $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,0,1)"; @@ -494,18 +492,14 @@ $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,0,1)"; $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',0,0,1)"; } + $img_attr['id'] = $imgId . $i; + $img_attr['alt'] = $img_attr['id']; + $a1->pushContent(HTML::img($img_attr)); + $html->pushContent($a1); } - //$imgName = 'RateIt'.$reImgId.$i; - $img_attr['id'] = $imgId . $i; - $img_attr['alt'] = $img_attr['id']; - $a1->pushContent(HTML::img($img_attr)); - //$a1->addToolTip(_("Rate the topic of this page")); - $html->pushContent($a1); + $html->pushContent(HTML::raw(" ")); + } - //This adds a space between the rating smilies: - //if (($i%2) == 0) $html->pushContent("\n"); - } - $html->pushContent(HTML::raw(" ")); if (defined('FUSIONFORGE') && FUSIONFORGE) { if ($canRate) { $a0 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," @@ -521,7 +515,6 @@ if (!$this->rating) $imgprops['style'] = 'display:none'; $a0->pushContent(HTML::img($imgprops)); - //$a0->addToolTip($msg); $html->pushContent($a0); } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 10:21:24
|
Revision: 9520 http://sourceforge.net/p/phpwiki/code/9520 Author: vargenau Date: 2015-02-11 10:21:22 +0000 (Wed, 11 Feb 2015) Log Message: ----------- Update translations Modified Paths: -------------- trunk/locale/de/LC_MESSAGES/phpwiki.mo trunk/locale/es/LC_MESSAGES/phpwiki.mo trunk/locale/fr/LC_MESSAGES/phpwiki.mo trunk/locale/it/LC_MESSAGES/phpwiki.mo trunk/locale/ja/LC_MESSAGES/phpwiki.mo trunk/locale/nl/LC_MESSAGES/phpwiki.mo trunk/locale/po/de.po trunk/locale/po/es.po trunk/locale/po/fr.po trunk/locale/po/it.po trunk/locale/po/ja.po trunk/locale/po/nl.po trunk/locale/po/phpwiki.pot trunk/locale/po/sv.po trunk/locale/po/zh.po trunk/locale/sv/LC_MESSAGES/phpwiki.mo trunk/locale/zh/LC_MESSAGES/phpwiki.mo Modified: trunk/locale/de/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/es/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/fr/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/it/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/ja/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/nl/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/po/de.po =================================================================== --- trunk/locale/po/de.po 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/de.po 2015-02-11 10:21:22 UTC (rev 9520) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2000-10-31 02:23+0200\n" "Last-Translator: Reini Urban <ru...@x-...>, Carsten Klapp " "<car...@us...>, Helmer Pardun <pardunpress@t-online." @@ -2425,6 +2425,10 @@ msgstr "Keine Seite angegeben" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "Deine Bewertung war %.1f" Modified: trunk/locale/po/es.po =================================================================== --- trunk/locale/po/es.po 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/es.po 2015-02-11 10:21:22 UTC (rev 9520) @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2000-02-01 00:50-0500\n" "Last-Translator: Pablo Roca <pr...@cl...>\n" "Language-Team: \n" @@ -2361,6 +2361,10 @@ msgstr "" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "" Modified: trunk/locale/po/fr.po =================================================================== --- trunk/locale/po/fr.po 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/fr.po 2015-02-11 10:21:22 UTC (rev 9520) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2004-06-22 21:10+0200\n" "Last-Translator: Pierrick Meignen <mei...@wa...>, Roland " "Trique <rol...@fr...>, Stéphane Gourichon <stephane.gourichon@lip6." @@ -2385,6 +2385,10 @@ msgstr "aucune page indiquée" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "Votre note est %.1f" @@ -6033,9 +6037,6 @@ #~ msgid "sent to %s" #~ msgstr "envoyé à %s" -#~ msgid "edit area" -#~ msgstr "zone d'édition" - #~ msgid "" #~ "Preview only! Changes not saved. Please continue editing. (You'll find " #~ "your edit area at the bottom of the page.)" @@ -6053,6 +6054,9 @@ #~ msgid "ActionPage" #~ msgstr "Pages d'action" +#~ msgid "edit area" +#~ msgstr "zone d'édition" + #~ msgid "ZIP files of database" #~ msgstr "Récupérer dans un fichier ZIP" Modified: trunk/locale/po/it.po =================================================================== --- trunk/locale/po/it.po 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/it.po 2015-02-11 10:21:22 UTC (rev 9520) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2005-02-12 16:23+0100\n" "Last-Translator: Antonio Bonifati ant[(at)]monitor.deis.unical.it\n" "Language-Team: \n" @@ -2339,6 +2339,10 @@ msgstr "" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "" Modified: trunk/locale/po/ja.po =================================================================== --- trunk/locale/po/ja.po 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/ja.po 2015-02-11 10:21:22 UTC (rev 9520) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2003-06-07 09:01+0900\n" "Last-Translator: Tadashi Jokagi <web...@el...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -2363,6 +2363,10 @@ msgstr "" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "" Modified: trunk/locale/po/nl.po =================================================================== --- trunk/locale/po/nl.po 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/nl.po 2015-02-11 10:21:22 UTC (rev 9520) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2000-09-30 02:23+0200\n" "Last-Translator: Jan Nieuwenhuizen <ja...@gn...>\n" "Language-Team: Dutch <nl...@li...>\n" @@ -2330,6 +2330,10 @@ msgstr "" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "" Modified: trunk/locale/po/phpwiki.pot =================================================================== --- trunk/locale/po/phpwiki.pot 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/phpwiki.pot 2015-02-11 10:21:22 UTC (rev 9520) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki-1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2002-12-14 17:51-0500\n" "Last-Translator: Reini Urban <ru...@us...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -2324,6 +2324,10 @@ msgstr "" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "" Modified: trunk/locale/po/sv.po =================================================================== --- trunk/locale/po/sv.po 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/sv.po 2015-02-11 10:21:22 UTC (rev 9520) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2001-01-27 01:58+0200\n" "Last-Translator: Jon Åslund <jo...@he...>\n" "Language-Team: \n" @@ -2325,6 +2325,10 @@ msgstr "" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "" Modified: trunk/locale/po/zh.po =================================================================== --- trunk/locale/po/zh.po 2015-02-11 10:19:11 UTC (rev 9519) +++ trunk/locale/po/zh.po 2015-02-11 10:21:22 UTC (rev 9520) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-09 11:19+0100\n" +"POT-Creation-Date: 2015-02-11 11:20+0100\n" "PO-Revision-Date: 2004-04-21 10:08+0800\n" "Last-Translator: DruryL <dr...@us...>\n" "Language-Team: DruryL <dr...@us...>\n" @@ -2421,6 +2421,10 @@ msgstr "沒有指定頁面" #, php-format +msgid "Rating: %s (%d vote" +msgstr "" + +#, php-format msgid "Your rating was %.1f" msgstr "你的評比是 %.1f" Modified: trunk/locale/sv/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) Modified: trunk/locale/zh/LC_MESSAGES/phpwiki.mo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 10:19:19
|
Revision: 9519 http://sourceforge.net/p/phpwiki/code/9519 Author: vargenau Date: 2015-02-11 10:19:11 +0000 (Wed, 11 Feb 2015) Log Message: ----------- Merge for plain Phpwiki and Fusionforge Modified Paths: -------------- trunk/lib/plugin/RateIt.php Modified: trunk/lib/plugin/RateIt.php =================================================================== --- trunk/lib/plugin/RateIt.php 2015-02-11 10:00:13 UTC (rev 9518) +++ trunk/lib/plugin/RateIt.php 2015-02-11 10:19:11 UTC (rev 9519) @@ -152,8 +152,10 @@ { // early side-effects (before body) global $WikiTheme; static $_already; - if (!empty($_already)) return; - $_already = 1; + if (!(defined('FUSIONFORGE') && FUSIONFORGE)) { + if (!empty($_already)) return; + $_already = 1; + } $WikiTheme->addMoreHeaders(JavaScript( "var prediction = new Array; var rating = new Array; var avg = new Array; var numusers = new Array; @@ -211,14 +213,24 @@ //$this->_request = & $request; //$this->_dbi = & $dbi; $user = $request->getUser(); - //FIXME: fails on test with DumpHtml:RateIt - if (!is_object($user)) { - return HTML::raw(''); + if (defined('FUSIONFORGE') && FUSIONFORGE) { + if ($user && is_object($user) && $user->isAuthenticated()) { + //FIXME: fails on test with DumpHtml:RateIt + $this->userid = $user->getId(); + $isAuth = 1; + } else { + $isAuth = 0; + } + } else { + //FIXME: fails on test with DumpHtml:RateIt + if (!is_object($user)) { + return HTML::raw(''); + } + $this->userid = $user->getId(); + if (!$this->userid) { + return HTML::raw(''); + } } - $this->userid = $user->getId(); - if (!$this->userid) { - return HTML::raw(''); - } $args = $this->getArgs($argstr, $request); $this->dimension = $args['dimension']; $this->imgPrefix = $args['imgPrefix']; @@ -239,14 +251,16 @@ $rdbi = RatingsDb::getTheRatingsDb(); $this->_rdbi =& $rdbi; - if ($args['mode'] === 'add') { - //if (!$user->isSignedIn()) return $this->error(_("You must sign in")); + if (!(defined('FUSIONFORGE') && FUSIONFORGE)) { + $isAuth = true; + } + + if ($isAuth && $args['mode'] === 'add') { $this->rating = $request->getArg('rating'); $rdbi->addRating($this->rating, $this->userid, $this->pagename, $this->dimension); $this->displayActionImg('add'); - } elseif ($args['mode'] === 'delete') { - //if (!$user->isSignedIn()) return $this->error(_("You must sign in")); + } elseif ($isAuth && $args['mode'] === 'delete') { $rdbi->deleteRating($this->userid, $this->pagename, $this->dimension); unset($this->rating); $this->displayActionImg('delete'); @@ -254,28 +268,43 @@ return $this->RatingWidgetHtml($args['pagename'], $args['version'], $args['imgPrefix'], $args['dimension'], $args['small']); } else { - //if (!$user->isSignedIn()) return $this->error(_("You must sign in")); - //extract($args); - $this->rating = $rdbi->getRating($this->userid, $this->pagename, $this->dimension); + if ($isAuth) + $this->rating = $rdbi->getRating($this->userid, $this->pagename, $this->dimension); + else + $this->rating = 0; $this->avg = $rdbi->getAvg($this->pagename, $this->dimension); $this->numusers = $rdbi->getNumUsers($this->pagename, $this->dimension); // Update this text on rateit in javascript. needed: NumUsers, Avg - $html = HTML::div - ( + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $html = HTML::span(); + } else { + $html = HTML::div(); + } + $html->pushContent( HTML::span(array('class' => 'rateit'), - sprintf(_("Rating: %.1f (%d votes)"), - $this->avg, $this->numusers))); + sprintf(_("Rating: %s (%d vote" . ($this->numusers > 1 ? 's' : '') . ")"), + round($this->avg, 1), round($this->numusers, 1)))); + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $this->pred = ''; + } if ($args['show'] == 'top') { if (ENABLE_PAGE_PUBLIC) { $page = $dbi->getPage($this->pagename); if ($page->get('public')) $html->setAttr('class', "public"); } + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $this->idTop = sprintf("%u", crc32($this->pagename)); + } $html->setAttr('id', 'rateit-widget-top'); - $html->pushContent(HTML::br(), - $this->RatingWidgetHtml($args['pagename'], $args['version'], - $args['imgPrefix'], - $args['dimension'], $args['small'])); + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $html->pushContent(HTML::raw(' ')); + } else { + $html->pushContent(HTML::br()); + } + $html->pushContent($this->RatingWidgetHtml($args['pagename'], $args['version'], + $args['imgPrefix'], + $args['dimension'], $args['small'])); } elseif ($args['show'] == 'text') { if (!$WikiTheme->DUMP_MODE) $html->pushContent(HTML::br(), @@ -285,7 +314,7 @@ $html->pushContent(HTML::br(), sprintf(_("Your rating was %.1f"), $this->rating)); - } else { + } elseif (!(defined('FUSIONFORGE') && FUSIONFORGE)) { $this->pred = $rdbi->getPrediction($this->userid, $this->pagename, $this->dimension); if (is_string($this->pred)) $html->pushContent(HTML::br(), @@ -349,6 +378,18 @@ $dbi =& $request->_dbi; $version = $dbi->_backend->get_latest_version($pagename); $pageid = sprintf("%u", crc32($pagename)); // MangleXmlIdentifier($pagename) + if (defined('FUSIONFORGE') && FUSIONFORGE) { + if ($pageid == $this->idTop) { + $pageid .= '0'; + $jsIdTop = "idTop = '" . 'RateIt' . $pageid . "';\n"; + $canRate = 1; + } else { + $pageid .= self::$toBeUniq; + self::$toBeUniq++; + $jsIdTop = ''; + $canRate = 0; + } + } $imgId = 'RateIt' . $pageid; $actionImgName = 'RateIt' . $pageid . 'Action'; @@ -372,35 +413,87 @@ $nk[$i] = $WikiTheme->_findData("images/RateIt" . $imgPrefix . "Nk" . $i . ".png"); // rated $rk[$i] = $WikiTheme->_findData("images/RateIt" . $imgPrefix . "Rk" . $i . ".png"); // pred } + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $user = $request->getUser(); + if ($user && is_object($user) && $user->isAuthenticated()) { + $canRate = 1 & $canRate; + if (empty($this->userid)) { + $this->userid = $user->getId(); + } + if (empty($this->rating)) { + $this->rating = $rdbi->getRating($this->userid, $pagename, $dimension); + if (!$this->rating and empty($this->pred)) { + $this->pred = $rdbi->getPrediction($this->userid, $pagename, $dimension); + } + } + } else $canRate = 0 & $canRate; - if (empty($this->userid)) { - $user = $request->getUser(); - $this->userid = $user->getId(); - } - if (empty($this->rating)) { - $this->rating = $rdbi->getRating($this->userid, $pagename, $dimension); - if (!$this->rating and empty($this->pred)) { - $this->pred = $rdbi->getPrediction($this->userid, $pagename, $dimension); + if (empty($this->avg)) + $this->avg = $rdbi->getAvg($pagename, $dimension); + if (!$this->avg) + $this->avg = 0; + if (empty($this->numusers)) + $this->numusers = $rdbi->getNumUsers($pagename, $dimension); + } else { + if (empty($this->userid)) { + $user = $request->getUser(); + $this->userid = $user->getId(); } + if (empty($this->rating)) { + $this->rating = $rdbi->getRating($this->userid, $pagename, $dimension); + if (!$this->rating and empty($this->pred)) { + $this->pred = $rdbi->getPrediction($this->userid, $pagename, $dimension); + } + } } - for ($i = 1; $i <= 10; $i++) { - $j = $i / 2; - $a1 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," - . "'$reImgId','$dimension',$j)")); + if (!defined('FUSIONFORGE') && FUSIONFORGE) { + $j = $i / 2; + $a1 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," + . "'$reImgId','$dimension',$j)")); + } $img_attr = array(); $img_attr['src'] = $nk[$i % 2]; - if ($this->rating) { - $img_attr['src'] = $ok[$i % 2]; - $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,0,1)"; - $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',$this->rating,0,1)"; - } elseif (!$this->rating and $this->pred) { - $img_attr['src'] = $rk[$i % 2]; - $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,1,1)"; - $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',$this->pred,1,1)"; + if (defined('FUSIONFORGE') && FUSIONFORGE) { + if ($canRate) { + $jsCanRate = "canRate['$reImgId'] = 1;\n"; + $a1 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," + . "'$reImgId','$dimension',$i / 2)", + 'style' => 'outline: 0')); + if ($this->avg) { + $img_attr['src'] = $ok[$i % 2]; + $img_attr['onmouseover'] = "displayRating2('$reImgId','$reImgPrefix',$i / 2,0,1)"; + $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',$this->avg,0,1)"; + } elseif (!$this->rating and $this->pred) { + $img_attr['src'] = $rk[$i % 2]; + $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$i / 2,1,1)"; + $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',$this->pred,1,1)"; + } else { + $img_attr['onmouseover'] = "displayRating2('$reImgId','$reImgPrefix',$i / 2,0,1)"; + $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',0,0,1)"; + } + } else { + $jsCanRate = "canRate['$reImgId'] = 0;\n"; + if ($this->avg) { + $img_attr['src'] = $ok[$i % 2]; + } elseif (!$this->rating and $this->pred) { + $img_attr['src'] = $rk[$i % 2]; + } + $a1 = HTML::span(); + } } else { - $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,0,1)"; - $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',0,0,1)"; + if ($this->rating) { + $img_attr['src'] = $ok[$i % 2]; + $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,0,1)"; + $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',$this->rating,0,1)"; + } elseif (!$this->rating and $this->pred) { + $img_attr['src'] = $rk[$i % 2]; + $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,1,1)"; + $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',$this->pred,1,1)"; + } else { + $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,0,1)"; + $img_attr['onmouseout'] = "displayRating('$reImgId','$reImgPrefix',0,0,1)"; + } } //$imgName = 'RateIt'.$reImgId.$i; $img_attr['id'] = $imgId . $i; @@ -413,54 +506,79 @@ //if (($i%2) == 0) $html->pushContent("\n"); } $html->pushContent(HTML::raw(" ")); + if (defined('FUSIONFORGE') && FUSIONFORGE) { + if ($canRate) { + $a0 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," + . "'$reImgId','$dimension','X')", + 'style' => 'outline: 0')); + $msg = _("Cancel your rating"); + $imgprops = array('src' => $WikiTheme->getImageUrl("RateIt" . $imgPrefix . "Cancel"), + 'id' => $imgId . $imgPrefix . 'Cancel', + 'alt' => $msg, + 'title' => $msg, + 'onmouseover' => "displayRating2('$reImgId','$reImgPrefix',0,0,1)", + 'onmouseout' => "displayRating('$reImgId','$reImgPrefix',$this->avg,0,1)"); + if (!$this->rating) + $imgprops['style'] = 'display:none'; + $a0->pushContent(HTML::img($imgprops)); + //$a0->addToolTip($msg); + $html->pushContent($a0); + } + } else { + $a0 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," + . "'$reImgId','$dimension','X')")); + $msg = _("Cancel your rating"); + $imgprops = array('src' => $WikiTheme->getImageUrl("RateIt" . $imgPrefix . "Cancel"), + 'id' => $imgId . $imgPrefix . 'Cancel', + 'alt' => $msg, + 'title' => $msg); + if (!$this->rating) + $imgprops['style'] = 'display:none'; + $a0->pushContent(HTML::img($imgprops)); + $a0->addToolTip($msg); + $html->pushContent($a0); + } - $a0 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version'," - . "'$reImgId','$dimension','X')")); - $msg = _("Cancel your rating"); - $imgprops = array('src' => $WikiTheme->getImageUrl("RateIt" . $imgPrefix . "Cancel"), - 'id' => $imgId . $imgPrefix . 'Cancel', - 'alt' => $msg, - 'title' => $msg); - if (!$this->rating) - $imgprops['style'] = 'display:none'; - $a0->pushContent(HTML::img($imgprops)); - $a0->addToolTip($msg); - $html->pushContent($a0); - - /*} elseif ($pred) { - $msg = _("No opinion"); - $html->pushContent(HTML::img(array('src' => $WikiTheme->getImageUrl("RateItCancelN"), - 'id' => $imgPrefix.'Cancel', - 'alt' => $msg))); - //$a0->addToolTip($msg); - //$html->pushContent($a0); - }*/ $img_attr = array(); $img_attr['src'] = $WikiTheme->_findData("images/spacer.png"); $img_attr['id'] = $actionImgName; $img_attr['alt'] = $img_attr['id']; $img_attr['height'] = 15; $img_attr['width'] = 20; + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $img_attr['style'] = 'display: none;'; + } $html->pushContent(HTML::img($img_attr)); // Display your current rating if there is one, or the current prediction // or the empty widget. $pred = empty($this->pred) ? 0 : $this->pred; - $js = ''; + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $js = $jsIdTop . $jsCanRate; + } else { + $js = ''; + } if (!empty($this->avg)) $js .= "avg['$reImgId']=$this->avg; numusers['$reImgId']=$this->numusers;\n"; if ($this->rating) { $js .= "rating['$reImgId']=$this->rating; prediction['$reImgId']=$pred;\n"; - $html->pushContent(JavaScript($js - . "displayRating('$reImgId','$reImgPrefix',$this->rating,0,1);")); + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $js .= "var msg_chg_rating = 'Change your rating from ';\n"; + $html->pushContent(JavaScript($js."displayRating('$reImgId','$reImgPrefix',$this->avg,0,1);")); + } else { + $html->pushContent(JavaScript($js."displayRating('$reImgId','$reImgPrefix',$this->rating,0,1);")); + } } elseif (!empty($this->pred)) { $js .= "rating['$reImgId']=0; prediction['$reImgId']=$this->pred;\n"; $html->pushContent(JavaScript($js . "displayRating('$reImgId','$reImgPrefix',$this->pred,1,1);")); } else { $js .= "rating['$reImgId']=0; prediction['$reImgId']=0;\n"; - $html->pushContent(JavaScript($js - . "displayRating('$reImgId','$reImgPrefix',0,0,1);")); + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $html->pushContent(JavaScript($js."displayRating('$reImgId','$reImgPrefix',$this->avg,0,1);")); + } else { + $html->pushContent(JavaScript($js."displayRating('$reImgId','$reImgPrefix',0,0,1);")); + } } return $html; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 10:00:21
|
Revision: 9518 http://sourceforge.net/p/phpwiki/code/9518 Author: vargenau Date: 2015-02-11 10:00:13 +0000 (Wed, 11 Feb 2015) Log Message: ----------- Merge for plain Phpwiki and Fusionforge Modified Paths: -------------- trunk/lib/wikilens/PageListColumns.php Modified: trunk/lib/wikilens/PageListColumns.php =================================================================== --- trunk/lib/wikilens/PageListColumns.php 2015-02-11 09:11:42 UTC (rev 9517) +++ trunk/lib/wikilens/PageListColumns.php 2015-02-11 10:00:13 UTC (rev 9518) @@ -154,6 +154,11 @@ { $this->_pagelist =& $params[3]; $this->_user =& $params[4]; //$this->_pagelist->getOption('user'); + if (defined('FUSIONFORGE') && FUSIONFORGE) { + if (empty($this->_user)) { + $this->_user =& RatingsUserFactory::getUser($GLOBALS['request']->_user->_userid); + } + } $this->_PageList_Column($params[0], $params[1], $params[2]); $this->_dimension = $this->_pagelist->getOption('dimension'); if (!$this->_dimension) $this->_dimension = 0; @@ -233,8 +238,13 @@ function format($pagelist, $page_handle, &$revision_handle) { $plugin = new WikiPlugin_RateIt(); - $widget = $plugin->RatingWidgetHtml($page_handle->getName(), "", + if (defined('FUSIONFORGE') && FUSIONFORGE) { + $widget = $plugin->RatingWidgetHtml($page_handle->getName(), "", + "BStar", $this->_dimension, "small"); + } else { + $widget = $plugin->RatingWidgetHtml($page_handle->getName(), "", "Star", $this->_dimension, "small"); + } $td = HTML::td($widget); $td->setAttr('nowrap', 'nowrap'); return $td; @@ -244,12 +254,18 @@ { global $request; - $pagename = $page_handle->getName(); - $active_user = $request->getUser(); - $active_userid = $active_user->_userid; - - $tu = & RatingsUserFactory::getUser($active_userid); - return $tu->get_rating($pagename, $this->_dimension); + if (defined('FUSIONFORGE') && FUSIONFORGE) { + // Returns average rating of a page + $pagename = $page_handle->getName(); + $rdbi = RatingsDb::getTheRatingsDb(); + return $rdbi->getAvg($pagename, $this->_dimension); + } else { + $pagename = $page_handle->getName(); + $active_user = $request->getUser(); + $active_userid = $active_user->_userid; + $tu = & RatingsUserFactory::getUser($active_userid); + return $tu->get_rating($pagename, $this->_dimension); + } } function _getSortableValue($page_handle, &$revision_handle) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-11 09:11:51
|
Revision: 9517 http://sourceforge.net/p/phpwiki/code/9517 Author: vargenau Date: 2015-02-11 09:11:42 +0000 (Wed, 11 Feb 2015) Log Message: ----------- Use && Modified Paths: -------------- trunk/lib/EditToolbar.php trunk/lib/IniConfig.php trunk/lib/MailNotify.php trunk/lib/PageList.php trunk/lib/PagePerm.php trunk/lib/Request.php trunk/lib/WikiTheme.php trunk/lib/WikiUser.php trunk/lib/loadsave.php trunk/lib/main.php trunk/lib/plugin/PluginManager.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/WatchPage.php trunk/lib/wikilens/RatingsDb.php trunk/lib/wikilens/RatingsUser.php trunk/themes/fusionforge/themeinfo.php Modified: trunk/lib/EditToolbar.php =================================================================== --- trunk/lib/EditToolbar.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/EditToolbar.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -128,7 +128,7 @@ if (defined('ENABLE_EDIT_TOOLBAR') and ENABLE_EDIT_TOOLBAR) { $username = $request->_user->UserName(); - if ((defined('FUSIONFORGE') and FUSIONFORGE) or DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { + if ((defined('FUSIONFORGE') && FUSIONFORGE) or DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { $username = '[[' . $username . ']]'; } $signature = " ––" . $username . " " . CTime(); @@ -320,7 +320,7 @@ $categories = array(); while ($p = $pages->next()) { $page = $p->getName(); - if ((defined('FUSIONFORGE') and FUSIONFORGE)) { + if ((defined('FUSIONFORGE') && FUSIONFORGE)) { $categories[] = "['$page', '%0A----%0A%5B%5B" . $page . "%5D%5D']"; } elseif (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($page))) { $categories[] = "['$page', '%0A%5B" . $page . "%5D']"; Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/IniConfig.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -600,7 +600,7 @@ . 'WantedPages:WatchPage:WhoIsOnline:WikiAdminSelect'); // The FUSIONFORGE theme omits them - if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { + if (!(defined('FUSIONFORGE') && FUSIONFORGE)) { // Add some some action pages $ActionPages[] = 'DebugInfo'; $ActionPages[] = 'SpellCheck'; // SpellCheck does not work @@ -693,7 +693,7 @@ $AllAllowedPlugins[] = 'DebugRetransform'; // The FUSIONFORGE theme omits them - if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { + if (!(defined('FUSIONFORGE') && FUSIONFORGE)) { $AllAllowedPlugins[] = 'AnalyseAccessLogSql'; $AllAllowedPlugins[] = 'CacheTest'; $AllAllowedPlugins[] = 'CategoryPage'; @@ -748,7 +748,7 @@ $AllActionPages[] = 'SetGlobalAccessRightsSimple'; $AllActionPages[] = 'UserContribs'; - if ((defined('FUSIONFORGE') and FUSIONFORGE)) { + if ((defined('FUSIONFORGE') && FUSIONFORGE)) { if (ENABLE_EXTERNAL_PAGES) { $AllAllowedPlugins[] = 'WikiAdminSetExternal'; $AllActionPages[] = 'PhpWikiAdministration/SetExternal'; @@ -861,7 +861,7 @@ define('DEFAULT_LANGUAGE', ''); // detect from client // FusionForge hack - if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { + if (!(defined('FUSIONFORGE') && FUSIONFORGE)) { // Disable update_locale because Zend Debugger crash if (!extension_loaded('Zend Debugger')) { update_locale(isset($LANG) ? $LANG : DEFAULT_LANGUAGE); Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/MailNotify.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -65,7 +65,7 @@ private function fromId() { global $request; - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { return $request->_user->getId(); } else { return $request->_user->getId() . '@' . $request->get('REMOTE_HOST'); @@ -83,7 +83,7 @@ global $request; // Disable verification of emails for corporate env. - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $doverify = false; } Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/PageList.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -1406,7 +1406,7 @@ trigger_error(sprintf("%s: Bad column", $column), E_USER_NOTICE); return false; } - if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { + if (!(defined('FUSIONFORGE') && FUSIONFORGE)) { // FIXME: anon users might rate and see ratings also. // Defer this logic to the plugin. if ($column == 'rating' and !$request->_user->isSignedIn()) { Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/PagePerm.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -241,7 +241,7 @@ $page = $request->getPage($pagename); // Exceptions: - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { if ($pagename != '.' && isset($request->_user->_is_external) && $request->_user->_is_external && !$page->get('external')) { $permcache[$pagename][$access] = 0; return 0; Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/Request.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -636,7 +636,7 @@ function get_old($key) { - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { return false; } $vars = &$GLOBALS['HTTP_COOKIE_VARS']; Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/WikiTheme.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -233,7 +233,7 @@ return; } $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikicommon.js")))); - if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { + if (!(defined('FUSIONFORGE') && FUSIONFORGE)) { // FusionForge already loads this $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("jquery-1.11.1.min.js")))); $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("jquery.tablesorter.min.js")))); Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/WikiUser.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -567,7 +567,7 @@ { if (!$userid) $userid = $this->_userid; if (!$userid) return false; - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { return true; } return preg_match("/^[\-\w\.@ ]+$/U", $userid) and strlen($userid) < 32; @@ -1765,7 +1765,7 @@ function get($name) { // get e-mail address from FusionForge - if ((defined('FUSIONFORGE') and FUSIONFORGE) && session_loggedin()) { + if ((defined('FUSIONFORGE') && FUSIONFORGE) && session_loggedin()) { $user = session_get_user(); return $user->getEmail(); } else { @@ -1776,7 +1776,7 @@ function sanify($value) { // e-mail address is already checked by FusionForge - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { return $value; } // check for valid email address @@ -1808,7 +1808,7 @@ global $request; // e-mail address is already checked by FusionForge - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { return; } if (!empty($this->_init)) { @@ -2001,7 +2001,7 @@ // This should be probably be done with $customUserPreferenceColumns // For now, we use FUSIONFORGE define - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $fusionforgeprefs = array( 'pageTrail' => new _UserPreference_bool(), 'diffMenuItem' => new _UserPreference_bool(), @@ -2194,7 +2194,7 @@ } } - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { // Merge current notifyPages with notifyPagesAll // notifyPages are pages to notify in the current project // while $notifyPagesAll is used to store all the monitored pages. @@ -2244,7 +2244,7 @@ } } - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { // Restore notifyPages from notifyPagesAll // notifyPages are pages to notify in the current project // while $notifyPagesAll is used to store all the monitored pages. Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/loadsave.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -1521,7 +1521,7 @@ 'CategoryActionPage', 'PhpWikiAdministration'); - if ((defined('FUSIONFORGE') and FUSIONFORGE)) { + if ((defined('FUSIONFORGE') && FUSIONFORGE)) { $mandatory[] = 'Template/UserPage'; } else { $mandatory[] = 'Help/TextFormattingRules'; Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/main.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -976,7 +976,7 @@ // Switched auth between sessions. // Note: There's no way to demandload a missing class-definition // afterwards! Stupid php. - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { if (empty($_SERVER['PHP_AUTH_USER'])) { return false; } @@ -1463,7 +1463,7 @@ $request->finish(); } -if ((!(defined('FUSIONFORGE') and FUSIONFORGE)) || (forge_get_config('installation_environment') != 'production')) { +if ((!(defined('FUSIONFORGE') && FUSIONFORGE)) || (forge_get_config('installation_environment') != 'production')) { if (defined('E_STRICT') and (E_ALL & E_STRICT)) // strict php5? error_reporting(E_ALL & ~E_STRICT); // exclude E_STRICT else Modified: trunk/lib/plugin/PluginManager.php =================================================================== --- trunk/lib/plugin/PluginManager.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/plugin/PluginManager.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -126,7 +126,7 @@ // make a link if an actionpage exists $pluginNamelink = $pluginName; $pluginDocPageName = "Help" . "/" . $pluginName . "Plugin"; - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $pluginDocPageName = "Help" . ":" . $pluginName . "Plugin"; } @@ -154,7 +154,7 @@ $pluginDocPageNamelink = WikiLink($pluginDocPageName, 'if_known'); } - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $pluginDocPageNamelink = WikiLink($pluginDocPageName, 'known'); } Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/plugin/UpLoad.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -109,7 +109,7 @@ // Make sure that the user is logged in. $user = $request->getUser(); if (!$user->isAuthenticated()) { - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $message->pushContent(HTML::div(array('class' => 'error'), HTML::p(_("You cannot upload files.")), HTML::ul( Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/plugin/UserPreferences.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -75,7 +75,7 @@ $user->_request = $request; if (is_a($request, 'MockRequest')) return ''; - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { if (!($user->isAuthenticated())) { return HTML::p(array('class' => 'error'), _("Error: You are not logged in, cannot display UserPreferences.")); Modified: trunk/lib/plugin/WatchPage.php =================================================================== --- trunk/lib/plugin/WatchPage.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/plugin/WatchPage.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -113,7 +113,7 @@ $page = $args['page']; if (!$user->isAuthenticated() or empty($userid)) { // wrong or unauthenticated user - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { // No login banner for FusionForge return HTML::div(array('class' => 'error'), HTML::p(_("You must sign in to watch pages."))); @@ -122,7 +122,7 @@ } else { $pref = &$request->_prefs; $messages = ""; - if (!defined('FUSIONFORGE') or !FUSIONFORGE) { + if (!defined('FUSIONFORGE') || !FUSIONFORGE) { $email = $pref->get("email"); if (empty($email)) { return HTML::p( Modified: trunk/lib/wikilens/RatingsDb.php =================================================================== --- trunk/lib/wikilens/RatingsDb.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/wikilens/RatingsDb.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -382,7 +382,7 @@ $where = "WHERE"; } if (isset($pagename)) { - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $rateeid = $this->_sqlbackend->_get_pageid($pagename, true); $where .= " rateepage=$rateeid"; } else { @@ -395,7 +395,7 @@ $where .= " dimension=$dimension"; } extract($dbi->_table_names); - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $query = "SELECT AVG(ratingvalue) as avg FROM $rating_tbl " . $where; } else { $query = "SELECT AVG(ratingvalue) as avg FROM $rating_tbl r, $page_tbl p " . $where . " GROUP BY raterpage"; Modified: trunk/lib/wikilens/RatingsUser.php =================================================================== --- trunk/lib/wikilens/RatingsUser.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/lib/wikilens/RatingsUser.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -340,7 +340,7 @@ $rating_iter = $dbi->get_rating_page(null, $this->_userid); while ($rating = $rating_iter->next()) { - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $rating['pagename'] = preg_replace('/^' . PAGE_PREFIX . '/', '', $rating['pagename']); } $this->_num_ratings++; Modified: trunk/themes/fusionforge/themeinfo.php =================================================================== --- trunk/themes/fusionforge/themeinfo.php 2015-02-09 14:12:08 UTC (rev 9516) +++ trunk/themes/fusionforge/themeinfo.php 2015-02-11 09:11:42 UTC (rev 9517) @@ -31,7 +31,7 @@ $submenu = Template('navbar')->asXML(); - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { $domain = textdomain(NULL); textdomain('fusionforge'); @@ -80,8 +80,7 @@ function footer() { - - if (defined('FUSIONFORGE') and FUSIONFORGE) { + if (defined('FUSIONFORGE') && FUSIONFORGE) { global $HTML; $domain = textdomain(NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-09 14:12:10
|
Revision: 9516 http://sourceforge.net/p/phpwiki/code/9516 Author: vargenau Date: 2015-02-09 14:12:08 +0000 (Mon, 09 Feb 2015) Log Message: ----------- Do not use void function result Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/WikiDB/backend/ADODB_mssql.php trunk/lib/WikiDB/backend/ADODB_mssqlnative.php trunk/lib/WikiDB/backend/ADODB_mysql.php trunk/lib/WikiDB/backend/ADODB_oci8po.php trunk/lib/WikiDB/backend/ADODB_postgres7.php trunk/lib/WikiDB/backend/PDO_mysql.php trunk/lib/WikiDB/backend/PDO_oci8.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/PearDB_ffpgsql.php trunk/lib/WikiDB/backend/PearDB_mysql.php trunk/lib/WikiDB/backend/PearDB_oci8.php trunk/lib/WikiDB/backend/PearDB_pgsql.php trunk/lib/WikiDB/backend/PearDB_sqlite.php trunk/lib/WikiDB/backend/cvs.php trunk/lib/WikiDB/backend/dbaBase.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend.php trunk/lib/plugin/RecentChanges.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/PageList.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -187,7 +187,8 @@ if ($this->_iscustom) { $this->_field = substr($field, 7); } elseif ($this->_need_rev) - $this->_field = substr($field, 4); else + $this->_field = substr($field, 4); + else $this->_field = $field; } Modified: trunk/lib/WikiDB/backend/ADODB_mssql.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mssql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_mssql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -32,7 +32,7 @@ { // Do nothing here -- Leave that for the DB // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/ADODB_mssqlnative.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mssqlnative.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_mssqlnative.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -32,7 +32,7 @@ { // Do nothing here -- Leave that for the DB // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } // Search callabcks Modified: trunk/lib/WikiDB/backend/ADODB_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mysql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_mysql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -80,7 +80,7 @@ foreach ($this->_table_names as $table) { $dbh->Execute("OPTIMIZE TABLE $table"); } - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/ADODB_oci8po.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_oci8po.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_oci8po.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -35,7 +35,7 @@ { // Do nothing here -- Leave that for the DBA // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/ADODB_postgres7.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_postgres7.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_postgres7.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -37,7 +37,7 @@ */ function optimize() { - return 0; // if the wikiuser is not the table owner + return false; // if the wikiuser is not the table owner /* foreach ($this->_table_names as $table) { Modified: trunk/lib/WikiDB/backend/PDO_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_mysql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PDO_mysql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -81,7 +81,7 @@ foreach ($this->_table_names as $table) { $this->query("OPTIMIZE TABLE $table"); } - return 1; + return true; } function listOfTables() Modified: trunk/lib/WikiDB/backend/PDO_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_oci8.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PDO_oci8.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -33,7 +33,7 @@ { // Do nothing here -- Leave that for the DBA // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -171,7 +171,6 @@ $dbh->query(sprintf("UPDATE %s SET hits=hits+1 WHERE pagename='%s'", $this->_table_names['page_tbl'], $dbh->escapeSimple($pagename))); - return; } /** Modified: trunk/lib/WikiDB/backend/PearDB_ffpgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -197,7 +197,7 @@ function set_cached_html($pagename, $data) { - return parent::set_cached_html(PAGE_PREFIX . $pagename, $data); + parent::set_cached_html(PAGE_PREFIX . $pagename, $data); } function _get_pageid($pagename, $create_if_missing = false) @@ -567,7 +567,7 @@ function increaseHitCount($pagename) { - return parent::increaseHitCount(PAGE_PREFIX . $pagename); + parent::increaseHitCount(PAGE_PREFIX . $pagename); } function _serialize($data) @@ -581,7 +581,7 @@ */ function optimize() { - return 0; + return true; } /** Modified: trunk/lib/WikiDB/backend/PearDB_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_mysql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_mysql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -166,7 +166,7 @@ foreach ($this->_table_names as $table) { $dbh->query("OPTIMIZE TABLE $table"); } - return 1; + return true; } /** @@ -201,7 +201,6 @@ $this->_table_names['page_tbl'], $dbh->escapeSimple($pagename), ($this->_serverinfo['version'] >= 323.0) ? "LIMIT 1" : "")); - return; } } Modified: trunk/lib/WikiDB/backend/PearDB_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_oci8.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_oci8.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -38,7 +38,7 @@ { // Do nothing here -- Leave that for the DBA // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/PearDB_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -51,7 +51,7 @@ */ function optimize() { - return 0; // if the wikiuser is not the table owner + return true; // if the wikiuser is not the table owner /* foreach ($this->_table_names as $table) { @@ -97,13 +97,13 @@ $dbh = &$this->_dbh; $page_tbl = $this->_table_names['page_tbl']; if (USE_BYTEA) - $sth = $dbh->query(sprintf("UPDATE $page_tbl" + $dbh->query(sprintf("UPDATE $page_tbl" . " SET cached_html='%s'" . " WHERE pagename='%s'", $this->_quote($data), $dbh->escapeSimple($pagename))); else - $sth = $dbh->query("UPDATE $page_tbl" + $dbh->query("UPDATE $page_tbl" . " SET cached_html=?" . " WHERE pagename=?", // PearDB does NOT use pg_escape_string()! Oh dear. Modified: trunk/lib/WikiDB/backend/PearDB_sqlite.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_sqlite.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_sqlite.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -27,6 +27,7 @@ */ function optimize() { + return true; // NOP } Modified: trunk/lib/WikiDB/backend/cvs.php =================================================================== --- trunk/lib/WikiDB/backend/cvs.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/cvs.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -510,6 +510,7 @@ function optimize() { + return true; } /** Modified: trunk/lib/WikiDB/backend/dbaBase.php =================================================================== --- trunk/lib/WikiDB/backend/dbaBase.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/dbaBase.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -78,6 +78,7 @@ function optimize() { $this->_db->optimize(); + return true; } function sync() Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/file.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -657,7 +657,7 @@ */ function optimize() { - return 0; //trigger_error("optimize: Not Implemented", E_USER_WARNING); + return true; //trigger_error("optimize: Not Implemented", E_USER_WARNING); } /** Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -469,9 +469,12 @@ /** * Optimize the database. + * + * @return bool */ function optimize() { + return true; } /** Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/plugin/RecentChanges.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -770,6 +770,7 @@ function headline() { + return array(); } function authorLink($rev) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-06 10:05:44
|
Revision: 9514 http://sourceforge.net/p/phpwiki/code/9514 Author: vargenau Date: 2015-02-06 10:05:40 +0000 (Fri, 06 Feb 2015) Log Message: ----------- Remove unused; add PHP Doc Modified Paths: -------------- trunk/lib/plugin/CreateBib.php Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2015-02-05 17:48:07 UTC (rev 9513) +++ trunk/lib/plugin/CreateBib.php 2015-02-06 10:05:40 UTC (rev 9514) @@ -43,18 +43,20 @@ return array('pagename' => '[pagename]'); // The page from which the BibTex file is generated } - // Have to include the $starttag and $endtag to the regexps... - private function extractBibTeX(&$content, $starttag, $endtag) + /** + * @param array $content + * @return array + */ + private function extractBibTeX($content) { $bib = array(); $start = false; $stop = false; for ($i = 0; $i < count($content); $i++) { - // $starttag shows when to start if (preg_match('/^@/', $content[$i], $match)) { $start = true; - } // $endtag shows when to stop + } else if (preg_match('/^\}/', $content[$i], $match)) { $stop = true; } @@ -66,9 +68,14 @@ return $bib; } - // Extract article links. Current markup is by * characters... - // Assume straight list - private function extractArticles(&$content) + /** + * Extract article links. Current markup is by * characters... + * Assume straight list + * + * @param array $content + * @return array + */ + private function extractArticles($content) { $articles = array(); for ($i = 0; $i < count($content); $i++) { @@ -83,17 +90,21 @@ return $articles; } + /** + * @param WikiDB_Page $thispage + * @param string $filename + */ private function dumpFile($thispage, $filename) { include_once 'lib/loadsave.php'; $mailified = MailifyPage($thispage); $zip = new ZipArchive(); - $tmpfilename = "/tmp/" . $filename; - if (file_exists($tmpfilename)) { - unlink ($tmpfilename); + $tmp_filename = "/tmp/" . $filename; + if (file_exists($tmp_filename)) { + unlink ($tmp_filename); } - if ($zip->open($tmpfilename, ZipArchive::CREATE) !== true) { + if ($zip->open($tmp_filename, ZipArchive::CREATE) !== true) { trigger_error(_("Cannot create ZIP archive"), E_USER_ERROR); return; } @@ -102,8 +113,8 @@ $zip->close(); header('Content-Transfer-Encoding: binary'); header('Content-Disposition: attachment; filename="'.$filename.'"'); - header('Content-Length: '.filesize($tmpfilename)); - readfile($tmpfilename); + header('Content-Length: '.filesize($tmp_filename)); + readfile($tmp_filename); exit; } @@ -148,7 +159,7 @@ $subversion = $subpage->getCurrentRevision(); $subcontent = $subversion->getContent(); - $bib = $this->extractBibTeX($subcontent, "@", "}"); + $bib = $this->extractBibTeX($subcontent); // ...and finally just push the bibtex data to page $foo = implode("\n", $bib); @@ -162,7 +173,8 @@ // Yes, we want to dump this somewhere // Get the contents of this page $p = $dbi->getPage($pagename); - return $this->dumpFile($p, $request->getArg('file')); + $this->dumpFile($p, $request->getArg('file')); + // No return } return $html; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-05 17:48:09
|
Revision: 9513 http://sourceforge.net/p/phpwiki/code/9513 Author: vargenau Date: 2015-02-05 17:48:07 +0000 (Thu, 05 Feb 2015) Log Message: ----------- Add pgsrc/Mathematics pgsrc/MyBib pgsrc/Others Added Paths: ----------- trunk/pgsrc/Mathematics trunk/pgsrc/MyBib trunk/pgsrc/Others Added: trunk/pgsrc/Mathematics =================================================================== --- trunk/pgsrc/Mathematics (rev 0) +++ trunk/pgsrc/Mathematics 2015-02-05 17:48:07 UTC (rev 9513) @@ -0,0 +1,23 @@ +Date: Thu, 5 Feb 2015 18:09:30 +0000 +Mime-Version: 1.0 (Produced by PhpWiki 1.5.2) +Content-Type: application/x-phpwiki; + pagename=Mathematics + flags=PAGE_LOCKED%2CEXTERNAL_PAGE; + charset=UTF-8 +Content-Transfer-Encoding: binary + +== Mathematics == + +Bla bla bla... + +<pre> +@Book{abramowitz+stegun, + author = "Milton {Abramowitz} and Irene A. {Stegun}", + title = "Handbook of Mathematical Functions with + Formulas, Graphs, and Mathematical Tables", + publisher = "Dover", + year = 1964, + address = "New York", + edition = "ninth Dover printing, tenth GPO printing" +} +</pre> Added: trunk/pgsrc/MyBib =================================================================== --- trunk/pgsrc/MyBib (rev 0) +++ trunk/pgsrc/MyBib 2015-02-05 17:48:07 UTC (rev 9513) @@ -0,0 +1,11 @@ +Date: Thu, 5 Feb 2015 18:09:30 +0000 +Mime-Version: 1.0 (Produced by PhpWiki 1.5.2) +Content-Type: application/x-phpwiki; + pagename=MyBib + flags=PAGE_LOCKED%2CEXTERNAL_PAGE; + charset=UTF-8 +Content-Transfer-Encoding: binary + +List of books +* [[Mathematics]] +* [[Others]] Added: trunk/pgsrc/Others =================================================================== --- trunk/pgsrc/Others (rev 0) +++ trunk/pgsrc/Others 2015-02-05 17:48:07 UTC (rev 9513) @@ -0,0 +1,32 @@ +Date: Thu, 5 Feb 2015 18:09:30 +0000 +Mime-Version: 1.0 (Produced by PhpWiki 1.5.2) +Content-Type: application/x-phpwiki; + pagename=Others + flags=PAGE_LOCKED%2CEXTERNAL_PAGE; + charset=UTF-8 +Content-Transfer-Encoding: binary + +== Others == + +Bla bla bla... + +<pre> +@Book{hicks2001, + author = "von Hicks, III, Michael", + title = "Design of a Carbon Fiber Composite Grid Structure for the GLAST + Spacecraft Using a Novel Manufacturing Technique", + publisher = "Stanford Press", + year = 2001, + address = "Palo Alto", + edition = "1st", + isbn = "0-69-697269-4" +} + +@Book{Torre2008, + author = "Joe Torre and Tom Verducci", + publisher = "Doubleday", + title = "The Yankee Years", + year = 2008, + isbn = "0385527403" +} +</pre> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-05 17:39:12
|
Revision: 9511 http://sourceforge.net/p/phpwiki/code/9511 Author: vargenau Date: 2015-02-05 17:39:10 +0000 (Thu, 05 Feb 2015) Log Message: ----------- No need to translate /etc/groups Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2015-02-05 10:19:04 UTC (rev 9510) +++ trunk/configurator.php 2015-02-05 17:39:10 UTC (rev 9511) @@ -1024,7 +1024,7 @@ Page where all groups are listed."); $properties["AUTH_GROUP_FILE"] = - new _define_optional('AUTH_GROUP_FILE', _("/etc/groups"), " + new _define_optional('AUTH_GROUP_FILE', "/etc/groups", " For GROUP_METHOD = FILE, the file given below is referenced to obtain group membership information. It should be in the same format as the standard unix /etc/groups(5) file."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-04 17:02:40
|
Revision: 9509 http://sourceforge.net/p/phpwiki/code/9509 Author: vargenau Date: 2015-02-04 17:02:30 +0000 (Wed, 04 Feb 2015) Log Message: ----------- Use PHP ZIP class instead of home-made functions Modified Paths: -------------- trunk/lib/loadsave.php trunk/lib/plugin/CreateBib.php trunk/locale/Makefile trunk/locale/po/de.po trunk/locale/po/es.po trunk/locale/po/fr.po trunk/locale/po/it.po trunk/locale/po/ja.po trunk/locale/po/nl.po trunk/locale/po/sv.po trunk/locale/po/zh.po trunk/pgsrc/ReleaseNotes Added Paths: ----------- trunk/lib/mimelib.php Removed Paths: ------------- trunk/lib/ziplib.php Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/lib/loadsave.php 2015-02-04 17:02:30 UTC (rev 9509) @@ -20,7 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -require_once 'lib/ziplib.php'; +require_once 'lib/mimelib.php'; require_once 'lib/Template.php'; /** @@ -233,7 +233,16 @@ // We may need much memory for the dump ini_set("memory_limit", -1); - $zip = new ZipWriter("Created by PhpWiki " . PHPWIKI_VERSION, $zipname); + $zip = new ZipArchive(); + $tmpfilename = "/tmp/" . $zipname; + if (file_exists($tmpfilename)) { + unlink ($tmpfilename); + } + if ($zip->open($tmpfilename, ZipArchive::CREATE) !== true) { + trigger_error(_("Cannot create ZIP archive"), E_USER_ERROR); + return; + } + $zip->setArchiveComment(sprintf(_("Created by PhpWiki %s"), PHPWIKI_VERSION)); /* ignore fatals in plugins */ $ErrorManager->pushErrorHandler(new WikiFunctionCb('_dump_error_handler')); @@ -281,11 +290,18 @@ else $content = MailifyPage($page); - $zip->addRegularFile(FilenameForPage($pagename), $content, $attrib); + $zip->addFromString(FilenameForPage($pagename), $content); } - $zip->finish(); + $zip->close(); $ErrorManager->popErrorHandler(); + + header('Content-Transfer-Encoding: binary'); + header('Content-Disposition: attachment; filename="'.$zipname.'"'); + header('Content-Length: '.filesize($tmpfilename)); + + readfile($tmpfilename); + exit; } function DumpToDir(&$request) @@ -493,7 +509,16 @@ // We may need much memory for the dump ini_set("memory_limit", -1); - $zip = new ZipWriter("Created by PhpWiki " . PHPWIKI_VERSION, $zipname); + $zip = new ZipArchive(); + $tmpfilename = "/tmp/" . $zipname; + if (file_exists($tmpfilename)) { + unlink ($tmpfilename); + } + if ($zip->open($tmpfilename, ZipArchive::CREATE) !== true) { + trigger_error(_("Cannot create ZIP archive"), E_USER_ERROR); + return; + } + $zip->setArchiveComment(sprintf(_("Created by PhpWiki %s"), PHPWIKI_VERSION)); $dbi =& $request->_dbi; $thispage = $request->getArg('pagename'); // for "Return to ..." @@ -506,14 +531,14 @@ } $WikiTheme->DUMP_MODE = 'ZIPHTML'; - _DumpHtmlToDir($zip, $page_iter, $request->getArg('exclude')); + _DumpHtmlToDir($zip, $page_iter, $request->getArg('exclude'), $zipname, $tmpfilename); $WikiTheme->DUMP_MODE = false; } /* * Internal html dumper. Used for dumphtml, ziphtml and pdf */ -function _DumpHtmlToDir($target, $page_iter, $exclude = false) +function _DumpHtmlToDir($target, $page_iter, $exclude = false, $zipname='', $tmpfilename='') { global $WikiTheme, $request, $ErrorManager; $silent = true; @@ -677,7 +702,7 @@ } } else { $target = "images/$base"; - $zip->addSrcFile($target, $src); + $zip->addFile($src); } } } @@ -708,7 +733,7 @@ fclose($fd); $outfiles[] = $outfile; } else { - $zip->addRegularFile($filename, $data, $attrib); + $zip->addFromString($filename, $data); } if (USECACHE) { @@ -826,9 +851,19 @@ } } - if ($zip) - $zip->finish(); + if ($zip) { + $zip->close(); + $ErrorManager->popErrorHandler(); + + header('Content-Transfer-Encoding: binary'); + header('Content-Disposition: attachment; filename="'.$zipname.'"'); + header('Content-Length: '.filesize($tmpfilename)); + + readfile($tmpfilename); + exit; + } + if ($WikiTheme->DUMP_MODE == 'PDFHTML') { if (USE_EXTERNAL_HTML2PDF and $outfiles) { $cmd = EXTERNAL_HTML2PDF_PAGELIST . ' "' . join('" "', $outfiles) . '"'; @@ -1236,21 +1271,21 @@ $text = implode("", file($filename)); } - if (!$request->getArg('start_debug')) @set_time_limit(30); // Reset watchdog - else @set_time_limit(240); - // FIXME: basename("filewithnoslashes") seems to return garbage sometimes. $basename = basename("/dummy/" . $filename); $default_pagename = rawurldecode($basename); + if (($parts = ParseMimeifiedPages($text))) { - if (count($parts) > 1) + if (count($parts) > 1) { $overwrite = $request->getArg('overwrite'); + } usort($parts, 'SortByPageVersion'); foreach ($parts as $pageinfo) { // force overwrite - if (count($parts) > 1) + if (count($parts) > 1) { $request->setArg('overwrite', 1); + } SavePage($request, $pageinfo, sprintf(_("MIME file %s"), $filename)); } if (count($parts) > 1) @@ -1280,9 +1315,18 @@ function LoadZip(&$request, $zipfile, $files = array(), $exclude = array()) { - $zip = new ZipReader($zipfile); + $zip = new ZipArchive(); + $res = $zip->open($zipfile); + if ($res !== true) { + trigger_error(_("Cannot open ZIP archive for reading"), E_USER_ERROR); + return; + } $timeout = (!$request->getArg('start_debug')) ? 20 : 120; - while (list ($fn, $data, $attrib) = $zip->readFile()) { + + for ($i = 0; $i < $zip->numFiles; $i++) { + $fn = $zip->getNameIndex($i); + $data = $zip->getFromIndex($i); + $attrib = array(); // FIXME: basename("filewithnoslashes") seems to return // garbage sometimes. $fn = basename("/dummy/" . $fn); @@ -1294,9 +1338,9 @@ flush(); continue; } - longer_timeout($timeout); // longer timeout per page LoadFile($request, $fn, $data); } + $zip->close(); } function LoadDir(&$request, $dirname, $files = array(), $exclude = array()) @@ -1357,6 +1401,9 @@ } } +define('ZIP_CENTHEAD_MAGIC', "PK\001\002"); +define('ZIP_LOCHEAD_MAGIC', "PK\003\004"); + function IsZipFile($filename_or_fd) { // See if it looks like zip file @@ -1521,7 +1568,7 @@ $fd = $upload->open(); if (IsZipFile($fd)) - LoadZip($request, $fd, array(), array(_("RecentChanges"))); + LoadZip($request, $upload->getTmpName(), array(), array(_("RecentChanges"))); else LoadFile($request, $upload->getName(), $upload->getContents()); Copied: trunk/lib/mimelib.php (from rev 9508, trunk/lib/ziplib.php) =================================================================== --- trunk/lib/mimelib.php (rev 0) +++ trunk/lib/mimelib.php 2015-02-04 17:02:30 UTC (rev 9509) @@ -0,0 +1,397 @@ +<?php + +/** + * Routines for Mime mailification of pages. + */ + +/** + * Routines for quoted-printable en/decoding. + */ +function QuotedPrintableEncode($string) +{ + // Quote special characters in line. + $quoted = ""; + while ($string) { + // The complicated regexp is to force quoting of trailing spaces. + preg_match('/^([ !-<>-~]*)(?:([!-<>-~]$)|(.))/s', $string, $match); + $quoted .= $match[1] . $match[2]; + if (!empty($match[3])) + $quoted .= sprintf("=%02X", ord($match[3])); + $string = substr($string, strlen($match[0])); + } + // Split line. + // This splits the line (preferably after white-space) into lines + // which are no longer than 76 chars (after adding trailing '=' for + // soft line break, but before adding \r\n.) + return preg_replace('/(?=.{77})(.{10,74}[ \t]|.{71,73}[^=][^=])/s', + "\\1=\r\n", $quoted); +} + +function QuotedPrintableDecode($string) +{ + // Eliminate soft line-breaks. + $string = preg_replace('/=[ \t\r]*\n/', '', $string); + return quoted_printable_decode($string); +} + +define('MIME_TOKEN_REGEXP', "[-!#-'*+.0-9A-Z^-~]+"); + +function MimeContentTypeHeader($type, $subtype, $params) +{ + $header = "Content-Type: $type/$subtype"; + reset($params); + while (list($key, $val) = each($params)) { + //FIXME: what about non-ascii printables in $val? + if (!preg_match('/^' . MIME_TOKEN_REGEXP . '$/', $val)) + $val = '"' . addslashes($val) . '"'; + $header .= ";\r\n $key=$val"; + } + return "$header\r\n"; +} + +function MimeMultipart($parts) +{ + global $mime_multipart_count; + + // The string "=_" can not occur in quoted-printable encoded data. + $boundary = "=_multipart_boundary_" . ++$mime_multipart_count; + + $head = MimeContentTypeHeader('multipart', 'mixed', + array('boundary' => $boundary)); + + $sep = "\r\n--$boundary\r\n"; + + return $head . $sep . implode($sep, $parts) . "\r\n--${boundary}--\r\n"; +} + +/** + * For reference see: + * http://www.nacs.uci.edu/indiv/ehood/MIME/2045/rfc2045.html + * http://www.faqs.org/rfcs/rfc2045.html + * (RFC 1521 has been superceeded by RFC 2045 & others). + * + * Also see http://www.faqs.org/rfcs/rfc2822.html + * + * + * Notes on content-transfer-encoding. + * + * "7bit" means short lines of US-ASCII. + * "8bit" means short lines of octets with (possibly) the high-order bit set. + * "binary" means lines are not necessarily short enough for SMTP + * transport, and non-ASCII characters may be present. + * + * Only "7bit", "quoted-printable", and "base64" are universally safe + * for transport via e-mail. (Though many MTAs can/will be configured to + * automatically convert encodings to a safe type if they receive + * mail encoded in '8bit' and/or 'binary' encodings. + */ + +/** + * @param WikiDB_Page $page + * @param WikiDB_PageRevision $revision + * @return string + */ + +function MimeifyPageRevision(&$page, &$revision) +{ + // $wikidb =& $revision->_wikidb; + // $page = $wikidb->getPage($revision->getName()); + // FIXME: add 'hits' to $params + $params = array('pagename' => $page->getName(), + 'flags' => "", + 'author' => $revision->get('author'), + 'owner' => $page->getOwner(), + 'version' => $revision->getVersion(), + 'lastmodified' => $revision->get('mtime')); + + if ($page->get('mtime')) + $params['created'] = $page->get('mtime'); + if ($page->get('locked')) + $params['flags'] = 'PAGE_LOCKED'; + if (ENABLE_EXTERNAL_PAGES && $page->get('external')) + $params['flags'] = ($params['flags'] ? $params['flags'] . ',EXTERNAL_PAGE' : 'EXTERNAL_PAGE'); + if ($revision->get('author_id')) + $params['author_id'] = $revision->get('author_id'); + if ($revision->get('summary')) + $params['summary'] = $revision->get('summary'); + if ($page->get('hits')) + $params['hits'] = $page->get('hits'); + if ($page->get('owner')) + $params['owner'] = $page->get('owner'); + if ($page->get('perm') and class_exists('PagePermission')) { + $acl = getPagePermissions($page); + $params['acl'] = $acl->asAclLines(); + //TODO: convert to multiple lines? acl-view => groups,...; acl-edit => groups,... + } + + // Non-US-ASCII is not allowed in Mime headers (at least not without + // special handling) --- so we urlencode all parameter values. + foreach ($params as $key => $val) + $params[$key] = rawurlencode($val); + if (isset($params['acl'])) + // default: "view:_EVERY; edit:_AUTHENTICATED; create:_AUTHENTICATED,_BOGOUSER; ". + // "list:_EVERY; remove:_ADMIN,_OWNER; change:_ADMIN,_OWNER; dump:_EVERY; " + $params['acl'] = str_replace(array("%3A", "%3B%20", "%2C"), array(":", "; ", ","), $params['acl']); + + $out = MimeContentTypeHeader('application', 'x-phpwiki', $params); + $out .= sprintf("Content-Transfer-Encoding: %s\r\n", + STRICT_MAILABLE_PAGEDUMPS ? 'quoted-printable' : 'binary'); + + $out .= "\r\n"; + + foreach ($revision->getContent() as $line) { + // This is a dirty hack to allow saving binary text files. See above. + $line = rtrim($line); + if (STRICT_MAILABLE_PAGEDUMPS) + $line = QuotedPrintableEncode(rtrim($line)); + $out .= "$line\r\n"; + } + return $out; +} + +/** + * Routines for parsing Mime-ified phpwiki pages. + */ +function ParseRFC822Headers(&$string) +{ + if (preg_match("/^From (.*)\r?\n/", $string, $match)) { + $headers['from '] = preg_replace('/^\s+|\s+$/', '', $match[1]); + $string = substr($string, strlen($match[0])); + } + + while (preg_match('/^([!-9;-~]+) [ \t]* : [ \t]* ' + . '( .* \r?\n (?: [ \t] .* \r?\n)* )/x', + $string, $match)) { + $headers[strtolower($match[1])] + = preg_replace('/^\s+|\s+$/', '', $match[2]); + $string = substr($string, strlen($match[0])); + } + + if (empty($headers)) + return false; + + if (strlen($string) > 0) { + if (!preg_match("/^\r?\n/", $string, $match)) { + // No blank line after headers. + return false; + } + $string = substr($string, strlen($match[0])); + } + + return $headers; +} + +function ParseMimeContentType($string) +{ + // FIXME: Remove (RFC822 style comments). + + // Get type/subtype + if (!preg_match(':^\s*(' . MIME_TOKEN_REGEXP . ')\s*' + . '/' + . '\s*(' . MIME_TOKEN_REGEXP . ')\s*:x', + $string, $match) + ) + ExitWiki(sprintf("Bad %s", 'MIME content-type')); + + $type = strtolower($match[1]); + $subtype = strtolower($match[2]); + $string = substr($string, strlen($match[0])); + + $param = array(); + while (preg_match('/^;\s*(' . MIME_TOKEN_REGEXP . ')\s*=\s*' + . '(?:(' . MIME_TOKEN_REGEXP . ')|"((?:[^"\\\\]|\\.)*)") \s*/sx', + $string, $match)) { + //" <--kludge for brain-dead syntax coloring + if (strlen($match[2])) + $val = $match[2]; + else + $val = preg_replace('/[\\\\](.)/s', '\\1', $match[3]); + + $param[strtolower($match[1])] = $val; + + $string = substr($string, strlen($match[0])); + } + + return array($type, $subtype, $param); +} + +function ParseMimeMultipart($data, $boundary) +{ + if (!$boundary) { + ExitWiki("No boundary?"); + } + + $boundary = preg_quote($boundary); + + while (preg_match("/^(|.*?\n)--$boundary((?:--)?)[^\n]*\n/s", + $data, $match)) { + $data = substr($data, strlen($match[0])); + if (!isset($parts)) { + $parts = array(); // First time through: discard leading chaff + } else { + if ($content = ParseMimeifiedPages($match[1])) + for (reset($content); $p = current($content); next($content)) + $parts[] = $p; + } + + if ($match[2]) + return $parts; // End boundary found. + } + ExitWiki("No end boundary?"); +} + +function GenerateFootnotesFromRefs($params) +{ + $footnotes = array(); + reset($params); + while (list($p, $reference) = each($params)) { + if (preg_match('/^ref([1-9][0-9]*)$/', $p, $m)) + $footnotes[$m[1]] = sprintf(_("[%d] See [%s]"), + $m[1], rawurldecode($reference)); + } + + if (sizeof($footnotes) > 0) { + ksort($footnotes); + return "-----\n" + . "!" . _("References") . "\n" + . join("\n%%%\n", $footnotes) . "\n"; + } else + return ""; +} + +// counterpart to $acl->asAclLines() and rawurl undecode +// default: "view:_EVERY; edit:_AUTHENTICATED; create:_AUTHENTICATED,_BOGOUSER; ". +// "list:_EVERY; remove:_ADMIN,_OWNER; change:_ADMIN,_OWNER; dump:_EVERY; " +function ParseMimeifiedPerm($string) +{ + if (!class_exists('PagePermission')) { + return ''; + } + $hash = array(); + foreach (explode(";", trim($string)) as $accessgroup) { + list($access, $groupstring) = explode(":", trim($accessgroup)); + $access = trim($access); + $groups = explode(",", trim($groupstring)); + foreach ($groups as $group) { + $group = trim($group); + $bool = (boolean)(substr($group, 0, 1) != '-'); + if (substr($group, 0, 1) == '-' or substr($group, 0, 1) == '+') + $group = substr($group, 1); + $hash[$access][$group] = $bool; + } + } + $perm = new PagePermission($hash); + $perm->sanify(); + return serialize($perm->perm); +} + +// Convert references in meta-data to footnotes. +// Only zip archives generated by phpwiki 1.2.x or earlier should have +// references. +function ParseMimeifiedPages($data) +{ + // We may need a lot of memory and time for the dump + ini_set("memory_limit", -1); + ini_set('max_execution_time', 0); + + if (!($headers = ParseRFC822Headers($data)) + || empty($headers['content-type']) + ) { + //trigger_error( sprintf(_("Can't find %s"),'content-type header'), + // E_USER_WARNING ); + return false; + } + $typeheader = $headers['content-type']; + + if (!(list ($type, $subtype, $params) = ParseMimeContentType($typeheader))) { + trigger_error(sprintf("Can't parse %s: (%s)", + 'content-type', $typeheader), + E_USER_WARNING); + return false; + } + if ("$type/$subtype" == 'multipart/mixed') { + return ParseMimeMultipart($data, $params['boundary']); + } elseif ("$type/$subtype" != 'application/x-phpwiki') { + trigger_error(sprintf("Bad %s", "content-type: $type/$subtype"), + E_USER_WARNING); + return false; + } + + // FIXME: more sanity checking? + $page = array(); + $pagedata = array(); + $versiondata = array(); + if (isset($headers['date'])) + $pagedata['date'] = strtotime($headers['date']); + + //DONE: support owner and acl + foreach ($params as $key => $value) { + if (empty($value)) + continue; + $value = rawurldecode($value); + switch ($key) { + case 'pagename': + case 'version': + $page[$key] = $value; + break; + case 'flags': + if (preg_match('/PAGE_LOCKED/', $value)) + $pagedata['locked'] = 'yes'; + if (ENABLE_EXTERNAL_PAGES && preg_match('/EXTERNAL_PAGE/', $value)) + $pagedata['external'] = 'yes'; + break; + case 'owner': + case 'created': + case 'hits': + $pagedata[$key] = $value; + break; + case 'acl': + case 'perm': + if (class_exists('PagePermission')) { + $pagedata['perm'] = ParseMimeifiedPerm($value); + } + break; + case 'lastmodified': + $versiondata['mtime'] = $value; + break; + case 'author': + case 'author_id': + case 'summary': + case 'pagetype': + $versiondata[$key] = $value; + break; + } + } + + // FIXME: do we need to try harder to find a pagename if we + // haven't got one yet? + if (!isset($versiondata['author'])) { + global $request; + if (is_object($request)) { + $user = $request->getUser(); + $versiondata['author'] = $user->getId(); //FIXME:? + } + } + + $encoding = strtolower($headers['content-transfer-encoding']); + if ($encoding == 'quoted-printable') + $data = QuotedPrintableDecode($data); + else if ($encoding && $encoding != 'binary') + ExitWiki(sprintf("Unknown %s", 'encoding type: $encoding')); + + $data .= GenerateFootnotesFromRefs($params); + + $page['content'] = preg_replace('/[ \t\r]*\n/', "\n", chop($data)); + $page['pagedata'] = $pagedata; + $page['versiondata'] = $versiondata; + + return array($page); +} + +// Local Variables: +// mode: php +// tab-width: 8 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil +// End: Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/lib/plugin/CreateBib.php 2015-02-04 17:02:30 UTC (rev 9509) @@ -89,7 +89,9 @@ $attrib = array('mtime' => $thispage->get('mtime'), 'is_ascii' => 1); - $zip = new ZipWriter("Created by PhpWiki " . PHPWIKI_VERSION, $filename); + $zip = new ZipWriter($filename); + // $zip->setArchiveComment(sprintf(_("Created by PhpWiki %s"), PHPWIKI_VERSION)); + $zip->addRegularFile(FilenameForPage($thispage->getName()), $mailified, $attrib); $zip->finish(); Deleted: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/lib/ziplib.php 2015-02-04 17:02:30 UTC (rev 9509) @@ -1,813 +0,0 @@ -<?php - -/** - * GZIP stuff. - * - * Note that we use gzopen()/gzwrite() instead of gzcompress() even if - * gzcompress() is available. Gzcompress() puts out data with - * different headers --- in particular it includes an "adler-32" - * checksum rather than a "CRC32" checksum. Since we need the CRC-32 - * checksum, and since not all PHP's have gzcompress(), we'll just - * stick with gzopen(). - */ - -/** - * CRC32 computation. Hacked from Info-zip's zip-2.3 source code. - */ - -function zip_crc32($str, $crc = 0) -{ - static $zip_crc_table; - - if (empty($zip_crc_table)) { - /* NOTE: The range of PHP ints seems to be -0x80000000 to 0x7fffffff. - * So, had to munge these constants. - */ - $zip_crc_table - = array(0x00000000, 0x77073096, -0x11f19ed4, -0x66f6ae46, 0x076dc419, - 0x706af48f, -0x169c5acb, -0x619b6a5d, 0x0edb8832, 0x79dcb8a4, - -0x1f2a16e2, -0x682d2678, 0x09b64c2b, 0x7eb17cbd, -0x1847d2f9, - -0x6f40e26f, 0x1db71064, 0x6ab020f2, -0x0c468eb8, -0x7b41be22, - 0x1adad47d, 0x6ddde4eb, -0x0b2b4aaf, -0x7c2c7a39, 0x136c9856, - 0x646ba8c0, -0x029d0686, -0x759a3614, 0x14015c4f, 0x63066cd9, - -0x05f0c29d, -0x72f7f20b, 0x3b6e20c8, 0x4c69105e, -0x2a9fbe1c, - -0x5d988e8e, 0x3c03e4d1, 0x4b04d447, -0x2df27a03, -0x5af54a95, - 0x35b5a8fa, 0x42b2986c, -0x2444362a, -0x534306c0, 0x32d86ce3, - 0x45df5c75, -0x2329f231, -0x542ec2a7, 0x26d930ac, 0x51de003a, - -0x3728ae80, -0x402f9eea, 0x21b4f4b5, 0x56b3c423, -0x30456a67, - -0x47425af1, 0x2802b89e, 0x5f058808, -0x39f3264e, -0x4ef416dc, - 0x2f6f7c87, 0x58684c11, -0x3e9ee255, -0x4999d2c3, 0x76dc4190, - 0x01db7106, -0x672ddf44, -0x102aefd6, 0x71b18589, 0x06b6b51f, - -0x60401b5b, -0x17472bcd, 0x7807c9a2, 0x0f00f934, -0x69f65772, - -0x1ef167e8, 0x7f6a0dbb, 0x086d3d2d, -0x6e9b9369, -0x199ca3ff, - 0x6b6b51f4, 0x1c6c6162, -0x7a9acf28, -0x0d9dffb2, 0x6c0695ed, - 0x1b01a57b, -0x7df70b3f, -0x0af03ba9, 0x65b0d9c6, 0x12b7e950, - -0x74414716, -0x03467784, 0x62dd1ddf, 0x15da2d49, -0x732c830d, - -0x042bb39b, 0x4db26158, 0x3ab551ce, -0x5c43ff8c, -0x2b44cf1e, - 0x4adfa541, 0x3dd895d7, -0x5b2e3b93, -0x2c290b05, 0x4369e96a, - 0x346ed9fc, -0x529877ba, -0x259f4730, 0x44042d73, 0x33031de5, - -0x55f5b3a1, -0x22f28337, 0x5005713c, 0x270241aa, -0x41f4eff0, - -0x36f3df7a, 0x5768b525, 0x206f85b3, -0x46992bf7, -0x319e1b61, - 0x5edef90e, 0x29d9c998, -0x4f2f67de, -0x3828574c, 0x59b33d17, - 0x2eb40d81, -0x4842a3c5, -0x3f459353, -0x12477ce0, -0x65404c4a, - 0x03b6e20c, 0x74b1d29a, -0x152ab8c7, -0x622d8851, 0x04db2615, - 0x73dc1683, -0x1c9cf4ee, -0x6b9bc47c, 0x0d6d6a3e, 0x7a6a5aa8, - -0x1bf130f5, -0x6cf60063, 0x0a00ae27, 0x7d079eb1, -0x0ff06cbc, - -0x78f75c2e, 0x1e01f268, 0x6906c2fe, -0x089da8a3, -0x7f9a9835, - 0x196c3671, 0x6e6b06e7, -0x012be48a, -0x762cd420, 0x10da7a5a, - 0x67dd4acc, -0x06462091, -0x71411007, 0x17b7be43, 0x60b08ed5, - -0x29295c18, -0x5e2e6c82, 0x38d8c2c4, 0x4fdff252, -0x2e44980f, - -0x5943a899, 0x3fb506dd, 0x48b2364b, -0x27f2d426, -0x50f5e4b4, - 0x36034af6, 0x41047a60, -0x209f103d, -0x579820ab, 0x316e8eef, - 0x4669be79, -0x349e4c74, -0x43997ce6, 0x256fd2a0, 0x5268e236, - -0x33f3886b, -0x44f4b8fd, 0x220216b9, 0x5505262f, -0x3a45c442, - -0x4d42f4d8, 0x2bb45a92, 0x5cb36a04, -0x3d280059, -0x4a2f30cf, - 0x2cd99e8b, 0x5bdeae1d, -0x649b3d50, -0x139c0dda, 0x756aa39c, - 0x026d930a, -0x63f6f957, -0x14f1c9c1, 0x72076785, 0x05005713, - -0x6a40b57e, -0x1d4785ec, 0x7bb12bae, 0x0cb61b38, -0x6d2d7165, - -0x1a2a41f3, 0x7cdcefb7, 0x0bdbdf21, -0x792c2d2c, -0x0e2b1dbe, - 0x68ddb3f8, 0x1fda836e, -0x7e41e933, -0x0946d9a5, 0x6fb077e1, - 0x18b74777, -0x77f7a51a, -0x00f09590, 0x66063bca, 0x11010b5c, - -0x709a6101, -0x079d5197, 0x616bffd3, 0x166ccf45, -0x5ff51d88, - -0x28f22d12, 0x4e048354, 0x3903b3c2, -0x5898d99f, -0x2f9fe909, - 0x4969474d, 0x3e6e77db, -0x512e95b6, -0x2629a524, 0x40df0b66, - 0x37d83bf0, -0x564351ad, -0x2144613b, 0x47b2cf7f, 0x30b5ffe9, - -0x42420de4, -0x35453d76, 0x53b39330, 0x24b4a3a6, -0x452fc9fb, - -0x3228f96d, 0x54de5729, 0x23d967bf, -0x4c9985d2, -0x3b9eb548, - 0x5d681b02, 0x2a6f2b94, -0x4bf441c9, -0x3cf3715f, 0x5a05df1b, - 0x2d02ef8d); - } - - $crc = ~$crc; - for ($i = 0; $i < strlen($str); $i++) { - $crc = ($zip_crc_table[($crc ^ ord($str[$i])) & 0xff] - ^ (($crc >> 8) & 0xffffff)); - } - return ~$crc; -} - -define('GZIP_MAGIC', "\037\213"); -define('GZIP_DEFLATE', 010); - -function zip_deflate($content) -{ - // Compress content, and suck information from gzip header. - $z = gzencode($content); - - // Suck OS type byte from gzip header. FIXME: this smells bad. - - extract(unpack("a2magic/Ccomp_type/Cflags/@9/Cos_type", $z)); - - if ($magic != GZIP_MAGIC) - trigger_error(sprintf("Bad %s", "gzip magic"), E_USER_ERROR); - if ($comp_type != GZIP_DEFLATE) - trigger_error(sprintf("Bad %s", "gzip comp type"), E_USER_ERROR); - if (($flags & 0x3e) != 0) - trigger_error(sprintf("Bad %s", sprintf("flags (0x%02x)", $flags)), - E_USER_ERROR); - - $gz_header_len = 10; - $gz_data_len = strlen($z) - $gz_header_len - 8; - if ($gz_data_len < 0) - trigger_error("not enough gzip output?", E_USER_ERROR); - - extract(unpack("Vcrc32", substr($z, $gz_header_len + $gz_data_len))); - - return array(substr($z, $gz_header_len, $gz_data_len), // gzipped data - $crc32, // crc - $os_type // OS type - ); -} - -function zip_inflate($data, $crc32, $uncomp_size) -{ - $data = gzinflate($data); - if (strlen($data) != $uncomp_size) - trigger_error("not enough output from gzinflate", E_USER_ERROR); - $zcrc32 = zip_crc32($data); - if ($zcrc32 < 0) { // force unsigned - $zcrc32 += 4294967296; - } - if ($crc32 < 0) { // force unsigned - $crc32 += 4294967296; - } - if ($zcrc32 != $crc32) - trigger_error("CRC32 mismatch: calculated=$zcrc32, expected=$crc32", E_USER_ERROR); - return $data; -} - -function unixtime2dostime($unix_time) -{ - if ($unix_time % 1) - $unix_time++; // Round up to even seconds. - - list ($year, $month, $mday, $hour, $min, $sec) - = explode(" ", date("Y n j G i s", $unix_time)); - - if ($year < 1980) - list ($year, $month, $mday, $hour, $min, $sec) = array(1980, 1, 1, 0, 0, 0); - - $dosdate = (($year - 1980) << 9) | ($month << 5) | $mday; - $dostime = ($hour << 11) | ($min << 5) | ($sec >> 1); - - return array($dosdate, $dostime); -} - -function dostime2unixtime($dosdate, $dostime) -{ - $mday = $dosdate & 0x1f; - $month = ($dosdate >> 5) & 0x0f; - $year = 1980 + (($dosdate >> 9) & 0x7f); - - $sec = ($dostime & 0x1f) * 2; - $min = ($dostime >> 5) & 0x3f; - $hour = ($dostime >> 11) & 0x1f; - - return mktime($hour, $min, $sec, $month, $mday, $year); -} - -/** - * Class for zipfile creation. - */ -define('ZIP_DEFLATE', GZIP_DEFLATE); -define('ZIP_STORE', 0); -define('ZIP_CENTHEAD_MAGIC', "PK\001\002"); -define('ZIP_LOCHEAD_MAGIC', "PK\003\004"); -define('ZIP_ENDDIR_MAGIC', "PK\005\006"); - -class ZipWriter -{ - function ZipWriter($comment = "", $zipname = "archive.zip") - { - $this->comment = $comment; - $this->nfiles = 0; - $this->dir = ""; // "Central directory block" - $this->offset = 0; // Current file position. - - $zipname = addslashes($zipname); - header("Content-Type: application/zip; name=\"$zipname\""); - header("Content-Disposition: attachment; filename=\"$zipname\""); - } - - function addSrcFile($target, $src, $attrib = array()) - { - if (empty($attrib['mtime'])) - $attrib = array('mtime' => filemtime($src), 'is_ascii' => 0); - $this->addRegularFile($target, file_get_contents($src), $attrib); - } - - function addRegularFile($filename, $content, $attrib = array()) - { - $size = strlen($content); - list ($data, $crc32, $os_type) = zip_deflate($content); - if (strlen($data) < $size) { - $content = $data; // Use compressed data. - $comp_type = ZIP_DEFLATE; - } else - unset($crc32); // force plain store. - - if (!isset($crc32)) { - $comp_type = ZIP_STORE; - $crc32 = zip_crc32($content); - } - - if (!empty($attrib['write_protected'])) - $atx = (0100444 << 16) | 1; // S_IFREG + read permissions to - // everybody. - else - $atx = (0100644 << 16); // Add owner write perms. - - $ati = $attrib['is_ascii'] ? 1 : 0; - - if (empty($attrib['mtime'])) - $attrib['mtime'] = time(); - list ($mod_date, $mod_time) = unixtime2dostime($attrib['mtime']); - - // Construct parts common to "Local file header" and "Central - // directory file header." - if (!isset($attrib['extra_field'])) - $attrib['extra_field'] = ''; - if (!isset($attrib['file_comment'])) - $attrib['file_comment'] = ''; - - $head = pack("vvvvvVVVvv", - 20, // Version needed to extract (FIXME: is this right?) - 0, // Gen purp bit flag - $comp_type, - $mod_time, - $mod_date, - $crc32, - strlen($content), - $size, - strlen($filename), - strlen($attrib['extra_field'])); - - // Construct the "Local file header" - $lheader = ZIP_LOCHEAD_MAGIC . $head . $filename - . $attrib['extra_field']; - - // Construct the "central directory file header" - $this->dir .= pack("a4CC", - ZIP_CENTHEAD_MAGIC, - 23, // Version made by (FIXME: is this right?) - $os_type); - $this->dir .= $head; - $this->dir .= pack("vvvVV", - strlen($attrib['file_comment']), - 0, // Disk number start - $ati, // Internal file attributes - $atx, // External file attributes - $this->offset); // Relative offset of local header - $this->dir .= $filename . $attrib['extra_field'] - . $attrib['file_comment']; - - // Output the "Local file header" and file contents. - echo $lheader; - echo $content; - - $this->offset += strlen($lheader) + strlen($content); - $this->nfiles++; - } - - function finish() - { - // Output the central directory - echo $this->dir; - - // Construct the "End of central directory record" - echo ZIP_ENDDIR_MAGIC; - echo pack("vvvvVVv", - 0, // Number of this disk. - 0, // Number of disk with start of c dir - $this->nfiles, // Number entries on this disk - $this->nfiles, // Number entries - strlen($this->dir), // Size of central directory - $this->offset, // Offset of central directory - strlen($this->comment)); - echo $this->comment; - } -} - -/** - * Class for reading zip files. Handles buffers also. - * - * BUGS: - * - * Many of the ExitWiki()'s should probably be warn()'s (eg. CRC mismatch). - * - * Only a subset of zip formats is recognized. (I think that - * unsupported formats will be recognized as such rather than silently - * munged.) - * - * We don't read the central directory. This means we don't see the - * file attributes (text? read-only?), or file comments. - * - * Right now we ignore the file mod date and time, since we don't need it. - */ -class ZipReader -{ - function ZipReader($zipfile) - { - if (!is_string($zipfile)) { // filepointer: File already open - $this->fp = $zipfile; - $zipfile = NULL; - } elseif (((ord($zipfile[0]) * 256 + ord($zipfile[1])) % 31 == 0) // buffer - and (substr($zipfile, 0, 2) == "\037\213") - or (substr($zipfile, 0, 2) == "x\332") - ) { // 120, 218 - $this->fp = NULL; - $this->buf = $zipfile; - $zipfile = NULL; - } - if ($zipfile) { - $this->zipfile = $zipfile; - if (!($this->fp = fopen($zipfile, "rb"))) { - trigger_error(sprintf(_("Can't open ZIP file “%s” for reading"), - $zipfile), E_USER_ERROR); - } - } - } - - function _read($nbytes) - { - if ($this->fp) { - $chunk = fread($this->fp, $nbytes); - if (strlen($chunk) != $nbytes) - trigger_error(_("Unexpected EOF in ZIP file"), E_USER_ERROR); - return $chunk; - } elseif ($this->buf) { - if (strlen($this->buf) < $nbytes) - trigger_error(_("Unexpected EOF in ZIP file"), E_USER_ERROR); - $chunk = substr($this->buf, 0, $nbytes); - $this->buf = substr($this->buf, $nbytes); - return $chunk; - } - } - - function done() - { - if ($this->fp) - fclose($this->fp); - else - $this->buf = ''; - return false; - } - - function readFile() - { - $head = $this->_read(30); // FIXME: This is bad for gzip compressed buffers - - extract(unpack("a4magic/vreq_version/vflags/vcomp_type" - . "/vmod_time/vmod_date" - . "/Vcrc32/Vcomp_size/Vuncomp_size" - . "/vfilename_len/vextrafld_len", - $head)); - - if ($magic != ZIP_LOCHEAD_MAGIC) { - // maybe gzip? - //$x = substr($magic,0,3); - if (substr($magic, 0, 3) == "\037\213\225") //and (substr($magic,3,1) & 0x3e) == 0) - { - if ($this->fp) { - fclose($this->fp); - $this->fp = fopen($this->zipfile, "rb"); - $content = $this->_read(filesize($this->fp)); - } else { - $content = $this->buf; - } - // TODO... - $data = zip_deflate($content); - return array($filename, $data, $attrib); - } - if ($magic != ZIP_CENTHEAD_MAGIC) - // FIXME: better message? - ExitWiki(sprintf("Unsupported ZIP header type: %s", $magic)); - return $this->done(); - } - if (($flags & 0x21) != 0) - ExitWiki("Encryption and/or zip patches not supported."); - if (($flags & 0x08) != 0) - // FIXME: better message? - ExitWiki("Postponed CRC not yet supported."); - - $filename = $this->_read($filename_len); - //FIXME: we should probably check $req_version. - $attrib['mtime'] = dostime2unixtime($mod_date, $mod_time); - if ($extrafld_len != 0) - $attrib['extra_field'] = $this->_read($extrafld_len); - - $data = $this->_read($comp_size); - - if ($comp_type == ZIP_DEFLATE) { - $data = zip_inflate($data, $crc32, $uncomp_size); - } elseif ($comp_type == ZIP_STORE) { - $crc = zip_crc32($data); - if ($crc32 != $crc) - ExitWiki(sprintf("CRC mismatch %x != %x", $crc, $crc32)); - } else - ExitWiki(sprintf("Compression method %s unsupported", - $comp_method)); - - if (strlen($data) != $uncomp_size) - ExitWiki(sprintf("Uncompressed size mismatch %d != %d", - strlen($data), $uncomp_size)); - - return array($filename, $data, $attrib); - } -} - -/** - * Routines for Mime mailification of pages. - */ -//FIXME: these should go elsewhere (libmime?). - -/** - * Routines for quoted-printable en/decoding. - */ -function QuotedPrintableEncode($string) -{ - // Quote special characters in line. - $quoted = ""; - while ($string) { - // The complicated regexp is to force quoting of trailing spaces. - preg_match('/^([ !-<>-~]*)(?:([!-<>-~]$)|(.))/s', $string, $match); - $quoted .= $match[1] . $match[2]; - if (!empty($match[3])) - $quoted .= sprintf("=%02X", ord($match[3])); - $string = substr($string, strlen($match[0])); - } - // Split line. - // This splits the line (preferably after white-space) into lines - // which are no longer than 76 chars (after adding trailing '=' for - // soft line break, but before adding \r\n.) - return preg_replace('/(?=.{77})(.{10,74}[ \t]|.{71,73}[^=][^=])/s', - "\\1=\r\n", $quoted); -} - -function QuotedPrintableDecode($string) -{ - // Eliminate soft line-breaks. - $string = preg_replace('/=[ \t\r]*\n/', '', $string); - return quoted_printable_decode($string); -} - -define('MIME_TOKEN_REGEXP', "[-!#-'*+.0-9A-Z^-~]+"); - -function MimeContentTypeHeader($type, $subtype, $params) -{ - $header = "Content-Type: $type/$subtype"; - reset($params); - while (list($key, $val) = each($params)) { - //FIXME: what about non-ascii printables in $val? - if (!preg_match('/^' . MIME_TOKEN_REGEXP . '$/', $val)) - $val = '"' . addslashes($val) . '"'; - $header .= ";\r\n $key=$val"; - } - return "$header\r\n"; -} - -function MimeMultipart($parts) -{ - global $mime_multipart_count; - - // The string "=_" can not occur in quoted-printable encoded data. - $boundary = "=_multipart_boundary_" . ++$mime_multipart_count; - - $head = MimeContentTypeHeader('multipart', 'mixed', - array('boundary' => $boundary)); - - $sep = "\r\n--$boundary\r\n"; - - return $head . $sep . implode($sep, $parts) . "\r\n--${boundary}--\r\n"; -} - -/** - * For reference see: - * http://www.nacs.uci.edu/indiv/ehood/MIME/2045/rfc2045.html - * http://www.faqs.org/rfcs/rfc2045.html - * (RFC 1521 has been superceeded by RFC 2045 & others). - * - * Also see http://www.faqs.org/rfcs/rfc2822.html - * - * - * Notes on content-transfer-encoding. - * - * "7bit" means short lines of US-ASCII. - * "8bit" means short lines of octets with (possibly) the high-order bit set. - * "binary" means lines are not necessarily short enough for SMTP - * transport, and non-ASCII characters may be present. - * - * Only "7bit", "quoted-printable", and "base64" are universally safe - * for transport via e-mail. (Though many MTAs can/will be configured to - * automatically convert encodings to a safe type if they receive - * mail encoded in '8bit' and/or 'binary' encodings. - */ - -/** - * @param WikiDB_Page $page - * @param WikiDB_PageRevision $revision - * @return string - */ - -function MimeifyPageRevision(&$page, &$revision) -{ - // $wikidb =& $revision->_wikidb; - // $page = $wikidb->getPage($revision->getName()); - // FIXME: add 'hits' to $params - $params = array('pagename' => $page->getName(), - 'flags' => "", - 'author' => $revision->get('author'), - 'owner' => $page->getOwner(), - 'version' => $revision->getVersion(), - 'lastmodified' => $revision->get('mtime')); - - if ($page->get('mtime')) - $params['created'] = $page->get('mtime'); - if ($page->get('locked')) - $params['flags'] = 'PAGE_LOCKED'; - if (ENABLE_EXTERNAL_PAGES && $page->get('external')) - $params['flags'] = ($params['flags'] ? $params['flags'] . ',EXTERNAL_PAGE' : 'EXTERNAL_PAGE'); - if ($revision->get('author_id')) - $params['author_id'] = $revision->get('author_id'); - if ($revision->get('summary')) - $params['summary'] = $revision->get('summary'); - if ($page->get('hits')) - $params['hits'] = $page->get('hits'); - if ($page->get('owner')) - $params['owner'] = $page->get('owner'); - if ($page->get('perm') and class_exists('PagePermission')) { - $acl = getPagePermissions($page); - $params['acl'] = $acl->asAclLines(); - //TODO: convert to multiple lines? acl-view => groups,...; acl-edit => groups,... - } - - // Non-US-ASCII is not allowed in Mime headers (at least not without - // special handling) --- so we urlencode all parameter values. - foreach ($params as $key => $val) - $params[$key] = rawurlencode($val); - if (isset($params['acl'])) - // default: "view:_EVERY; edit:_AUTHENTICATED; create:_AUTHENTICATED,_BOGOUSER; ". - // "list:_EVERY; remove:_ADMIN,_OWNER; change:_ADMIN,_OWNER; dump:_EVERY; " - $params['acl'] = str_replace(array("%3A", "%3B%20", "%2C"), array(":", "; ", ","), $params['acl']); - - $out = MimeContentTypeHeader('application', 'x-phpwiki', $params); - $out .= sprintf("Content-Transfer-Encoding: %s\r\n", - STRICT_MAILABLE_PAGEDUMPS ? 'quoted-printable' : 'binary'); - - $out .= "\r\n"; - - foreach ($revision->getContent() as $line) { - // This is a dirty hack to allow saving binary text files. See above. - $line = rtrim($line); - if (STRICT_MAILABLE_PAGEDUMPS) - $line = QuotedPrintableEncode(rtrim($line)); - $out .= "$line\r\n"; - } - return $out; -} - -/** - * Routines for parsing Mime-ified phpwiki pages. - */ -function ParseRFC822Headers(&$string) -{ - if (preg_match("/^From (.*)\r?\n/", $string, $match)) { - $headers['from '] = preg_replace('/^\s+|\s+$/', '', $match[1]); - $string = substr($string, strlen($match[0])); - } - - while (preg_match('/^([!-9;-~]+) [ \t]* : [ \t]* ' - . '( .* \r?\n (?: [ \t] .* \r?\n)* )/x', - $string, $match)) { - $headers[strtolower($match[1])] - = preg_replace('/^\s+|\s+$/', '', $match[2]); - $string = substr($string, strlen($match[0])); - } - - if (empty($headers)) - return false; - - if (strlen($string) > 0) { - if (!preg_match("/^\r?\n/", $string, $match)) { - // No blank line after headers. - return false; - } - $string = substr($string, strlen($match[0])); - } - - return $headers; -} - -function ParseMimeContentType($string) -{ - // FIXME: Remove (RFC822 style comments). - - // Get type/subtype - if (!preg_match(':^\s*(' . MIME_TOKEN_REGEXP . ')\s*' - . '/' - . '\s*(' . MIME_TOKEN_REGEXP . ')\s*:x', - $string, $match) - ) - ExitWiki(sprintf("Bad %s", 'MIME content-type')); - - $type = strtolower($match[1]); - $subtype = strtolower($match[2]); - $string = substr($string, strlen($match[0])); - - $param = array(); - while (preg_match('/^;\s*(' . MIME_TOKEN_REGEXP . ')\s*=\s*' - . '(?:(' . MIME_TOKEN_REGEXP . ')|"((?:[^"\\\\]|\\.)*)") \s*/sx', - $string, $match)) { - //" <--kludge for brain-dead syntax coloring - if (strlen($match[2])) - $val = $match[2]; - else - $val = preg_replace('/[\\\\](.)/s', '\\1', $match[3]); - - $param[strtolower($match[1])] = $val; - - $string = substr($string, strlen($match[0])); - } - - return array($type, $subtype, $param); -} - -function ParseMimeMultipart($data, $boundary) -{ - if (!$boundary) - ExitWiki("No boundary?"); - - $boundary = preg_quote($boundary); - - while (preg_match("/^(|.*?\n)--$boundary((?:--)?)[^\n]*\n/s", - $data, $match)) { - $data = substr($data, strlen($match[0])); - if (!isset($parts)) - $parts = array(); // First time through: discard leading chaff - else { - if ($content = ParseMimeifiedPages($match[1])) - for (reset($content); $p = current($content); next($content)) - $parts[] = $p; - } - - if ($match[2]) - return $parts; // End boundary found. - } - ExitWiki("No end boundary?"); -} - -function GenerateFootnotesFromRefs($params) -{ - $footnotes = array(); - reset($params); - while (list($p, $reference) = each($params)) { - if (preg_match('/^ref([1-9][0-9]*)$/', $p, $m)) - $footnotes[$m[1]] = sprintf(_("[%d] See [%s]"), - $m[1], rawurldecode($reference)); - } - - if (sizeof($footnotes) > 0) { - ksort($footnotes); - return "-----\n" - . "!" . _("References") . "\n" - . join("\n%%%\n", $footnotes) . "\n"; - } else - return ""; -} - -// counterpart to $acl->asAclLines() and rawurl undecode -// default: "view:_EVERY; edit:_AUTHENTICATED; create:_AUTHENTICATED,_BOGOUSER; ". -// "list:_EVERY; remove:_ADMIN,_OWNER; change:_ADMIN,_OWNER; dump:_EVERY; " -function ParseMimeifiedPerm($string) -{ - if (!class_exists('PagePermission')) { - return ''; - } - $hash = array(); - foreach (explode(";", trim($string)) as $accessgroup) { - list($access, $groupstring) = explode(":", trim($accessgroup)); - $access = trim($access); - $groups = explode(",", trim($groupstring)); - foreach ($groups as $group) { - $group = trim($group); - $bool = (boolean)(substr($group, 0, 1) != '-'); - if (substr($group, 0, 1) == '-' or substr($group, 0, 1) == '+') - $group = substr($group, 1); - $hash[$access][$group] = $bool; - } - } - $perm = new PagePermission($hash); - $perm->sanify(); - return serialize($perm->perm); -} - -// Convert references in meta-data to footnotes. -// Only zip archives generated by phpwiki 1.2.x or earlier should have -// references. -function ParseMimeifiedPages($data) -{ - // We may need a lot of memory and time for the dump - ini_set("memory_limit", -1); - ini_set('max_execution_time', 0); - - if (!($headers = ParseRFC822Headers($data)) - || empty($headers['content-type']) - ) { - //trigger_error( sprintf(_("Can't find %s"),'content-type header'), - // E_USER_WARNING ); - return false; - } - $typeheader = $headers['content-type']; - - if (!(list ($type, $subtype, $params) = ParseMimeContentType($typeheader))) { - trigger_error(sprintf("Can't parse %s: (%s)", - 'content-type', $typeheader), - E_USER_WARNING); - return false; - } - if ("$type/$subtype" == 'multipart/mixed') { - return ParseMimeMultipart($data, $params['boundary']); - } elseif ("$type/$subtype" != 'application/x-phpwiki') { - trigger_error(sprintf("Bad %s", "content-type: $type/$subtype"), - E_USER_WARNING); - return false; - } - - // FIXME: more sanity checking? - $page = array(); - $pagedata = array(); - $versiondata = array(); - if (isset($headers['date'])) - $pagedata['date'] = strtotime($headers['date']); - - //DONE: support owner and acl - foreach ($params as $key => $value) { - if (empty($value)) - continue; - $value = rawurldecode($value); - switch ($key) { - case 'pagename': - case 'version': - $page[$key] = $value; - break; - case 'flags': - if (preg_match('/PAGE_LOCKED/', $value)) - $pagedata['locked'] = 'yes'; - if (ENABLE_EXTERNAL_PAGES && preg_match('/EXTERNAL_PAGE/', $value)) - $pagedata['external'] = 'yes'; - break; - case 'owner': - case 'created': - case 'hits': - $pagedata[$key] = $value; - break; - case 'acl': - case 'perm': - if (class_exists('PagePermission')) { - $pagedata['perm'] = ParseMimeifiedPerm($value); - } - break; - case 'lastmodified': - $versiondata['mtime'] = $value; - break; - case 'author': - case 'author_id': - case 'summary': - case 'pagetype': - $versiondata[$key] = $value; - break; - } - } - - // FIXME: do we need to try harder to find a pagename if we - // haven't got one yet? - if (!isset($versiondata['author'])) { - global $request; - if (is_object($request)) { - $user = $request->getUser(); - $versiondata['author'] = $user->getId(); //FIXME:? - } - } - - $encoding = strtolower($headers['content-transfer-encoding']); - if ($encoding == 'quoted-printable') - $data = QuotedPrintableDecode($data); - else if ($encoding && $encoding != 'binary') - ExitWiki(sprintf("Unknown %s", 'encoding type: $encoding')); - - $data .= GenerateFootnotesFromRefs($params); - - $page['content'] = preg_replace('/[ \t\r]*\n/', "\n", chop($data)); - $page['pagedata'] = $pagedata; - $page['versiondata'] = $versiondata; - - return array($page); -} - -// Local Variables: -// mode: php -// tab-width: 8 -// c-basic-offset: 4 -// c-hanging-comment-ender-p: nil -// indent-tabs-mode: nil -// End: Modified: trunk/locale/Makefile =================================================================== --- trunk/locale/Makefile 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/locale/Makefile 2015-02-04 17:02:30 UTC (rev 9509) @@ -106,6 +106,7 @@ ${POT_FILE}: ../lib/loadsave.php ${POT_FILE}: ../lib/MailNotify.php ${POT_FILE}: ../lib/main.php +${POT_FILE}: ../lib/mimelib.php ${POT_FILE}: ../lib/PageList.php ${POT_FILE}: ../lib/PagePerm.php ${POT_FILE}: ../lib/PageType.php @@ -346,7 +347,6 @@ ${POT_FILE}: ../lib/XmlRpcClient.php ${POT_FILE}: ../lib/XmlRpcServer.php ${POT_FILE}: ../lib/XMLRPC/utils.php -${POT_FILE}: ../lib/ziplib.php ${POT_FILE}: ../themes/alphatest.php ${POT_FILE}: ../themes/blog/lib/RecentChanges.php ${POT_FILE}: ../themes/blog/templates/actionbar.tmpl Modified: trunk/locale/po/de.po =================================================================== --- trunk/locale/po/de.po 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/locale/po/de.po 2015-02-04 17:02:30 UTC (rev 9509) @@ -549,6 +549,13 @@ msgid "LatestSnapshot" msgstr "LetzeSicherung" +msgid "Cannot create ZIP archive" +msgstr "" + +#, php-format +msgid "Created by PhpWiki %s" +msgstr "Erzeugt von PhpWiki %s" + msgid "You must specify a directory to dump to" msgstr "Sie müssen zum Sichern ein Verzeichnis angeben." @@ -703,6 +710,10 @@ msgid "Loading InterWikiMap from external file %s." msgstr "Die InterWikiListe wird von der externen Datei %s geladen." +#, fuzzy +msgid "Cannot open ZIP archive for reading" +msgstr "Konnte ZIP-Datei »%s« nicht zum Lesen öffnen" + msgid "Skipping" msgstr "Übersprungen" @@ -991,6 +1002,13 @@ msgstr "" #, php-format +msgid "[%d] See [%s]" +msgstr "[%d] Siehe [%s]" + +msgid "References" +msgstr "Fußnoten" + +#, php-format msgid "Sort by %s" msgstr "Sortiere nach %s" Modified: trunk/locale/po/es.po =================================================================== --- trunk/locale/po/es.po 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/locale/po/es.po 2015-02-04 17:02:30 UTC (rev 9509) @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-28 17:35+0100\n" +"POT-Creation-Date: 2015-02-04 17:13+0100\n" "PO-Revision-Date: 2000-02-01 00:50-0500\n" "Last-Translator: Pablo Roca <pr...@cl...>\n" "Language-Team: \n" @@ -538,6 +538,13 @@ msgid "LatestSnapshot" msgstr "La Foto Más última" +msgid "Cannot create ZIP archive" +msgstr "" + +#, php-format +msgid "Created by PhpWiki %s" +msgstr "Cree par PhpWiki %s" + msgid "You must specify a directory to dump to" msgstr "Usted debe especificar un directorio para descargar a" @@ -686,6 +693,9 @@ msgid "Loading InterWikiMap from external file %s." msgstr "Cargamento InterMapaDeWiki del archivo externo %s." +msgid "Cannot open ZIP archive for reading" +msgstr "" + msgid "Skipping" msgstr "El saltar" @@ -729,9 +739,9 @@ msgid "Page creation" msgstr "Versión de la página" -#, fuzzy, php-format +#, php-format msgid "Created by: %s" -msgstr "Cree: %s" +msgstr "Cree par: %s" #, php-format msgid "Summary: %s" @@ -972,6 +982,13 @@ msgstr "" #, php-format +msgid "[%d] See [%s]" +msgstr "[%d] Vea [%s]" + +msgid "References" +msgstr "Referencias" + +#, php-format msgid "Sort by %s" msgstr "Clase por %s" Modified: trunk/locale/po/fr.po =================================================================== --- trunk/locale/po/fr.po 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/locale/po/fr.po 2015-02-04 17:02:30 UTC (rev 9509) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-28 17:35+0100\n" +"POT-Creation-Date: 2015-02-04 17:13+0100\n" "PO-Revision-Date: 2004-06-22 21:10+0200\n" "Last-Translator: Pierrick Meignen <mei...@wa...>, Roland " "Trique <rol...@fr...>, Stéphane Gourichon <stephane.gourichon@lip6." @@ -540,6 +540,13 @@ msgid "LatestSnapshot" msgstr "DernierInstantané" +msgid "Cannot create ZIP archive" +msgstr "Impossible de créer l'archive ZIP" + +#, php-format +msgid "Created by PhpWiki %s" +msgstr "Créé par PhpWiki %s" + msgid "You must specify a directory to dump to" msgstr "Vous devez spécifier un répertoire pour l'archivage de la sauvegarde" @@ -687,6 +694,10 @@ msgid "Loading InterWikiMap from external file %s." msgstr "Chargement de la CarteInterWiki depuis le fichier %s." +#, fuzzy +msgid "Cannot open ZIP archive for reading" +msgstr "Impossible d'ouvrir le fichier ZIP « %s » en lecture" + msgid "Skipping" msgstr "Ignoré" @@ -972,6 +983,13 @@ "Votre version de PHP est trop ancienne. Il faut avoir au moins PHP 5.3." #, php-format +msgid "[%d] See [%s]" +msgstr "[%d] Voir [%s]" + +msgid "References" +msgstr "Références" + +#, php-format msgid "Sort by %s" msgstr "Trier par %s" Modified: trunk/locale/po/it.po =================================================================== --- trunk/locale/po/it.po 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/locale/po/it.po 2015-02-04 17:02:30 UTC (rev 9509) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-28 17:35+0100\n" +"POT-Creation-Date: 2015-02-04 17:13+0100\n" "PO-Revision-Date: 2005-02-12 16:23+0100\n" "Last-Translator: Antonio Bonifati ant[(at)]monitor.deis.unical.it\n" "Language-Team: \n" @@ -529,6 +529,13 @@ msgid "LatestSnapshot" msgstr "" +msgid "Cannot create ZIP archive" +msgstr "" + +#, php-format +msgid "Created by PhpWiki %s" +msgstr "" + msgid "You must specify a directory to dump to" msgstr "" @@ -675,6 +682,9 @@ msgid "Loading InterWikiMap from external file %s." msgstr "" +msgid "Cannot open ZIP archive for reading" +msgstr "" + msgid "Skipping" msgstr "" @@ -956,6 +966,13 @@ msgstr "" #, php-format +msgid "[%d] See [%s]" +msgstr "" + +msgid "References" +msgstr "" + +#, php-format msgid "Sort by %s" msgstr "Ordina per %s" Modified: trunk/locale/po/ja.po =================================================================== --- trunk/locale/po/ja.po 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/locale/po/ja.po 2015-02-04 17:02:30 UTC (rev 9509) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-28 17:35+0100\n" +"POT-Creation-Date: 2015-02-04 17:13+0100\n" "PO-Revision-Date: 2003-06-07 09:01+0900\n" "Last-Translator: Tadashi Jokagi <web...@el...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -516,6 +516,13 @@ msgid "LatestSnapshot" msgstr "" +msgid "Cannot create ZIP archive" +msgstr "" + +#, fuzzy, php-format +msgid "Created by PhpWiki %s" +msgstr "作成: %s" + msgid "You must specify a directory to dump to" msgstr "" @@ -664,6 +671,9 @@ msgid "Loading InterWikiMap from external file %s." msgstr "" +msgid "Cannot open ZIP archive for reading" +msgstr "" + msgid "Skipping" msgstr "" @@ -954,6 +964,13 @@ msgstr "" #, php-format +msgid "[%d] See [%s]" +msgstr "" + +msgid "References" +msgstr "参照一覧" + +#, php-format msgid "Sort by %s" msgstr "%sでソートします。" Modified: trunk/locale/po/nl.po =================================================================== --- trunk/locale/po/nl.po 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/locale/po/nl.po 2015-02-04 17:02:30 UTC (rev 9509) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-28 17:35+0100\n" +"POT-Creation-Date: 2015-02-04 17:13+0100\n" "PO-Revision-Date: 2000-09-30 02:23+0200\n" "Last-Translator: Jan Nieuwenhuizen <ja...@gn...>\n" "Language-Team: Dutch <nl...@li...>\n" @@ -520,6 +520,13 @@ msgid "LatestSnapshot" msgstr "" +msgid "Cannot create ZIP archive" +msgstr "" + +#, php-format +msgid "Created by PhpWiki %s" +msgstr "" + msgid "You must specify a directory to dump to" msgstr "Je moet een directory specificeren om in te storten" @@ -666,6 +673,9 @@ msgid "Loading InterWikiMap from external file %s." msgstr "" +msgid "Cannot open ZIP archive for reading" +msgstr "" + msgid "Skipping" msgstr "Overgeslagen" @@ -947,6 +957,13 @@ msgstr "" #, php-format +msgid "[%d] See [%s]" +msgstr "[%d] Zie [%s]" + +msgid "References" +msgstr "Referenties" + +#, php-format msgid "Sort by %s" msgstr "" Modified: trunk/locale/po/sv.po =================================================================== --- trunk/locale/po/sv.po 2015-02-04 15:33:42 UTC (rev 9508) +++ trunk/locale/po/sv.po 2015-02-04 17:02:30 UTC (rev 9509) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PhpWiki 1.5.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-28 17:35+0100\n" +"POT-Creation-Date: 2015-02-04 17:13+0100\n" "PO-Revision-Date: 2001-01-27 01:58+0200\n" "Last-Translator: Jon Åslund <jo...@he...>\n" "Language-Team: \n" @@ -515,6 +515,13 @@ msgid "LatestSnapshot" msgstr "" +msgid "Cannot create ZIP archive" +msgstr "" + +#, php-format +msgid "Created by PhpWiki %s" +msgstr "" + msgid "You must specify a directory to dump to" msgstr "" @@ -661,6 +668,9 @@ msgid "Loading InterWikiMap from external file %s." msgstr "" +msgid "Cannot open ZIP archive for reading" +msgstr "" + msgid "Skipping" msgstr "" @@ -942,6 +952,13 @@ msgstr "" #, php-format +msgid "[%d] See [%s]" +msgstr "" + +msgid "References" +msgstr "" + +#, php-format msgid "Sort by %s" msgstr "" Modified: trunk/locale/po/zh.po =================================================================== --- trunk/locale/po/zh.po 2015-02-04 15:33:42 UTC (rev... [truncated message content] |
From: <var...@us...> - 2015-02-04 15:33:43
|
Revision: 9508 http://sourceforge.net/p/phpwiki/code/9508 Author: vargenau Date: 2015-02-04 15:33:42 +0000 (Wed, 04 Feb 2015) Log Message: ----------- Remove TWIG Removed Paths: ------------- trunk/composer.json trunk/composer.lock trunk/vendor/ Deleted: trunk/composer.json =================================================================== --- trunk/composer.json 2015-02-04 15:29:17 UTC (rev 9507) +++ trunk/composer.json 2015-02-04 15:33:42 UTC (rev 9508) @@ -1,5 +0,0 @@ -{ - "require": { - "twig/twig": "~1.0" - } -} Deleted: trunk/composer.lock =================================================================== --- trunk/composer.lock 2015-02-04 15:29:17 UTC (rev 9507) +++ trunk/composer.lock 2015-02-04 15:33:42 UTC (rev 9508) @@ -1,75 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "a31e651ea26a527432562441b3545e0a", - "packages": [ - { - "name": "twig/twig", - "version": "v1.16.2", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/42f758d9fe2146d1f0470604fc05ee43580873fc", - "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.16-dev" - } - }, - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fa...@sy...", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "arm...@ac...", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "https://github.com/fabpot/Twig/graphs/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ], - "time": "2014-10-17 12:53:44" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-04 15:29:19
|
Revision: 9507 http://sourceforge.net/p/phpwiki/code/9507 Author: vargenau Date: 2015-02-04 15:29:17 +0000 (Wed, 04 Feb 2015) Log Message: ----------- Use http://phpwiki.fr/SOAP.php Modified Paths: -------------- trunk/PhpWiki.wsdl Modified: trunk/PhpWiki.wsdl =================================================================== --- trunk/PhpWiki.wsdl 2015-02-04 15:25:50 UTC (rev 9506) +++ trunk/PhpWiki.wsdl 2015-02-04 15:29:17 UTC (rev 9507) @@ -360,7 +360,7 @@ <service name="wikiService"> <port name="wikiPortType" binding="tns:wikiBinding"> - <soap:address location="http://phpwiki.nmu.alcatel.fr/phpwiki/SOAP.php" /> + <soap:address location="http://phpwiki.fr/SOAP.php" /> </port> </service> </definitions> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-04 15:26:03
|
Revision: 9506 http://sourceforge.net/p/phpwiki/code/9506 Author: vargenau Date: 2015-02-04 15:25:50 +0000 (Wed, 04 Feb 2015) Log Message: ----------- Introduce PHPWIKI_WSDL_URL variable Modified Paths: -------------- trunk/soapscripts/README trunk/soapscripts/createpage trunk/soapscripts/createpagefromfile trunk/soapscripts/fulltextsearch trunk/soapscripts/getallpagenames trunk/soapscripts/getcurrentrevision trunk/soapscripts/getpage trunk/soapscripts/getpagemeta trunk/soapscripts/getpagerevision trunk/soapscripts/getpluginsynopsis trunk/soapscripts/listlinks trunk/soapscripts/listplugins trunk/soapscripts/listrelations trunk/soapscripts/recentchanges trunk/soapscripts/replacestring trunk/soapscripts/titlesearch Modified: trunk/soapscripts/README =================================================================== --- trunk/soapscripts/README 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/README 2015-02-04 15:25:50 UTC (rev 9506) @@ -14,3 +14,6 @@ * recentchanges * replacestring * titlesearch + +The WSDL file is taken from environment variable PHPWIKI_WSDL_URL. +If this variable is not set, http://phpwiki.fr/PhpWiki.wsdl is used. Modified: trunk/soapscripts/createpage =================================================================== --- trunk/soapscripts/createpage 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/createpage 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/createpagefromfile =================================================================== --- trunk/soapscripts/createpagefromfile 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/createpagefromfile 2015-02-04 15:25:50 UTC (rev 9506) @@ -15,8 +15,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/fulltextsearch =================================================================== --- trunk/soapscripts/fulltextsearch 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/fulltextsearch 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } @@ -28,7 +33,7 @@ try { $pages = $client->doFullTextSearch($argv[1], $credentials); foreach ($pages as $page) { - echo $page['pagename']."\n"; + echo $page['pagename']."\n"; } } catch (SoapFault $e) { echo 'Error: ' . $e->getMessage() . "\n"; Modified: trunk/soapscripts/getallpagenames =================================================================== --- trunk/soapscripts/getallpagenames 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/getallpagenames 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/getcurrentrevision =================================================================== --- trunk/soapscripts/getcurrentrevision 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/getcurrentrevision 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/getpage =================================================================== --- trunk/soapscripts/getpage 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/getpage 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } @@ -17,7 +22,7 @@ $password = readline("Password: "); $credentials = base64_encode($login.':'.$password); if ($fp = fopen($phpwiki, 'w')) { - fprintf($fp, "%s:%s", $login, $password); + fprintf($fp, "%s:%s", $login, $password); fclose($fp); chmod($phpwiki, 0600); } Modified: trunk/soapscripts/getpagemeta =================================================================== --- trunk/soapscripts/getpagemeta 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/getpagemeta 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } @@ -28,7 +33,7 @@ try { $pagemeta = $client->getPageMeta($argv[1], $credentials); foreach ($pagemeta as $key => $value) { - echo "$key: $value\n"; + echo "$key: $value\n"; } } catch (SoapFault $e) { echo 'Error: ' . $e->getMessage() . "\n"; Modified: trunk/soapscripts/getpagerevision =================================================================== --- trunk/soapscripts/getpagerevision 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/getpagerevision 2015-02-04 15:25:50 UTC (rev 9506) @@ -9,8 +9,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/getpluginsynopsis =================================================================== --- trunk/soapscripts/getpluginsynopsis 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/getpluginsynopsis 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/listlinks =================================================================== --- trunk/soapscripts/listlinks 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/listlinks 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/listplugins =================================================================== --- trunk/soapscripts/listplugins 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/listplugins 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/listrelations =================================================================== --- trunk/soapscripts/listrelations 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/listrelations 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/recentchanges =================================================================== --- trunk/soapscripts/recentchanges 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/recentchanges 2015-02-04 15:25:50 UTC (rev 9506) @@ -9,8 +9,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/replacestring =================================================================== --- trunk/soapscripts/replacestring 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/replacestring 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } Modified: trunk/soapscripts/titlesearch =================================================================== --- trunk/soapscripts/titlesearch 2015-02-04 14:45:06 UTC (rev 9505) +++ trunk/soapscripts/titlesearch 2015-02-04 15:25:50 UTC (rev 9506) @@ -5,8 +5,13 @@ exit; } +$wsdl = getenv('PHPWIKI_WSDL_URL'); +if ($wsdl === false) { + $wsdl = "http://phpwiki.fr/PhpWiki.wsdl"; +} + try { - $client = new SoapClient("http://phpwiki.nmu.alcatel.fr/phpwiki/PhpWiki.wsdl"); + $client = new SoapClient($wsdl); } catch (SoapFault $fault) { die($fault->faultstring); } @@ -28,7 +33,7 @@ try { $pages = $client->doTitleSearch($argv[1], $credentials); foreach ($pages as $page) { - echo $page['pagename']."\n"; + echo $page['pagename']."\n"; } } catch (SoapFault $e) { echo 'Error: ' . $e->getMessage() . "\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-04 14:45:09
|
Revision: 9505 http://sourceforge.net/p/phpwiki/code/9505 Author: vargenau Date: 2015-02-04 14:45:06 +0000 (Wed, 04 Feb 2015) Log Message: ----------- No argument for getAllPagenames Modified Paths: -------------- trunk/soapscripts/getallpagenames Modified: trunk/soapscripts/getallpagenames =================================================================== --- trunk/soapscripts/getallpagenames 2015-02-02 15:49:51 UTC (rev 9504) +++ trunk/soapscripts/getallpagenames 2015-02-04 14:45:06 UTC (rev 9505) @@ -26,7 +26,7 @@ } try { - $all_pages = $client->getAllPagenames($argv[1]); + $all_pages = $client->getAllPagenames(); for ($i = 0; $i < count($all_pages); $i++) { echo $all_pages[$i]['pagename']; echo "\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-02 15:49:53
|
Revision: 9504 http://sourceforge.net/p/phpwiki/code/9504 Author: vargenau Date: 2015-02-02 15:49:51 +0000 (Mon, 02 Feb 2015) Log Message: ----------- Remove empty dir themes/fusionforge/buttons Removed Paths: ------------- trunk/themes/fusionforge/buttons/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-01-30 15:19:00
|
Revision: 9503 http://sourceforge.net/p/phpwiki/code/9503 Author: vargenau Date: 2015-01-30 15:18:59 +0000 (Fri, 30 Jan 2015) Log Message: ----------- PHP Doc Modified Paths: -------------- trunk/lib/ziplib.php Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2015-01-30 10:05:37 UTC (rev 9502) +++ trunk/lib/ziplib.php 2015-01-30 15:18:59 UTC (rev 9503) @@ -502,6 +502,13 @@ * automatically convert encodings to a safe type if they receive * mail encoded in '8bit' and/or 'binary' encodings. */ + +/** + * @param WikiDB_Page $page + * @param WikiDB_PageRevision $revision + * @return string + */ + function MimeifyPageRevision(&$page, &$revision) { // $wikidb =& $revision->_wikidb; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-01-30 10:05:40
|
Revision: 9502 http://sourceforge.net/p/phpwiki/code/9502 Author: vargenau Date: 2015-01-30 10:05:37 +0000 (Fri, 30 Jan 2015) Log Message: ----------- Add class error Modified Paths: -------------- trunk/lib/plugin/PageHistory.php Modified: trunk/lib/plugin/PageHistory.php =================================================================== --- trunk/lib/plugin/PageHistory.php 2015-01-29 17:40:50 UTC (rev 9501) +++ trunk/lib/plugin/PageHistory.php 2015-01-30 10:05:37 UTC (rev 9502) @@ -342,8 +342,8 @@ $args = $this->getArgs($argstr, $request); if (isset($args['limit']) && !is_limit($args['limit'])) { - return HTML::div(array('class' => "error"), - _("Illegal “limit” argument: must be an integer or two integers separated by comma")); + return HTML::p(array('class' => "error"), + _("Illegal “limit” argument: must be an integer or two integers separated by comma")); } $pagename = $args['page']; @@ -353,8 +353,8 @@ $page = $dbi->getPage($pagename); $current = $page->getCurrentRevision(); if ($current->getVersion() < 1) { - return HTML(HTML::p(fmt("Page “%s” does not exist.", WikiLink($pagename, 'unknown'))), - $this->makeForm("", $request)); + return HTML(HTML::p(array('class' => "error"), fmt("Page “%s” does not exist.", $pagename)), + $this->makeForm("", $request)); } // Hack alert: format() is a NORETURN for rss formatters. return $this->format($this->getChanges($dbi, $args), $args); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-01-29 17:40:57
|
Revision: 9501 http://sourceforge.net/p/phpwiki/code/9501 Author: vargenau Date: 2015-01-29 17:40:50 +0000 (Thu, 29 Jan 2015) Log Message: ----------- We may need a lot of memory and time for the dump Modified Paths: -------------- trunk/lib/ziplib.php Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2015-01-28 16:49:18 UTC (rev 9500) +++ trunk/lib/ziplib.php 2015-01-29 17:40:50 UTC (rev 9501) @@ -699,6 +699,10 @@ // references. function ParseMimeifiedPages($data) { + // We may need a lot of memory and time for the dump + ini_set("memory_limit", -1); + ini_set('max_execution_time', 0); + if (!($headers = ParseRFC822Headers($data)) || empty($headers['content-type']) ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-01-28 16:49:20
|
Revision: 9500 http://sourceforge.net/p/phpwiki/code/9500 Author: vargenau Date: 2015-01-28 16:49:18 +0000 (Wed, 28 Jan 2015) Log Message: ----------- Better MonoBook layout Modified Paths: -------------- trunk/themes/MonoBook/monobook.css Modified: trunk/themes/MonoBook/monobook.css =================================================================== --- trunk/themes/MonoBook/monobook.css 2015-01-28 16:37:54 UTC (rev 9499) +++ trunk/themes/MonoBook/monobook.css 2015-01-28 16:49:18 UTC (rev 9500) @@ -1191,7 +1191,7 @@ #p-personal .pBody { z-index: 0; padding: 0; - margin: 0; + margin: 12px 0 0 0; border: none; overflow: visible; background-image: none; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-01-28 16:38:05
|
Revision: 9499 http://sourceforge.net/p/phpwiki/code/9499 Author: vargenau Date: 2015-01-28 16:37:54 +0000 (Wed, 28 Jan 2015) Log Message: ----------- Use smart quotes Modified Paths: -------------- trunk/themes/default/templates/userprefs.tmpl trunk/themes/fusionforge/templates/userprefs.tmpl Modified: trunk/themes/default/templates/userprefs.tmpl =================================================================== --- trunk/themes/default/templates/userprefs.tmpl 2015-01-28 16:36:33 UTC (rev 9498) +++ trunk/themes/default/templates/userprefs.tmpl 2015-01-28 16:37:54 UTC (rev 9499) @@ -343,7 +343,7 @@ <p> <?php echo $RelativeDatesCB ?> <label for="relativeDates"> - <?php echo _("Show relative dates using 'Today' and 'Yesterday'") ?> + <?php echo _("Show relative dates using “Today” and “Yesterday”") ?> </label> </p> </td></tr> Modified: trunk/themes/fusionforge/templates/userprefs.tmpl =================================================================== --- trunk/themes/fusionforge/templates/userprefs.tmpl 2015-01-28 16:36:33 UTC (rev 9498) +++ trunk/themes/fusionforge/templates/userprefs.tmpl 2015-01-28 16:37:54 UTC (rev 9499) @@ -413,7 +413,7 @@ <p> <?php echo $RelativeDatesCB ?> <label for="relativeDates"> - <?php echo _("Show relative dates using 'Today' and 'Yesterday'") ?> + <?php echo _("Show relative dates using “Today” and “Yesterday”") ?> </label> </p> </td></tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |