Text_Wiki_Tiki
[ class tree: Text_Wiki_Tiki ] [ index: Text_Wiki_Tiki ] [ all elements ]

Source for file Image.php

Documentation is available at Image.php

  1. <?php
  2. class Text_Wiki_Render_Tiki_Image extends Text_Wiki_Render {
  3.  
  4.     /**
  5.      * Defines rule specific configuration
  6.      *
  7.      * @var array 
  8.      */
  9.     var $conf = array(
  10.        'prefix' => 'img/wiki_up/' // path to the wiki image directory 
  11.     );
  12.  
  13.     /**
  14.     *
  15.     * Renders a token into text matching the requested format.
  16.     *
  17.     * @access public
  18.     *
  19.     * @param array $options The "options" portion of the token (second
  20.     *  element).
  21.     *
  22.     * @return string The text rendered from the token options.
  23.     *
  24.     */
  25.  
  26.     function token($options)
  27.     {
  28.         $img '{img src="';
  29.         if (!empty($this->conf['prefix']))
  30.             $img .= $this->conf['prefix'];
  31.         $img .= $options['src''"';
  32.  
  33.         if (is_array($options['attr'])) {
  34.             foreach ($options['attr'as $var => $val{
  35.                 $img .= ' '.$var.'="'.$val.'"';
  36.             }
  37.         }
  38.         $img .= '}';
  39.         return $img;
  40.     }
  41. }
  42. ?>

Documentation generated on Mon, 11 Mar 2019 15:32:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.