b2evolution PHP Cross Reference Blogging Systems

Source: /plugins/code_highlight_plugin/highlighters/code.highlighter.php - 90 lines - 2465 bytes - Summary - Text - Print

Description: This file is part of the AstonishMe Code plugin. This file is part of the b2evolution project - {@link http://b2evolution.net/}

   1  <?php
   2  /**
   3   * This file is part of the AstonishMe Code plugin.
   4   *
   5   * This file is part of the b2evolution project - {@link http://b2evolution.net/}
   6   *
   7   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   8   * Parts of this file are copyright (c)2005-2007 by Yabba/Scott - {@link http://astonishme.co.uk/contact/}.
   9   *
  10   * {@internal License choice
  11   * - If you have received this file as part of a package, please find the license.txt file in
  12   *   the same folder or the closest folder above for complete license terms.
  13   * - If you have received this file individually (e-g: from http://cvs.sourceforge.net/viewcvs.py/evocms/)
  14   *   then you must choose one of the following licenses before using the file:
  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17   * }}
  18   *
  19   * {@internal Open Source relicensing agreement:
  20   * Yabba/Scott grant Francois PLANQUE the right to license
  21   * Yabba's/Scott's contributions to this file and the b2evolution project
  22   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  23   * }}
  24   *
  25   * @package plugins
  26   *
  27   * @author Yabba: Paul Jones - {@link http://astonishme.co.uk/}
  28   * @author Stk: Scott Kimler - {@link http://astonishme.co.uk/}
  29   *
  30   */
  31  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  32  
  33  /**
  34   * @package plugins
  35   */
  36  class am_code_highlighter
  37  {
  38      /**
  39       * Text name of language for display
  40       *
  41       * This is unused whilst "Experimental" as it requires a modification of the plugin
  42       * it would be used to replace the text output above the codeblock instead of ucfirst( language )
  43       *
  44       */
  45      var $language_title = 'Code';
  46  
  47  
  48      /**
  49       * Name of language that was desired by user
  50       * This can be used to make geshi simpler to implement
  51       *
  52       */
  53      var $requested_language;
  54  
  55  
  56      /**
  57       * Boolean are we in strict mode ?
  58       *
  59       */
  60      var $strict_mode = false;
  61  
  62  
  63      /**
  64       * Called automatically on class innit
  65       *
  66       * @param object $parent
  67       * @return object am_code_highlighter
  68       */
  69  	function am_code_highlighter( & $parent )
  70      {
  71          $this->parent = & $parent;
  72          return $this;
  73      }
  74  
  75  
  76      /**
  77       * Highlights code ready for displaying
  78       *
  79       * @param string $block - the code
  80       * @return string highlighted code
  81       */
  82  
  83  	function highlight_code( $block )
  84      {
  85          return $this->parent->tidy_code_output( '<span class="amc_default">'.$block.'</span>' );
  86      }
  87  
  88  }
  89  
  90  ?>

title

Description

title

Description

title

Description

title

title

Body