~ubuntu-branches/ubuntu/saucy/horde3/saucy

« back to all changes in this revision

Viewing changes to lib/Horde/MIME/Viewer/php.php

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2005-05-04 23:08:08 UTC
  • Revision ID: james.westby@ubuntu.com-20050504230808-p4hf3hk28o3v7wir
Tags: upstream-3.0.4
ImportĀ upstreamĀ versionĀ 3.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.1 2005/01/03 12:19:06 jan Exp $
 
10
 *
 
11
 * Copyright 1999-2005 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
 * @version $Revision: 1.22.10.1 $
 
18
 * @since   Horde 1.3
 
19
 * @package Horde_MIME_Viewer
 
20
 */
 
21
class MIME_Viewer_php extends MIME_Viewer_source {
 
22
 
 
23
    /**
 
24
     * Renders out the contents.
 
25
     *
 
26
     * @access public
 
27
     *
 
28
     * @param optional array $params  Any parameters the Viewer may need.
 
29
     *
 
30
     * @return string  The rendered contents.
 
31
     */
 
32
    function render($params = array())
 
33
    {
 
34
        return $this->lineNumber(trim(str_replace(array("\n", '<br />'), array('', "\n"),
 
35
                                                  highlight_string($this->mime_part->getContents(), true))));
 
36
    }
 
37
 
 
38
}