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

Source for file Phplookup.php

Documentation is available at Phplookup.php

  1. <?php
  2.  
  3. class Text_Wiki_Render_Xhtml_Phplookup extends Text_Wiki_Render {
  4.     
  5.     var $conf = array(
  6.         'target' => '_blank',
  7.         'css' => null
  8.     );
  9.     
  10.     
  11.     /**
  12.     * 
  13.     * Renders a token into text matching the requested format.
  14.     * 
  15.     * @access public
  16.     * 
  17.     * @param array $options The "options" portion of the token (second
  18.     *  element).
  19.     * 
  20.     * @return string The text rendered from the token options.
  21.     * 
  22.     */
  23.     
  24.     function token($options)
  25.     {
  26.         $text trim($options['text']);
  27.         $css $this->formatConf(' class="%s"''css');
  28.         
  29.         // start the html
  30.         $output = "<a$css";
  31.         
  32.         // are we targeting another window?
  33.         $target $this->getConf('target''');
  34.         if ($target{
  35.             // use a "popup" window.  this is XHTML compliant, suggested by
  36.             // Aaron Kalin.  uses the $target as the new window name.
  37.             $target htmlspecialchars($target);
  38.             $output .= " onclick=\"window.open(this.href, '$target');";
  39.             $output .= " return false;\"";
  40.         }
  41.         
  42.         // take off the final parens for functions
  43.         if (substr($text-2== '()'{
  44.             $q substr($text0-2);
  45.         else {
  46.             $q $text;
  47.         }
  48.         
  49.         $q htmlspecialchars($q);
  50.         $text htmlspecialchars($text);
  51.         
  52.         // finish and return
  53.         $output .= " href=\"http://php.net/$q\">$text</a>";
  54.         return $output;
  55.     }
  56. }
  57. ?>

Documentation generated on Mon, 11 Mar 2019 13:55:28 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.