From a28c62f3e9d402d100ad25014857d129c0915528 Mon Sep 17 00:00:00 2001 From: phamt Date: Thu, 14 Apr 2011 15:02:06 +0000 Subject: [PATCH] Put in example on how to format an output string during flush. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9313 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/lib/functions.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/xCAT-UI/lib/functions.php b/xCAT-UI/lib/functions.php index a78d82f50..daebaef54 100644 --- a/xCAT-UI/lib/functions.php +++ b/xCAT-UI/lib/functions.php @@ -105,8 +105,13 @@ function submit_request($req, $skipVerify, $opts_array){ // Strip HTML tags from output if ($tmp = trim(strip_tags($str))) { // Format the output based on what was given for $flush_format - echo $tmp . '
'; - flush(); + if ($flush_format == "TDB") { + format_TBD($tmp); + } else { + // Print out output by default + echo $tmp . '
'; + flush(); + } } } } @@ -298,4 +303,16 @@ function logout() { $_SESSION=array(); session_destroy(); } + +/** + * Format a given string and echo it back to the browser + * + * @param $str String + * @return Nothing + */ +function format_TBD($str) { + // Format a given string however you want it + echo $tmp . '
'; + flush(); +} ?>