Subversion Repositories Applications.papyrus

Rev

Rev 224 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 224 Rev 247
Line 19... Line 19...
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: Papyrus.class.php,v 1.3 2004-12-07 12:17:37 jpm Exp $
24
// CVS : $Id: Papyrus.class.php,v 1.4 2005-01-20 19:39:39 jpm Exp $
25
/**
25
/**
26
* Classe configurant le formatage pour Papyrus.
26
* Classe configurant le formatage pour Papyrus.
27
*
27
*
28
* Ce fichier contient une classe configurant les règles de formatage de Papyrus.
28
* Ce fichier contient une classe configurant les règles de formatage de Papyrus.
29
* Nécessite que l'application appelant ce fichier est précédement inclu le fichier de Pear:
29
* Nécessite que l'application appelant ce fichier est précédement inclu le fichier de Pear:
Line 34... Line 34...
34
//Auteur original :
34
//Auteur original :
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
//Autres auteurs :
36
//Autres auteurs :
37
*@author        Aucun
37
*@author        Aucun
38
*@copyright     Tela-Botanica 2000-2004
38
*@copyright     Tela-Botanica 2000-2004
39
*@version       $Revision: 1.3 $ $Date: 2004-12-07 12:17:37 $
39
*@version       $Revision: 1.4 $ $Date: 2005-01-20 19:39:39 $
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
*/
41
*/
Line 42... Line 42...
42
 
42
 
43
// +------------------------------------------------------------------------------------------------------+
43
// +------------------------------------------------------------------------------------------------------+
Line 95... Line 95...
95
    * @var string
95
    * @var string
96
    * 
96
    * 
97
    */
97
    */
98
    var $delim = 12;
98
    var $delim = 12;
Line 99... Line 99...
99
    
99
    
100
    function Text_Papyrus()
100
    function Text_Papyrus($rules = null)
101
    {
101
    {
-
 
102
        //Text_Wiki::Text_Wiki();
-
 
103
        if (is_array($rules)) {
-
 
104
            $this->rules = $rules;
-
 
105
        }
-
 
106
        // Nous devons sortir les fichiers de Text_Wiki du dépot Pear car la fonction file_exists de PHP utilisée dans
-
 
107
        // la méthode findfile de Text_Wiki renvoie false.
-
 
108
        $this->addPath('parse', $this->fixPath(dirname(__FILE__)) .'../../pear/Text/Wiki/Parse/');
-
 
109
        $this->addPath('render', $this->fixPath(dirname(__FILE__)) .'../../pear/Text/Wiki/Render/');
-
 
110
        // Pour les règles spécifiques à Papyrus:
-
 
111
        $this->addPath('parse', $this->fixPath(dirname(__FILE__)) . 'Parse/');
Line 102... Line -...
102
        Text_Wiki::Text_Wiki();
-
 
103
        
-
 
104
        $this->addPath(
-
 
105
            'parse',
-
 
Line 106... Line -...
106
            $this->fixPath(dirname(__FILE__)) . 'Parse/'
-
 
107
        );
-
 
108
        
-
 
109
        $this->addPath(
-
 
110
            'render',
112
        $this->addPath('render', $this->fixPath(dirname(__FILE__)) . 'Render/');
Line 111... Line 113...
111
            $this->fixPath(dirname(__FILE__)) . 'Render/'
113
        
112
        );
114
        
113
    }
115
    }
Line 167... Line 169...
167
                if ($char == chr($this->delim)) {
169
                if ($char == chr($this->delim)) {
Line 168... Line 170...
168
                    
170
                    
169
                    // yes, get the replacement text for the delimited
171
                    // yes, get the replacement text for the delimited
170
                    // token number and unset the flag.
172
                    // token number and unset the flag.
-
 
173
                    $key = (int)$key;
-
 
174
                    $rule = null;
171
                    $key = (int)$key;
175
                    if (isset($this->tokens[$key][0])) {
-
 
176
                        $rule = $this->tokens[$key][0];
-
 
177
                    }
-
 
178
                    $opts = null;
172
                    $rule = $this->tokens[$key][0];
179
                    if (isset($this->tokens[$key][1])) {
-
 
180
                        $opts = $this->tokens[$key][1];
-
 
181
                    }
173
                    $opts = $this->tokens[$key][1];
182
                    if (isset($this->renderObj[$rule]) && is_object($this->renderObj[$rule])) {
-
 
183
                        $output .= $this->renderObj[$rule]->token($opts);
174
                    $output .= $this->renderObj[$rule]->token($opts);
184
                    }
Line 175... Line 185...
175
                    $in_delim = false;
185
                    $in_delim = false;
Line 176... Line 186...
176
                    
186
                    
Line 266... Line 276...
266
 
276
 
267
 
277
 
268
/* +--Fin du code ----------------------------------------------------------------------------------------+
278
/* +--Fin du code ----------------------------------------------------------------------------------------+
-
 
279
*
-
 
280
* $Log: not supported by cvs2svn $
-
 
281
* Revision 1.3  2004/12/07 12:17:37  jpm
269
*
282
* Correction message d'erreur.
270
* $Log: not supported by cvs2svn $
283
*
271
* Revision 1.2  2004/11/26 12:13:03  jpm
284
* Revision 1.2  2004/11/26 12:13:03  jpm
272
* Correction de résidu...
285
* Correction de résidu...
273
*
286
*