typography_helper.php

Go to the documentation of this file.
00001 <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
00002 /**
00003  * CodeIgniter
00004  *
00005  * An open source application development framework for PHP 4.3.2 or newer
00006  *
00007  * @package             CodeIgniter
00008  * @author              ExpressionEngine Dev Team
00009  * @copyright   Copyright (c) 2008, EllisLab, Inc.
00010  * @license             http://codeigniter.com/user_guide/license.html
00011  * @link                http://codeigniter.com
00012  * @since               Version 1.0
00013  * @filesource
00014  */
00015 
00016 // ------------------------------------------------------------------------
00017 
00018 /**
00019  * CodeIgniter Typography Helpers
00020  *
00021  * @package             CodeIgniter
00022  * @subpackage  Helpers
00023  * @category    Helpers
00024  * @author              ExpressionEngine Dev Team
00025  * @link                http://codeigniter.com/user_guide/helpers/typography_helper.html
00026  */
00027 
00028 // ------------------------------------------------------------------------
00029 
00030 /**
00031  * Convert newlines to HTML line breaks except within PRE tags
00032  *
00033  * @access      public
00034  * @param       string
00035  * @return      string
00036  */     
00037 if ( ! function_exists('nl2br_except_pre'))
00038 {
00039         function nl2br_except_pre($str)
00040         {
00041                 $CI =& get_instance();
00042         
00043                 $CI->load->library('typography');
00044                 
00045                 return $CI->typography->nl2br_except_pre($str);
00046         }
00047 }
00048         
00049 // ------------------------------------------------------------------------
00050 
00051 /**
00052  * Auto Typography Wrapper Function
00053  *
00054  *
00055  * @access      public
00056  * @param       string
00057  * @param       bool    whether to allow javascript event handlers
00058  * @param       bool    whether to reduce multiple instances of double newlines to two
00059  * @return      string
00060  */
00061 if ( ! function_exists('auto_typography'))
00062 {
00063         function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebreaks = FALSE)
00064         {
00065                 $CI =& get_instance();  
00066                 $CI->load->library('typography');
00067                 return $CI->typography->auto_typography($str, $strip_js_event_handlers, $reduce_linebreaks);
00068         }
00069 }
00070 
00071 /* End of file typography_helper.php */
00072 /* Location: ./system/helpers/typography_helper.php */