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

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