".ucwords($group_name)."
"); - fwrite($h, ''); + $section_data = str_replace(array("%MENU%", "%GROUP_NAME%"), array($menu, ucwords($group_name)), $section_tpl); + + $funcs_data = array(); foreach($group as $func_name => $func) { - fwrite($h, ''); - - fwrite($h, "$func_name
"); + $func_data = str_replace(array("%FUNCTION_NAME%", "%FUNCTION%"), array(get_func($func_name), $func_name), $func_tpl); if(strlen($func["description"][0]) > 0) - fwrite($h, do_markup($func["description"][0]).""); - + $func_data = ereg_replace("%DESCRIPTION_START%.*%DESCRIPTION_END%", + str_replace("%FUNCTION_DESCRIPTION%", do_markup($func["description"][0]), $description_tpl), + $func_data); + else + $func_data = ereg_replace("%DESCRIPTION_START%.*%DESCRIPTION_END%", "", $func_data); + if(isset($func["param"])) { - $params = ""; + $params_data = array(); foreach($func["param"] as $param) { $param = trim($param); $p1 = substr($param, 0, strpos($param, " ")); - $p2 = substr($param, strpos($param, " ")); + $p2 = do_markup(substr($param, strpos($param, " "))); + if(strlen($p1) > 0 && strlen($p2) > 0) - $params .= '
- ');
- fwrite($h, $params);
- fwrite($h, "
'); + $func_data = ereg_replace("%RETURN_START%.*%RETURN_END%", + str_replace("%RETURN%", do_markup($func["return"][0]), $return_tpl), + $func_data); + else + $func_data = ereg_replace("%RETURN_START%.*%RETURN_END%", "", $func_data); if(isset($func["conditions"])) - fwrite($h, 'Conditions: '.$func["conditions"][0].'
'); + $func_data = ereg_replace("%CONDITIONS_START%.*%CONDITIONS_END%", + str_replace("%CONDITIONS%", $func["conditions"][0], $conditions_tpl), + $func_data); + else + $func_data = ereg_replace("%CONDITIONS_START%.*%CONDITIONS_END%", "", $func_data); if(isset($func["see"])) - fwrite($h, 'Also see '.do_see_markup(explode(" ", trim($func["see"][0]))).'
'); - - fwrite($h, 'To top
'); + $func_data = ereg_replace("%SEE_START%.*%SEE_END%", + str_replace("%SEE%", do_see_markup(explode(" ", trim($func["see"][0]))), $see_tpl), + $func_data); + else + $func_data = ereg_replace("%SEE_START%.*%SEE_END%", "", $func_data); + + $funcs_data[] = $func_data; } - fwrite($h, ""); + $section_data = ereg_replace("%FUNCTION_START%.*%FUNCTION_END%", implode("", $funcs_data), $section_data); - fwrite($h, "