From 5c1aa631c5f5ec2f6b75ba1158178418e50ba11a Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 25 Dec 2011 01:24:29 -0600 Subject: Abstracting the loading of files in the config directory depending on environments. --- system/helpers/html_helper.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'system/helpers/html_helper.php') diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index b6bb402a8..fa805f14f 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -275,14 +275,7 @@ if ( ! function_exists('doctype')) if ( ! is_array($_doctypes)) { - 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'); - } + load_environ_config('doctypes'); if ( ! is_array($_doctypes)) { -- cgit v1.2.3-24-g4f1b From d96f88277c1e9a4c069c2e2ee3d779385549f31a Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 27 Dec 2011 16:23:47 -0600 Subject: Revert "Abstracting the loading of files in the config directory depending on environments." This reverts commit 5c1aa631c5f5ec2f6b75ba1158178418e50ba11a. --- system/helpers/html_helper.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'system/helpers/html_helper.php') diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index fa805f14f..b6bb402a8 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -275,7 +275,14 @@ if ( ! function_exists('doctype')) if ( ! is_array($_doctypes)) { - load_environ_config('doctypes'); + 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)) { -- cgit v1.2.3-24-g4f1b From 0defe5d33ee2633f377a109519ca818becc60f64 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 1 Jan 2012 18:46:41 -0600 Subject: Updating copyright date to 2012 --- system/helpers/html_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/html_helper.php') diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index b6bb402a8..2a603a607 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 1e6b72cca80354619cf7ddceb2b5f23d37b972e9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 6 Jan 2012 19:09:22 +0200 Subject: Improve html, inflector & language helpers --- system/helpers/html_helper.php | 70 +++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 46 deletions(-) (limited to 'system/helpers/html_helper.php') diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index 2a603a607..72970d9ca 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -1,13 +1,13 @@ -".$data.""; + return ''.$data.''; } } @@ -124,7 +123,7 @@ if ( ! function_exists('_list')) } // Set the indentation based on the depth - $out = str_repeat(" ", $depth); + $out = str_repeat(' ', $depth); // Were any attributes submitted? If so generate a string if (is_array($attributes)) @@ -142,7 +141,7 @@ if ( ! function_exists('_list')) } // Write the opening list tag - $out .= "<".$type.$attributes.">\n"; + $out .= '<'.$type.$attributes.">\n"; // Cycle through the list elements. If an array is // encountered we will recursively call _list() @@ -152,8 +151,7 @@ if ( ! function_exists('_list')) { $_last_list_item = $key; - $out .= str_repeat(" ", $depth + 2); - $out .= "
  • "; + $out .= str_repeat(' ', $depth + 2).'
  • '; if ( ! is_array($val)) { @@ -161,21 +159,14 @@ if ( ! function_exists('_list')) } else { - $out .= $_last_list_item."\n"; - $out .= _list($type, $val, '', $depth + 4); - $out .= str_repeat(" ", $depth + 2); + $out .= $_last_list_item."\n"._list($type, $val, '', $depth + 4).str_repeat(' ', $depth + 2); } $out .= "
  • \n"; } - // Set the indentation for the closing tag - $out .= str_repeat(" ", $depth); - - // Write the closing list tag - $out .= "\n"; - - return $out; + // Set the indentation for the closing tag and apply it + return $out.str_repeat(' ', $depth).'\n"; } } @@ -192,7 +183,7 @@ if ( ! function_exists('br')) { function br($num = 1) { - return str_repeat("
    ", $num); + return str_repeat('
    ', $num); } } @@ -224,10 +215,9 @@ if ( ! function_exists('img')) $img = '$v) + foreach ($src as $k => $v) { - - if ($k == 'src' AND strpos($v, '://') === FALSE) + if ($k === 'src' AND strpos($v, '://') === FALSE) { $CI =& get_instance(); @@ -246,9 +236,7 @@ if ( ! function_exists('img')) } } - $img .= '/>'; - - return $img; + return $img.'/>'; } } @@ -290,14 +278,7 @@ if ( ! function_exists('doctype')) } } - if (isset($_doctypes[$type])) - { - return $_doctypes[$type]; - } - else - { - return FALSE; - } + return (isset($_doctypes[$type])) ? $_doctypes[$type] : FALSE; } } @@ -322,14 +303,13 @@ if ( ! function_exists('link_tag')) function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE) { $CI =& get_instance(); - $link = '$v) + foreach ($href as $k => $v) { - if ($k == 'href' AND strpos($v, '://') === FALSE) + if ($k === 'href' AND strpos($v, '://') === FALSE) { if ($index_page === TRUE) { @@ -346,11 +326,11 @@ if ( ! function_exists('link_tag')) } } - $link .= "/>"; + $link .= '/>'; } else { - if ( strpos($href, '://') !== FALSE) + if (strpos($href, '://') !== FALSE) { $link .= 'href="'.$href.'" '; } @@ -365,21 +345,20 @@ if ( ! function_exists('link_tag')) $link .= 'rel="'.$rel.'" type="'.$type.'" '; - if ($media != '') + if ($media != '') { $link .= 'media="'.$media.'" '; } - if ($title != '') + if ($title != '') { $link .= 'title="'.$title.'" '; } $link .= '/>'; } - $link .= "\n"; - return $link; + return $link."\n"; } } @@ -439,10 +418,9 @@ if ( ! function_exists('nbs')) { function nbs($num = 1) { - return str_repeat(" ", $num); + return str_repeat(' ', $num); } } - /* End of file html_helper.php */ -/* Location: ./system/helpers/html_helper.php */ \ No newline at end of file +/* Location: ./system/helpers/html_helper.php */ -- cgit v1.2.3-24-g4f1b