Take two:
[www-register-wizard.git] / helpers / typography_helper.php
1 <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');\r
2 /**\r
3  * CodeIgniter\r
4  *\r
5  * An open source application development framework for PHP 4.3.2 or newer\r
6  *\r
7  * @package             CodeIgniter\r
8  * @author              ExpressionEngine Dev Team\r
9  * @copyright   Copyright (c) 2008, EllisLab, Inc.\r
10  * @license             http://codeigniter.com/user_guide/license.html\r
11  * @link                http://codeigniter.com\r
12  * @since               Version 1.0\r
13  * @filesource\r
14  */\r
15 \r
16 // ------------------------------------------------------------------------\r
17 \r
18 /**\r
19  * CodeIgniter Typography Helpers\r
20  *\r
21  * @package             CodeIgniter\r
22  * @subpackage  Helpers\r
23  * @category    Helpers\r
24  * @author              ExpressionEngine Dev Team\r
25  * @link                http://codeigniter.com/user_guide/helpers/typography_helper.html\r
26  */\r
27 \r
28 // ------------------------------------------------------------------------\r
29 \r
30 /**\r
31  * Convert newlines to HTML line breaks except within PRE tags\r
32  *\r
33  * @access      public\r
34  * @param       string\r
35  * @return      string\r
36  */     \r
37 if ( ! function_exists('nl2br_except_pre'))\r
38 {\r
39         function nl2br_except_pre($str)\r
40         {\r
41                 $CI =& get_instance();\r
42         \r
43                 $CI->load->library('typography');\r
44                 \r
45                 return $CI->typography->nl2br_except_pre($str);\r
46         }\r
47 }\r
48         \r
49 // ------------------------------------------------------------------------\r
50 \r
51 /**\r
52  * Auto Typography Wrapper Function\r
53  *\r
54  *\r
55  * @access      public\r
56  * @param       string\r
57  * @param       bool    whether to allow javascript event handlers\r
58  * @param       bool    whether to reduce multiple instances of double newlines to two\r
59  * @return      string\r
60  */\r
61 if ( ! function_exists('auto_typography'))\r
62 {\r
63         function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebreaks = FALSE)\r
64         {\r
65                 $CI =& get_instance();  \r
66                 $CI->load->library('typography');\r
67                 return $CI->typography->auto_typography($str, $strip_js_event_handlers, $reduce_linebreaks);\r
68         }\r
69 }\r
70 \r
71 /* End of file typography_helper.php */\r
72 /* Location: ./system/helpers/typography_helper.php */