21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: Papyrus.class.php,v 1.3 2004-12-07 12:17:37 jpm Exp $ |
// CVS : $Id: Papyrus.class.php,v 1.4 2005-01-20 19:39:39 jpm Exp $ |
/** |
* Classe configurant le formatage pour Papyrus. |
* |
36,7 → 36,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ $Date: 2004-12-07 12:17:37 $ |
*@version $Revision: 1.4 $ $Date: 2005-01-20 19:39:39 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
97,19 → 97,21 |
*/ |
var $delim = 12; |
|
function Text_Papyrus() |
function Text_Papyrus($rules = null) |
{ |
Text_Wiki::Text_Wiki(); |
//Text_Wiki::Text_Wiki(); |
if (is_array($rules)) { |
$this->rules = $rules; |
} |
// Nous devons sortir les fichiers de Text_Wiki du dépot Pear car la fonction file_exists de PHP utilisée dans |
// la méthode findfile de Text_Wiki renvoie false. |
$this->addPath('parse', $this->fixPath(dirname(__FILE__)) .'../../pear/Text/Wiki/Parse/'); |
$this->addPath('render', $this->fixPath(dirname(__FILE__)) .'../../pear/Text/Wiki/Render/'); |
// Pour les règles spécifiques à Papyrus: |
$this->addPath('parse', $this->fixPath(dirname(__FILE__)) . 'Parse/'); |
$this->addPath('render', $this->fixPath(dirname(__FILE__)) . 'Render/'); |
|
$this->addPath( |
'parse', |
$this->fixPath(dirname(__FILE__)) . 'Parse/' |
); |
|
$this->addPath( |
'render', |
$this->fixPath(dirname(__FILE__)) . 'Render/' |
); |
} |
|
/** |
169,9 → 171,17 |
// yes, get the replacement text for the delimited |
// token number and unset the flag. |
$key = (int)$key; |
$rule = $this->tokens[$key][0]; |
$opts = $this->tokens[$key][1]; |
$output .= $this->renderObj[$rule]->token($opts); |
$rule = null; |
if (isset($this->tokens[$key][0])) { |
$rule = $this->tokens[$key][0]; |
} |
$opts = null; |
if (isset($this->tokens[$key][1])) { |
$opts = $this->tokens[$key][1]; |
} |
if (isset($this->renderObj[$rule]) && is_object($this->renderObj[$rule])) { |
$output .= $this->renderObj[$rule]->token($opts); |
} |
$in_delim = false; |
|
} else { |
268,6 → 278,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2004/12/07 12:17:37 jpm |
* Correction message d'erreur. |
* |
* Revision 1.2 2004/11/26 12:13:03 jpm |
* Correction de résidu... |
* |