*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008, EllisLab, Inc.
+ * @copyright Copyright (c) 2008 - 2009, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @param string
* @param integer
* @return string
- */
+ */
if ( ! function_exists('heading'))
{
function heading($data = '', $h = '1')
* @param array
* @param mixed
* @return string
- */
+ */
if ( ! function_exists('ul'))
{
function ul($list, $attributes = '')
* @param array
* @param mixed
* @return string
- */
+ */
if ( ! function_exists('ol'))
{
function ol($list, $attributes = '')
*
* @access private
* @param string
- * @param mixed
- * @param mixed
- * @param intiger
+ * @param mixed
+ * @param mixed
+ * @param intiger
* @return string
- */
+ */
if ( ! function_exists('_list'))
{
function _list($type = 'ul', $list, $attributes = '', $depth = 0)
{
return $list;
}
-
+
// Set the indentation based on the depth
$out = str_repeat(" ", $depth);
-
+
// Were any attributes submitted? If so generate a string
if (is_array($attributes))
{
}
$attributes = $atts;
}
-
+
// 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 = '';
foreach ($list as $key => $val)
- {
+ {
$_last_list_item = $key;
$out .= str_repeat(" ", $depth + 2);
$out .= "<li>";
-
+
if ( ! is_array($val))
{
$out .= $val;
$out .= str_repeat(" ", $depth + 2);
}
- $out .= "</li>\n";
+ $out .= "</li>\n";
}
// Set the indentation for the closing tag
$out .= str_repeat(" ", $depth);
-
+
// Write the closing list tag
$out .= "</".$type.">\n";
return $out;
}
}
-
+
// ------------------------------------------------------------------------
/**
* @access public
* @param integer
* @return string
- */
+ */
if ( ! function_exists('br'))
{
function br($num = 1)
return str_repeat("<br />", $num);
}
}
-
+
// ------------------------------------------------------------------------
/**
* @access public
* @param mixed
* @return string
- */
+ */
if ( ! function_exists('img'))
{
function img($src = '', $index_page = FALSE)
}
$img = '<img';
-
+
foreach ($src as $k=>$v)
{
// ------------------------------------------------------------------------
+/**
+ * Doctype
+ *
+ * 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
+ * doctypes config file.
+ *
+ * @access public
+ * @param string type The doctype to be generated
+ * @return string
+ */
+if ( ! function_exists('doctype'))
+{
+ function doctype($type = 'xhtml1-strict')
+ {
+ global $_doctypes;
+
+ if ( ! is_array($_doctypes))
+ {
+ if ( ! require_once(APPPATH.'config/doctypes.php'))
+ {
+ return FALSE;
+ }
+ }
+
+ if (isset($_doctypes[$type]))
+ {
+ return $_doctypes[$type];
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
/**
* Link
*
* @param string type
* @param string title
* @param string media
- * @param boolean should index_page be added to the css path
+ * @param boolean should index_page be added to the css path
* @return string
- */
+ */
if ( ! function_exists('link_tag'))
{
function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
$link .= "$k=\"$v\" ";
}
}
-
+
$link .= "/>";
}
else
{
$link .= ' href="'.$CI->config->slash_item('base_url').$href.'" ';
}
-
+
$link .= 'rel="'.$rel.'" type="'.$type.'" ';
-
+
if ($media != '')
{
$link .= 'media="'.$media.'" ';
{
$link .= 'title="'.$title.'" ';
}
-
+
$link .= '/>';
}
-
+
return $link;
}
}
* @access public
* @param array
* @return string
- */
+ */
if ( ! function_exists('meta'))
{
function meta($name = '', $content = '', $type = 'name', $newline = "\n")
$name = array($name);
}
}
-
+
$str = '';
foreach ($name as $meta)
{
$name = ( ! isset($meta['name'])) ? '' : $meta['name'];
$content = ( ! isset($meta['content'])) ? '' : $meta['content'];
$newline = ( ! isset($meta['newline'])) ? "\n" : $meta['newline'];
-
+
$str .= '<meta '.$type.'="'.$name.'" content="'.$content.'" />'.$newline;
}
* @access public
* @param integer
* @return string
- */
+ */
if ( ! function_exists('nbs'))
{
function nbs($num = 1)