summaryrefslogtreecommitdiffstats
path: root/system/helpers/html_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/html_helper.php')
-rw-r--r--system/helpers/html_helper.php26
1 files changed, 18 insertions, 8 deletions
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index 68c6f5908..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,7 +259,16 @@ if ( ! function_exists('doctype'))
if ( ! is_array($_doctypes))
{
- if ( ! require_once(APPPATH.'config/doctypes.php'))
+ if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php'))
+ {
+ include(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php');
+ }
+ elseif (is_file(APPPATH.'config/doctypes.php'))
+ {
+ include(APPPATH.'config/doctypes.php');
+ }
+
+ if ( ! is_array($_doctypes))
{
return FALSE;
}