]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/stdlib.php
CSS now stored in an array, and <link rel="stylesheet"> headers are dynamically gener...
[SourceForge/phpwiki.git] / lib / stdlib.php
1 <?php rcs_id('$Id: stdlib.php,v 1.64 2002-01-03 00:09:18 carstenklapp Exp $');
2
3    /*
4       Standard functions for Wiki functionality
5          WikiURL($pagename, $args, $abs)
6          LinkWikiWord($wikiword, $linktext) 
7          LinkExistingWikiWord($wikiword, $linktext) 
8          LinkUnknownWikiWord($wikiword, $linktext) 
9          LinkURL($url, $linktext)
10          LinkImage($url, $alt)
11          LinkInterWikiLink($link, $linktext)
12          CookSpaces($pagearray) 
13          class Stack (push(), pop(), cnt(), top())
14          UpdateRecentChanges($dbi, $pagename, $isnewpage) 
15          ParseAndLink($bracketlink)
16          ExtractWikiPageLinks($content)
17          LinkRelatedPages($dbi, $pagename)
18    */
19
20
21    function DataURL($url) {
22       if (preg_match('@^(\w+:|/)@', $url))
23          return $url;
24       return SERVER_URL . DATA_PATH . "/$url";
25    }
26
27    function BaseURL() {
28       return SERVER_URL . VIRTUAL_PATH . "/";
29    }
30           
31 function WikiURL($pagename, $args = '', $get_abs_url = false) {
32     if (is_array($args)) {
33         $enc_args = array();
34         foreach  ($args as $key => $val) {
35             $enc_args[] = urlencode($key) . '=' . urlencode($val);
36         }
37         $args = join('&', $enc_args);
38     }
39
40     if (USE_PATH_INFO) {
41         $url = $get_abs_url ? SERVER_URL . VIRTUAL_PATH . "/" : '';
42         $url .= rawurlencode($pagename);
43         if ($args)
44             $url .= "?$args";
45     }
46     else {
47         $url = $get_abs_url ? SERVER_URL . SCRIPT_NAME : basename(SCRIPT_NAME);
48         $url .= "?pagename=" . rawurlencode($pagename);
49         if ($args)
50             $url .= "&$args";
51     }
52
53     return $url;
54 }
55
56 function CSS_URL($CSS_URLS, $CSS_DEFAULT) {
57     $html = "";
58     foreach  ($CSS_URLS as $key => $val) {
59         if ($CSS_DEFAULT == $key) {
60             $html .= "<link rel=\"stylesheet\" title=\"".htmlspecialchars($key)."\" href=\"". DataURL(htmlspecialchars($val))."\" type=\"text/css\" />\n";
61         } else {
62             $html .= "<link rel=\"alternate stylesheet\" title=\"".htmlspecialchars($key)."\" href=\"". DataURL(htmlspecialchars($val))."\" type=\"text/css\" />\n";
63         }
64     }
65     return $html;
66 }
67
68 define('NO_END_TAG_PAT',
69        '/^' . join('|', array('area', 'base', 'basefont',
70                               'br', 'col', 'frame',
71                               'hr', 'img', 'input',
72                               'isindex', 'link', 'meta',
73                               'param')) . '$/i');
74
75 function StartTag($tag, $args = '')
76 {
77    $s = "<$tag";
78    if (is_array($args))
79    {
80       while (list($key, $val) = each($args))
81       {
82          if (is_string($val) || is_numeric($val))
83             $s .= sprintf(' %s="%s"', $key, htmlspecialchars($val));
84          else if ($val)
85             $s .= " $key=\"$key\"";
86       }
87    }
88    return "$s>";
89 }
90
91    
92 function Element($tag, $args = '', $content = '')
93 {
94     $html = "<$tag";
95     if (!is_array($args)) {
96         $content = $args;
97         $args = false;
98     }
99     $html = StartTag($tag, $args);
100     if (preg_match(NO_END_TAG_PAT, $tag)) {
101         assert(! $content);
102         return preg_replace('/>$/', " />", $html);
103     } else {
104         $html .= $content;
105         $html .= "</$tag>";//FIXME: newline might not always be desired.
106     }
107     return $html;
108 }
109
110 function QElement($tag, $args = '', $content = '')
111 {
112     if (is_array($args))
113         return Element($tag, $args, htmlspecialchars($content));
114     else {
115         $content = $args;
116         return Element($tag, htmlspecialchars($content));
117     }
118 }
119
120 function IconForLink($protocol_or_url) {
121     global $URL_LINK_ICONS;
122
123     list ($proto) = explode(':', $protocol_or_url, 2);
124     
125     if (isset($URL_LINK_ICONS[$proto])) {
126         $linkimg = $URL_LINK_ICONS[$proto];
127     }
128     elseif (isset($URL_LINK_ICONS['*'])) {
129         $linkimg = $URL_LINK_ICONS['*'];
130     }
131
132     if (empty($linkimg))
133         return '';
134     
135     return Element('img', array('src' => DataURL($linkimg),
136                                 'alt' => $proto,
137                                 'class' => 'linkicon'));
138 }
139     
140    
141 function LinkURL($url, $linktext = '') {
142     // FIXME: Is this needed (or sufficient?)
143     if(ereg("[<>\"]", $url)) {
144         return Element('strong',
145                        QElement('u', array('class' => 'baduri'),
146                                 _("BAD URL -- remove all of <, >, \"")));
147     }
148
149     $attr['href'] = $url;
150
151     if (empty($linktext)) {
152         $linktext = $url;
153         $attr['class'] = 'rawurl';
154     }
155     else {
156         $attr['class'] = 'namedurl';
157     }
158
159     return Element('a', $attr,
160                    IconForLink($url) . htmlspecialchars($linktext));
161 }
162
163 function LinkWikiWord($wikiword, $linktext='') {
164     global $dbi;
165     if ($dbi->isWikiPage($wikiword))
166         return LinkExistingWikiWord($wikiword, $linktext);
167     else
168         return LinkUnknownWikiWord($wikiword, $linktext);
169 }
170
171     
172    function LinkExistingWikiWord($wikiword, $linktext='') {
173       if (empty($linktext)) {
174           $linktext = $wikiword;
175           if (defined("autosplit_wikiwords"))
176               $linktext=split_pagename($linktext);
177          $class = 'wiki';
178       }
179       else
180           $class = 'named-wiki';
181       
182       return QElement('a', array('href' => WikiURL($wikiword),
183                                  'class' => $class),
184                      $linktext);
185    }
186
187    function LinkUnknownWikiWord($wikiword, $linktext='') {
188       if (empty($linktext)) {
189           $linktext = $wikiword;
190           if (defined("autosplit_wikiwords"))
191               $linktext=split_pagename($linktext);
192           $class = 'wikiunknown';
193       }
194       else {
195           $class = 'named-wikiunknown';
196       }
197
198       return Element('span', array('class' => $class),
199                      QElement('a',
200                               array('href' => WikiURL($wikiword, array('action' => 'edit'))),
201                               '?')
202                      . Element('u', $linktext));
203    }
204
205    function LinkImage($url, $alt='[External Image]') {
206       // FIXME: Is this needed (or sufficient?)
207       //  As long as the src in htmlspecialchars()ed I think it's safe.
208       if(ereg("[<>\"]", $url)) {
209          return Element('strong',
210                         QElement('u', array('class' => 'baduri'),
211                                  _("BAD URL -- remove all of <, >, \"")));
212       }
213       return Element('img', array('src' => $url, 'alt' => $alt));
214    }
215
216    // converts spaces to tabs
217    function CookSpaces($pagearray) {
218       return preg_replace("/ {3,8}/", "\t", $pagearray);
219    }
220
221
222    class Stack {
223       var $items = array();
224       var $size = 0;
225
226       function push($item) {
227          $this->items[$this->size] = $item;
228          $this->size++;
229          return true;
230       }  
231    
232       function pop() {
233          if ($this->size == 0) {
234             return false; // stack is empty
235          }  
236          $this->size--;
237          return $this->items[$this->size];
238       }  
239    
240       function cnt() {
241          return $this->size;
242       }  
243
244       function top() {
245          if($this->size)
246             return $this->items[$this->size - 1];
247          else
248             return '';
249       }  
250
251    }  
252    // end class definition
253
254
255    function MakeWikiForm ($pagename, $args, $class, $button_text = '')
256    {
257       $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME;
258       $formargs['method'] = 'get';
259       $formargs['class'] = $class;
260       
261       $contents = '';
262       $input_seen = 0;
263       
264       while (list($key, $val) = each($args))
265       {
266          $a = array('name' => $key, 'value' => $val, 'type' => 'hidden');
267          
268          if (preg_match('/^ (\d*) \( (.*) \) ((upload)?) $/xi', $val, $m))
269          {
270             $input_seen++;
271             $a['type'] = 'text';
272             $a['size'] = $m[1] ? $m[1] : 30;
273             $a['value'] = $m[2];
274             if ($m[3])
275             {
276                $a['type'] = 'file';
277                $formargs['enctype'] = 'multipart/form-data';
278                $contents .= Element('input',
279                                     array('name' => 'MAX_FILE_SIZE',
280                                           'value' => MAX_UPLOAD_SIZE,
281                                           'type' => 'hidden'));
282                $formargs['method'] = 'post';
283             }
284          }
285
286          $contents .= Element('input', $a);
287       }
288
289       $row = Element('td', $contents);
290       
291       if (!empty($button_text)) {
292          $row .= Element('td', Element('input', array('type' => 'submit',
293                                                       'class' => 'button',
294                                                       'value' => $button_text)));
295       }
296
297       return Element('form', $formargs,
298                      Element('table', array('cellspacing' => 0, 'cellpadding' => 2, 'border' => 0),
299                              Element('tr', $row)));
300    }
301
302    function SplitQueryArgs ($query_args = '') 
303    {
304       $split_args = split('&', $query_args);
305       $args = array();
306       while (list($key, $val) = each($split_args))
307          if (preg_match('/^ ([^=]+) =? (.*) /x', $val, $m))
308             $args[$m[1]] = $m[2];
309       return $args;
310    }
311    
312 function LinkPhpwikiURL($url, $text = '') {
313         $args = array();
314
315         if (!preg_match('/^ phpwiki: ([^?]*) [?]? (.*) $/x', $url, $m))
316             return Element('strong',
317                            QElement('u', array('class' => 'baduri'),
318                                     'BAD phpwiki: URL'));
319         if ($m[1])
320                 $pagename = urldecode($m[1]);
321         $qargs = $m[2];
322       
323         if (empty($pagename) && preg_match('/^(diff|edit|links|info)=([^&]+)$/', $qargs, $m)) {
324                 // Convert old style links (to not break diff links in RecentChanges).
325                 $pagename = urldecode($m[2]);
326                 $args = array("action" => $m[1]);
327         }
328         else {
329                 $args = SplitQueryArgs($qargs);
330         }
331
332         if (empty($pagename))
333                 $pagename = $GLOBALS['pagename'];
334
335         if (isset($args['action']) && $args['action'] == 'browse')
336                 unset($args['action']);
337         /*FIXME:
338         if (empty($args['action']))
339                 $class = 'wikilink';
340         else if (is_safe_action($args['action']))
341                 $class = 'wikiaction';
342         */
343         if (empty($args['action']) || is_safe_action($args['action']))
344                 $class = 'wikiaction';
345         else {
346                 // Don't allow administrative links on unlocked pages.
347                 // FIXME: Ugh: don't like this...
348                 global $dbi;
349                 $page = $dbi->getPage($GLOBALS['pagename']);
350                 if (!$page->get('locked'))
351                         return QElement('u', array('class' => 'wikiunsafe'),
352                                         _("Lock page to enable link"));
353
354                 $class = 'wikiadmin';
355         }
356       
357         // FIXME: ug, don't like this
358         if (preg_match('/=\d*\(/', $qargs))
359                 return MakeWikiForm($pagename, $args, $class, $text);
360         if ($text)
361                 $text = htmlspecialchars($text);
362         else
363                 $text = QElement('span', array('class' => 'rawurl'), $url);
364
365         return Element('a', array('href' => WikiURL($pagename, $args),
366                                                           'class' => $class),
367                                    $text);
368 }
369
370    function ParseAndLink($bracketlink) {
371       global $dbi, $AllowedProtocols, $InlineImages;
372       global $InterWikiLinkRegexp;
373
374       // $bracketlink will start and end with brackets; in between
375       // will be either a page name, a URL or both separated by a pipe.
376
377       // strip brackets and leading space
378       preg_match("/(\[\s*)(.+?)(\s*\])/", $bracketlink, $match);
379       // match the contents 
380       preg_match("/([^|]+)(\|)?([^|]+)?/", $match[2], $matches);
381
382       if (isset($matches[3])) {
383          // named link of the form  "[some link name | http://blippy.com/]"
384          $URL = trim($matches[3]);
385          $linkname = trim($matches[1]);
386          $linktype = 'named';
387       } else {
388          // unnamed link of the form "[http://blippy.com/] or [wiki page]"
389          $URL = trim($matches[1]);
390          $linkname = '';
391          $linktype = 'simple';
392       }
393
394       if ($dbi->isWikiPage($URL)) {
395          $link['type'] = "wiki-$linktype";
396          $link['link'] = LinkExistingWikiWord($URL, $linkname);
397       } elseif (preg_match("#^($AllowedProtocols):#", $URL)) {
398         // if it's an image, embed it; otherwise, it's a regular link
399          if (preg_match("/($InlineImages)$/i", $URL)) {
400             $link['type'] = "image-$linktype";
401             $link['link'] = LinkImage($URL, $linkname);
402          } else {
403             $link['type'] = "url-$linktype";
404             $link['link'] = LinkURL($URL, $linkname);
405          }
406       } elseif (preg_match("#^phpwiki:(.*)#", $URL, $match)) {
407          $link['type'] = "url-wiki-$linktype";
408          $link['link'] = LinkPhpwikiURL($URL, $linkname);
409       } elseif (preg_match("#^\d+$#", $URL)) {
410          $link['type'] = "footnote-$linktype";
411          $link['link'] = $URL;
412       } elseif (function_exists('LinkInterWikiLink') &&
413                 preg_match("#^$InterWikiLinkRegexp:#", $URL)) {
414          $link['type'] = "interwiki-$linktype";
415          $link['link'] = LinkInterWikiLink($URL, $linkname);
416       } else {
417          $link['type'] = "wiki-unknown-$linktype";
418          $link['link'] = LinkUnknownWikiWord($URL, $linkname);
419       }
420
421       return $link;
422    }
423
424
425 function ExtractWikiPageLinks($content)
426 {
427     global $WikiNameRegexp;
428     
429     if (is_string($content))
430         $content = explode("\n", $content);
431
432     $wikilinks = array();
433     foreach ($content as $line) {
434         // remove plugin code
435         $line = preg_replace('/<\?plugin\s+\w.*?\?>/', '', $line);
436         // remove escaped '['
437         $line = str_replace('[[', ' ', $line);
438
439   // bracket links (only type wiki-* is of interest)
440   $numBracketLinks = preg_match_all("/\[\s*([^\]|]+\|)?\s*(\S.*?)\s*\]/", $line, $brktlinks);
441   for ($i = 0; $i < $numBracketLinks; $i++) {
442      $link = ParseAndLink($brktlinks[0][$i]);
443      if (preg_match("#^wiki#", $link['type']))
444         $wikilinks[$brktlinks[2][$i]] = 1;
445
446          $brktlink = preg_quote($brktlinks[0][$i]);
447          $line = preg_replace("|$brktlink|", '', $line);
448   }
449
450       // BumpyText old-style wiki links
451       if (preg_match_all("/!?$WikiNameRegexp/", $line, $link)) {
452          for ($i = 0; isset($link[0][$i]); $i++) {
453             if($link[0][$i][0] <> '!')
454                $wikilinks[$link[0][$i]] = 1;
455      }
456       }
457    }
458    return array_keys($wikilinks);
459 }      
460
461    function LinkRelatedPages($dbi, $pagename)
462    {
463       // currently not supported everywhere
464       if(!function_exists('GetWikiPageLinks'))
465          return '';
466
467       //FIXME: fix or toss?
468       $links = GetWikiPageLinks($dbi, $pagename);
469
470       $txt = QElement('strong',
471                       sprintf (_("%d best incoming links:"), NUM_RELATED_PAGES));
472       for($i = 0; $i < NUM_RELATED_PAGES; $i++) {
473          if(isset($links['in'][$i])) {
474             list($name, $score) = $links['in'][$i];
475             $txt .= LinkExistingWikiWord($name) . " ($score), ";
476          }
477       }
478       
479       $txt .= "\n" . Element('br');
480       $txt .= Element('strong',
481                       sprintf (_("%d best outgoing links:"), NUM_RELATED_PAGES));
482       for($i = 0; $i < NUM_RELATED_PAGES; $i++) {
483          if(isset($links['out'][$i])) {
484             list($name, $score) = $links['out'][$i];
485             if($dbi->isWikiPage($name))
486                $txt .= LinkExistingWikiWord($name) . " ($score), ";
487          }
488       }
489
490       $txt .= "\n" . Element('br');
491       $txt .= Element('strong',
492                       sprintf (_("%d most popular nearby:"), NUM_RELATED_PAGES));
493       for($i = 0; $i < NUM_RELATED_PAGES; $i++) {
494          if(isset($links['popular'][$i])) {
495             list($name, $score) = $links['popular'][$i];
496             $txt .= LinkExistingWikiWord($name) . " ($score), ";
497          }
498       }
499       
500       return $txt;
501    }
502
503
504 /**
505  * Split WikiWords in page names.
506  *
507  * It has been deemed useful to split WikiWords (into "Wiki Words")
508  * in places like page titles.  This is rumored to help search engines
509  * quite a bit.
510  *
511  * @param $page string The page name.
512  *
513  * @return string The split name.
514  */
515 function split_pagename ($page) {
516     
517     if (preg_match("/\s/", $page))
518         return $page;           // Already split --- don't split any more.
519
520     // FIXME: this algorithm is Anglo-centric.
521     static $RE;
522     if (!isset($RE)) {
523         // This mess splits between a lower-case letter followed by either an upper-case
524         // or a numeral; except that it wont split the prefixes 'Mc', 'De', or 'Di' off
525         // of their tails.
526                         $RE[] = '/([[:lower:]])((?<!Mc|De|Di)[[:upper:]]|\d)/';
527         // This the single-letter words 'I' and 'A' from any following capitalized words.
528         $RE[] = '/(?: |^)([AI])([[:upper:]])/';
529         // Split numerals from following letters.
530         $RE[] = '/(\d)([[:alpha:]])/';
531
532         foreach ($RE as $key => $val)
533             $RE[$key] = pcre_fix_posix_classes($val);
534     }
535
536     foreach ($RE as $regexp)
537         $page = preg_replace($regexp, '\\1 \\2', $page);
538     return $page;
539 }
540
541 function NoSuchRevision ($page, $version) {
542     $html = Element('p', QElement('strong', gettext("Bad Version"))) . "\n";
543     $html .= QElement('p',
544                       sprintf(_("I'm sorry.  Version %d of %s is not in my database."),
545                               $version, $page->getName())) . "\n";
546
547     include_once('lib/Template.php');
548     echo GeneratePage('MESSAGE', $html, _("Bad Version"));
549     ExitWiki ("");
550 }
551
552
553 /**
554  * Get time offset for local time zone.
555  *
556  * @param $time time_t Get offset for this time.  Default: now.
557  * @param $no_colon boolean Don't put colon between hours and minutes.
558  * @return string Offset as a string in the format +HH:MM.
559  */
560 function TimezoneOffset ($time = false, $no_colon = false) {
561     if ($time === false)
562         $time = time();
563     $secs = date('Z', $time);
564     if ($secs < 0) {
565         $sign = '-';
566         $secs = -$secs;
567     }
568     else {
569         $sign = '+';
570     }
571     $colon = $no_colon ? '' : ':';
572     $mins = intval(($secs + 30) / 60);
573     return sprintf("%s%02d%s%02d",
574                    $sign, $mins / 60, $colon, $mins % 60);
575 }
576     
577 /**
578  * Format time in ISO-8601 format.
579  *
580  * @param $time time_t Time.  Default: now.
581  * @return string Date and time in ISO-8601 format.
582  */
583 function Iso8601DateTime ($time = false) {
584     if ($time === false)
585         $time = time();
586     $tzoff = TimezoneOffset($time);
587     $date = date('Y-m-d', $time);
588     $time=date('H:i:s', $time);
589     return $date . 'T' . $time . $tzoff;
590 }
591
592 /**
593  * Format time in RFC-2822 format.
594  *
595  * @param $time time_t Time.  Default: now.
596  * @return string Date and time in RFC-2822 format.
597  */
598 function Rfc2822DateTime ($time = false) {
599     if ($time === false)
600         $time = time();
601     return date('D, j M Y H:i:s ', $time) . TimezoneOffset($time, 'no colon');
602 }
603
604 /**
605  * Format time to standard 'ctime' format.
606  *
607  * @param $time time_t Time.  Default: now.
608  * @return string Date and time in RFC-2822 format.
609  */
610 function CTime ($time = false)
611 {
612     if ($time === false)
613         $time = time();
614     return date("D M j H:i:s Y", $time);
615 }
616
617
618
619 /**
620  * Internationalized printf.
621  *
622  * This is essentially the same as PHP's built-in printf
623  * with the following exceptions:
624  * <ol>
625  * <li> It passes the format string through gettext().
626  * <li> It supports the argument reordering extensions.
627  * </ol>
628  *
629  * Example:
630  *
631  * In php code, use:
632  * <pre>
633  *    __printf("Differences between versions %s and %s of %s",
634  *             $new_link, $old_link, $page_link);
635  * </pre>
636  *
637  * Then in locale/po/de.po, one can reorder the printf arguments:
638  *
639  * <pre>
640  *    msgid "Differences between %s and %s of %s."
641  *    msgstr "Der Unterschiedsergebnis von %3$s, zwischen %1$s und %2$s."
642  * </pre>
643  *
644  * (Note that while PHP tries to expand $vars within double-quotes,
645  * the values in msgstr undergo no such expansion, so the '$'s okay...)
646  *
647  * One shouldn't use reordered arguments in the default format string.
648  * Backslashes in the default string would be necessary to escape the '$'s,
649  * and they'll cause all kinds of trouble....
650  */ 
651 function __printf ($fmt) {
652     $args = func_get_args();
653     array_shift($args);
654     echo __vsprintf($fmt, $args);
655 }
656
657 /**
658  * Internationalized sprintf.
659  *
660  * This is essentially the same as PHP's built-in printf
661  * with the following exceptions:
662  * <ol>
663  * <li> It passes the format string through gettext().
664  * <li> It supports the argument reordering extensions.
665  * </ol>
666  *
667  * @see __printf
668  */ 
669 function __sprintf ($fmt) {
670     $args = func_get_args();
671     array_shift($args);
672     return __vsprintf($fmt, $args);
673 }
674   
675 /**
676  * Internationalized vsprintf.
677  *
678  * This is essentially the same as PHP's built-in printf
679  * with the following exceptions:
680  * <ol>
681  * <li> It passes the format string through gettext().
682  * <li> It supports the argument reordering extensions.
683  * </ol>
684  *
685  * @see __printf
686  */ 
687 function __vsprintf ($fmt, $args) {
688     $fmt = gettext($fmt);
689     // PHP's sprintf doesn't support variable with specifiers,
690     // like sprintf("%*s", 10, "x"); --- so we won't either.
691     
692     if (preg_match_all('/(?<!%)%(\d+)\$/x', $fmt, $m)) {
693         // Format string has '%2$s' style argument reordering.
694         // PHP doesn't support this.
695         if (preg_match('/(?<!%)%[- ]?\d*[^- \d$]/x', $fmt))
696             trigger_error(sprintf(_("Can't mix '%s' with '%s' type format strings"),'%1\$s','%s'), E_USER_WARNING);
697     
698         $fmt = preg_replace('/(?<!%)%\d+\$/x', '%', $fmt);
699         $newargs = array();
700     
701         // Reorder arguments appropriately.
702         foreach($m[1] as $argnum) {
703             if ($argnum < 1 || $argnum > count($args))
704                 trigger_error(sprintf(_("%s: argument index out of range"),$argnum), E_USER_WARNING);
705             $newargs[] = $args[$argnum - 1];
706         }
707         $args = $newargs;
708     }
709
710     // Not all PHP's have vsprintf, so...
711     array_unshift($args, $fmt);
712     return call_user_func_array('sprintf', $args);
713 }
714
715
716 // (c-file-style: "gnu")
717 // Local Variables:
718 // mode: php
719 // tab-width: 8
720 // c-basic-offset: 4
721 // c-hanging-comment-ender-p: nil
722 // indent-tabs-mode: nil
723 // End:   
724 ?>