diff --git a/helper/tablewiz.php b/helper/tablewiz.php index 900507f..532eb0e 100644 --- a/helper/tablewiz.php +++ b/helper/tablewiz.php @@ -6,8 +6,18 @@ * @brief TableWiz helper */ +if(!function_exists("tablewiz_cut_str")) { + function tablewiz_cut_str($str, $strlimit=0) { + if($strlimit > 0) { + $str = substr($str, 0, $strlimit); + } + + return $str; + } +} + if(!function_exists("tablewiz_create")) { - function tablewiz_create($rows, $bind=array(), $domid="", $domclass="", $thead_html=array(), $tbody_html_list=array()) { + function tablewiz_create($rows, $bind=array(), $domid="", $domclass="", $strlimit=20, $thead_html=array(), $tbody_html_list=array()) { $html = ""; if(count($rows) == 0) { @@ -21,19 +31,19 @@ if(!function_exists("tablewiz_create")) { $html_th_elms = ""; foreach($rows[0] as $k=>$v) { $html_th_text = array_key_empty($k, $bind) ? $k : $bind[$k]; - $html_th_elms .= "