cvs: pear /Text_Wiki/Text/Wiki Tiki.php /Text_Wiki/Text/Wiki/Parse/Tiki Smiley.php
| From: | bertrand GUGGER | Date: | Tue, 04 Oct 2005 08:22:31 +0000 |
| Subject: | cvs: pear /Text_Wiki/Text/Wiki Tiki.php /Text_Wiki/Text/Wiki/Parse/Tiki Smiley.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35255@lists.php.net to get a copy of this message | ||
toggg Tue Oct 4 04:22:31 2005 EDT
Added files:
/pear/Text_Wiki/Text/Wiki/Parse/Tiki Smiley.php
Modified files:
/pear/Text_Wiki/Text/Wiki Tiki.php
Log:
Tiki people may also smile :)
http://cvs.php.net/diff.php/pear/Text_Wiki/Text/Wiki/Tiki.php?r1=1.3&r2=1.4&ty=u
Index: pear/Text_Wiki/Text/Wiki/Tiki.php
diff -u pear/Text_Wiki/Text/Wiki/Tiki.php:1.3 pear/Text_Wiki/Text/Wiki/Tiki.php:1.4
--- pear/Text_Wiki/Text/Wiki/Tiki.php:1.3 Sat Oct 1 11:47:17 2005
+++ pear/Text_Wiki/Text/Wiki/Tiki.php Tue Oct 4 04:22:31 2005
@@ -12,7 +12,7 @@
* @author Bertrand Gugger <bertrand@toggg.com>
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL
License 2.1
- * @version CVS: $Id: Tiki.php,v 1.3 2005/10/01 15:47:17 toggg Exp $
+ * @version CVS: $Id: Tiki.php,v 1.4 2005/10/04 08:22:31 toggg Exp $
* @link http://pear.php.net/package/Text_Wiki
*/
@@ -58,6 +58,7 @@
'Table',
'Box',
'Image',
+ 'Smiley',
// 'Phplookup',
'Center',
'Newline',
http://cvs.php.net/co.php/pear/Text_Wiki/Text/Wiki/Parse/Tiki/Smiley.php?r=1.1&p=1
Index: pear/Text_Wiki/Text/Wiki/Parse/Tiki/Smiley.php
+++ pear/Text_Wiki/Text/Wiki/Parse/Tiki/Smiley.php
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Tiki: Parses for smileys / emoticons tags
*
* This class implements a Text_Wiki_Rule to find source text marked as
* smileys defined by symbols as ':)' , ':-)' or ':smile:'
* The symbol is replaced with a token.
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Bertrand Gugger <bertrand@toggg.com>
* @copyright 2005 bertrand Gugger
* @license http://www.gnu.org/copyleft/lesser.html LGPL
License 2.1
* @version CVS: Exp $
* @link http://pear.php.net/package/Text_Wiki
*/
/**
* Smiley rule parser class for Tiki.
*
* @category Text
* @package Text_Wiki
* @author Bertrand Gugger <bertrand@toggg.com>
* @copyright 2005 bertrand Gugger
* @license http://www.gnu.org/copyleft/lesser.html LGPL
License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
* @see Text_Wiki_Parse::Text_Wiki_Parse()
*/
class Text_Wiki_Parse_Smiley extends Text_Wiki_Parse {
/**
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
* @var string
* @see parse()
*/
var $regex = '/\(:([^:]+):\)/';
/**
* Generates a replacement token for the matched text. Token options are:
* 'symbol' => the original marker
* 'name' => the name of the smiley
* 'desc' => the description of the smiley
*
* @param array &$matches The array of matches from parse().
* @return string Delimited token representing the smiley
* @access public
*/
function process(&$matches)
{
// tokenize
return $this->wiki->addToken($this->rule,
array(
'symbol' => $matches[0],
'name' => $matches[1],
'desc' => $matches[1]
));
}
}
?>