From 5ed8bf334fa9714db3cb71cd3ec3bfcb6f5e4c98 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 29 Oct 2006 17:44:54 +0000 Subject: --- system/helpers/list_helper.php | 132 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 system/helpers/list_helper.php diff --git a/system/helpers/list_helper.php b/system/helpers/list_helper.php new file mode 100644 index 000000000..587a0aa93 --- /dev/null +++ b/system/helpers/list_helper.php @@ -0,0 +1,132 @@ +\n"; + + foreach ($list as $item) + { + if (is_array($item)) + { + $out .= _list($type, $item, '', $depth+4); + } + else + { + $out .= str_repeat(" ", $depth + 2); + + $out .= "
  • ".$item."
  • \n"; + } + } + + $out .= str_repeat(" ", $depth); + + $out .= "\n"; + + return $out; +} + +// ------------------------------------------------------------------------ + +/** + * Generates the attribute string + * + * @access private + * @param mixed + * @return string + */ +function _set_attributes($attributes) +{ + if (is_string($attributes)) + { + return $attributes; + } + + $atts = ''; + foreach ($attributes as $key => $val) + { + $atts .= ' ' . $key . '="' . $val . '"'; + } + + return $atts; +} +?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b