/** * get url to file from the current theme * * Used to access files from a theme. Example: * * echo '<img src="'. getThemeFile("/img/prio_{$obj->prio}.png") . '">'; * * * - if file does not exists, returns path to default theme * - if file does not exists there a warning is been triggered */ function getThemeFile($filepath) { $theme = getCurTheme(); $path = "themes/" . getCurTheme() . "/" . $filepath; if (file_exists($path)) { return $path; } ### @@@pixtur:2006-10-11 using clean is not very good. Better would be default theme. $path = "themes/clean/" . $filepath; if (file_exists($path)) { return $path; } else { trigger_error("unknown theme file '" . $filepath . "'", E_USER_WARNING); return ""; } }
/** * render and return a table with the measured ids */ function render_measures() { global $measure_times; global $measure_counts; global $time_total; measure_stop('time_complete'); $buffer = '<table>'; foreach ($measure_times as $key => $time) { $width = round($time / $time_total * 100, 0) . "px"; $time_ms = round($time * 1000, 0); $buffer .= "<tr>"; $buffer .= "<td>{$key} </td>" . "<td>{$time_ms}</td>" . '<td><img src="themes/' . getCurTheme() . '/img/pixel.gif" style="height:3px;width:' . $width . '; background-color:#f00;"></td>'; $buffer .= "</tr>"; } $buffer .= '</table>'; return $buffer; }