diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-05-08 17:23:36 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-05-08 17:23:36 +0200 |
commit | 0854d91fd2848266ec37a37c8a1ccfd13a8a4eda (patch) | |
tree | 1433f1db86920fae6e6286c6cc517ba64cda2aba /system/helpers/html_helper.php | |
parent | 0cb8c59f91567af9aa6530f8764abafe1ae935c0 (diff) | |
parent | 3ef65bd7491f847fecdab1acc9687f0e90eee09b (diff) |
Merged tip.
Diffstat (limited to 'system/helpers/html_helper.php')
-rw-r--r-- | system/helpers/html_helper.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index c6103ab6f..bd66bc2d0 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -1,4 +1,4 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * @@ -30,7 +30,7 @@ /** * Heading * - * Generates an HTML heading tag. First param is the data. + * Generates an HTML heading tag. First param is the data. * Second param is the size of the heading tag. * * @access public @@ -40,9 +40,10 @@ */ if ( ! function_exists('heading')) { - function heading($data = '', $h = '1') + function heading($data = '', $h = '1', $attributes = '') { - return "<h".$h.">".$data."</h".$h.">"; + $attributes = ($attributes != '') ? ' '.$attributes : $attributes; + return "<h".$h.$attributes.">".$data."</h".$h.">"; } } @@ -113,7 +114,7 @@ if ( ! function_exists('_list')) // Set the indentation based on the depth $out = str_repeat(" ", $depth); - // Were any attributes submitted? If so generate a string + // Were any attributes submitted? If so generate a string if (is_array($attributes)) { $atts = ''; @@ -127,7 +128,7 @@ if ( ! function_exists('_list')) // Write the opening list tag $out .= "<".$type.$attributes.">\n"; - // Cycle through the list elements. If an array is + // Cycle through the list elements. If an array is // encountered we will recursively call _list() static $_last_list_item = ''; @@ -243,7 +244,7 @@ if ( ! function_exists('img')) * Generates a page document type declaration * * Valid options are xhtml-11, xhtml-strict, xhtml-trans, xhtml-frame, - * html4-strict, html4-trans, and html4-frame. Values are saved in the + * html4-strict, html4-trans, and html4-frame. Values are saved in the * doctypes config file. * * @access public @@ -258,13 +259,13 @@ if ( ! function_exists('doctype')) if ( ! is_array($_doctypes)) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php'); } - elseif (is_file(APPPATH.'config/doctypes'.EXT)) + elseif (is_file(APPPATH.'config/doctypes.php')) { - include(APPPATH.'config/doctypes'.EXT); + include(APPPATH.'config/doctypes.php'); } if ( ! is_array($_doctypes)) |