From: <var...@us...> - 2009-03-06 16:32:28
|
Revision: 6654 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6654&view=rev Author: vargenau Date: 2009-03-06 16:32:04 +0000 (Fri, 06 Mar 2009) Log Message: ----------- PRE has no "name" attribute Modified Paths: -------------- trunk/lib/plugin/CreateBib.php Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2009-03-06 16:29:27 UTC (rev 6653) +++ trunk/lib/plugin/CreateBib.php 2009-03-06 16:32:04 UTC (rev 6654) @@ -134,8 +134,7 @@ $html = HTML::div(array('class' => 'bib','align' => 'left')); $html->pushContent($dump_button, ' '); - $list = HTML::pre(array('name'=>'biblist','id'=>'biblist', - 'class' => 'bib')); + $list = HTML::pre(array('id'=>'biblist', 'class' => 'bib')); // Let's find the subpages if ($articles = $this->extractArticles($content)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-12-09 15:07:29
|
Revision: 7760 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7760&view=rev Author: vargenau Date: 2010-12-09 15:07:23 +0000 (Thu, 09 Dec 2010) Log Message: ----------- Remove unused function Modified Paths: -------------- trunk/lib/plugin/CreateBib.php Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2010-12-09 15:02:18 UTC (rev 7759) +++ trunk/lib/plugin/CreateBib.php 2010-12-09 15:07:23 UTC (rev 7760) @@ -46,12 +46,6 @@ ); } - function preg_quote ($heading) { - return str_replace(array("/",".","?","*"), - array('\/','\.','\?','\*'), $heading); - } - - // Have to include the $starttag and $endtag to the regexps... function extractBibTeX (&$content, $starttag, $endtag) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-06-09 10:04:16
|
Revision: 8098 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8098&view=rev Author: vargenau Date: 2011-06-09 10:04:10 +0000 (Thu, 09 Jun 2011) Log Message: ----------- Avoid PHP Fatal error: Call to a member function getCurrentRevision() on a non-object Modified Paths: -------------- trunk/lib/plugin/CreateBib.php Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2011-06-09 07:54:38 UTC (rev 8097) +++ trunk/lib/plugin/CreateBib.php 2011-06-09 10:04:10 UTC (rev 8098) @@ -149,9 +149,7 @@ // Yes, we want to dump this somewhere // Get the contents of this page $p = $dbi->getPage($pagename); - $c = $p->getCurrentRevision(); - $pagedata = $c->getContent(); - $this->dumpFile($pagedata, $request->getArg('file')); + return $this->dumpFile($p, $request->getArg('file')); } return $html; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-06-13 12:57:19
|
Revision: 8908 http://sourceforge.net/p/phpwiki/code/8908 Author: vargenau Date: 2014-06-13 12:57:16 +0000 (Fri, 13 Jun 2014) Log Message: ----------- Use CSS Modified Paths: -------------- trunk/lib/plugin/CreateBib.php Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2014-06-13 12:52:03 UTC (rev 8907) +++ trunk/lib/plugin/CreateBib.php 2014-06-13 12:57:16 UTC (rev 8908) @@ -119,7 +119,7 @@ $dump_button = $WikiTheme->makeButton("To File", $dump_url, 'foo'); - $html = HTML::div(array('class' => 'bib', 'align' => 'left')); + $html = HTML::div(array('class' => 'bib align-left')); $html->pushContent($dump_button, ' '); $list = HTML::pre(array('id' => 'biblist', 'class' => 'bib')); 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. |