PageRenderTime 635ms CodeModel.GetById 512ms app.highlight 1ms RepoModel.GetById 121ms app.codeStats 0ms

/halogy/helpers/typography_helper.php

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