cvs: pearweb /include/pepr pepr.php
| From: | Tobias Schlitt | Date: | Sun, 05 Sep 2004 13:33:48 +0000 |
| Subject: | cvs: pearweb /include/pepr pepr.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-23653@lists.php.net to get a copy of this message | ||
toby Sun Sep 5 09:33:48 2004 EDT
Modified files:
/pearweb/include/pepr pepr.php
Log:
* Moved markup processing to own method.
http://cvs.php.net/diff.php/pearweb/include/pepr/pepr.php?r1=1.50&r2=1.51&ty=u
Index: pearweb/include/pepr/pepr.php
diff -u pearweb/include/pepr/pepr.php:1.50 pearweb/include/pepr/pepr.php:1.51
--- pearweb/include/pepr/pepr.php:1.50 Sat Sep 4 21:35:51 2004
+++ pearweb/include/pepr/pepr.php Sun Sep 5 09:33:47 2004
@@ -22,7 +22,7 @@
* @author Daniel Convissor <danielc@php.net>
* @copyright Copyright (c) 1997-2004 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License
- * @version $Id: pepr.php,v 1.50 2004/09/05 01:35:51 toby Exp $
+ * @version $Id: pepr.php,v 1.51 2004/09/05 13:33:47 toby Exp $
*/
/**#@+
@@ -173,10 +173,33 @@
'desc' => '
Proposed package:
'.$this->pkg_category.'::'.$this->pkg_name.'<br />
Proposer: '.user_link($this->user_handle).'<br />
-'.$this->pkg_describtion,
+'.$this->getParsedDescribtion(),
'date' => date("Y-m-d\TH:i:s-05:00",
$this->draft_date)
);
}
+
+ function getParsedDescribtion ( ) {
+ if (empty($this->pkg_describtion)) {
+ return '';
+ }
+ // Switching markup types
+ switch ($this->markup) {
+ case 'wiki':
+ require_once 'Text/Wiki.php';
+ $wiki =& new Text_Wiki();
+ $wiki->disableRule('wikilink');
+ $describtion = $wiki->transform($this->pkg_describtion);
+ break;
+ case 'bbcode':
+ default:
+ require_once 'HTML/BBCodeParser.php';
+ $bbparser = new HTML_BBCodeParser(array('filters' =>
'Basic,Images,Links,Lists,Extended'));
+ $describtion = $bbparser->qparse(nl2br(htmlentities($this->pkg_describtion)));
+ break;
+ }
+ return $describtion;
+ }
+
/**
* Look up proposal information based on the proposal ID number
*