[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/MIME/Viewer/ -> php.php (source)

   1  <?php
   2  
   3  require_once dirname(__FILE__) . '/source.php';
   4  
   5  /**
   6   * The MIME_Viewer_php class renders out syntax-highlighted PHP code
   7   * in HTML format.
   8   *
   9   * $Horde: framework/MIME/MIME/Viewer/php.php,v 1.22.10.8 2006/06/01 03:08:53 chuck Exp $
  10   *
  11   * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
  12   *
  13   * See the enclosed file COPYING for license information (LGPL). If you
  14   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  15   *
  16   * @author  Chuck Hagenbuch <chuck@horde.org>
  17   * @since   Horde 1.3
  18   * @package Horde_MIME_Viewer
  19   */
  20  class MIME_Viewer_php extends MIME_Viewer_source {
  21  
  22      /**
  23       * Renders out the contents.
  24       *
  25       * @param array $params  Any parameters the Viewer may need.
  26       *
  27       * @return string  The rendered contents.
  28       */
  29      function render($params = array())
  30      {
  31          $results = trim(str_replace(array("\n", '<br />'), array('', "\n"),
  32                                      highlight_string($this->mime_part->getContents(), true)));
  33  
  34          // Educated Guess at whether we are inline or not.
  35          if (headers_sent() || ob_get_length()) {
  36              return $this->lineNumber($results);
  37          } else {
  38              return Util::bufferOutput('require', $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc') .
  39                  $this->lineNumber($results) .
  40                  Util::bufferOutput('require', $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc');
  41          }
  42      }
  43  
  44  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7