[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/htmlpurifier/library/HTMLPurifier/Injector/ -> DisplayLinkURI.php (source)

   1  <?php
   2  
   3  /**
   4   * Injector that displays the URL of an anchor instead of linking to it, in addition to showing the text of the link.
   5   */
   6  class HTMLPurifier_Injector_DisplayLinkURI extends HTMLPurifier_Injector
   7  {
   8  
   9      public $name = 'DisplayLinkURI';
  10      public $needed = array('a');
  11  
  12      public function handleElement(&$token) {
  13      }
  14  
  15      public function handleEnd(&$token) {
  16          if (isset($token->start->attr['href'])){
  17              $url = $token->start->attr['href'];
  18              unset($token->start->attr['href']);
  19              $token = array($token, new HTMLPurifier_Token_Text(" ($url)"));
  20          } else {
  21              // nothing to display
  22          }
  23      }
  24  }
  25  
  26  // vim: et sw=4 sts=4


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1