'; $messageblock_headers[$i++] = "\t\t\t\t".''; $messageblock_headers[$i++] = "\t\t\t".''; /* Prepare the file block HTML template Variables: [file_id]: replaced by the id of the file (1, 2, ...), [filenumber_display]: display:none if single file upload, otherwise empty, [fileheader_color], [fileheader_bgcolor], [fileheader_borcolor], [fileheader_message]: replaced by the returned values, [filesubheadermessage_display]: display:none if there is no message, otherwise empty, [filesubheader_message]: replaced by the returned value, [filesubheaderadminmessage_display]: display:none if there is no admin message, otherwise empty, [filesubheader_adminmessage]: replaced by the returned value */ /* Prepare the files header block HTML template */ $i = 1; $file_count = ( $test ? 2 : 1); for ($ii = 1; $ii <= $file_count; $ii++) { if ( $test ) { $file_props = wfu_prepare_message_colors(WFU_TESTMESSAGECOLORS); $file_id = $ii; $filenumber_display = ""; $fileheader_color = $file_props['color']; $fileheader_bgcolor = $file_props['bgcolor']; $fileheader_borcolor = $file_props['borcolor']; $fileheader_message = constant('WFU_TESTMESSAGE_FILE'.$ii.'_HEADER'); $filesubheadermessage_display = ""; $filesubheader_message = constant('WFU_TESTMESSAGE_FILE'.$ii.'_MESSAGE'); $filesubheaderadminmessage_display = ""; $filesubheader_adminmessage = constant('WFU_TESTMESSAGE_FILE'.$ii.'_ADMINMESSAGE'); } else { $file_id = '[file_id]'; $filenumber_display = '[filenumber_display]'; $fileheader_color = '[fileheader_color]'; $fileheader_bgcolor = '[fileheader_bgcolor]'; $fileheader_borcolor = '[fileheader_borcolor]'; $fileheader_message = '[fileheader_message]'; $filesubheadermessage_display = '[filesubheadermessage_display]'; $filesubheader_message = '[filesubheader_message]'; $filesubheaderadminmessage_display = '[filesubheaderadminmessage_display]'; $filesubheader_adminmessage = '[filesubheader_adminmessage]'; } $messageblock_file[$i++] = "\t".'
'; /* Prepare the files subheader block HTML template */ $messageblock_file[$i++] = "\t".' '; } /* Construct the main header block HTML text /* Construct the header block HTML text */ $i = 1; $messageblock["msgblock"]["line".$i++] = ' '; /* Construct a div element that will hold the State10 header and use it in case JSON parse fails and upload results cannot be decoded */ $messageblock["msgblock"]["line".$i++] = ' '; /* Construct header HTML text for all upload states and save it to hidden input, to be used later on by Javascript to adjust the upload state dynamically */ $messageblock_header_template = ""; foreach ( $messageblock_headers as $messageblock_header_part ) $messageblock_header_template .= $dlp.$messageblock_header_part; foreach ($ExposedStateIndex as $ii) $messageblock["header"]["State".$ii] = strtr($messageblock_header_template, array( "[header_safe]" => "", "[header_color]" => $header_styles["State".$ii]["color"], "[header_bgcolor]" => $header_styles["State".$ii]["bgcolor"], "[header_borcolor]" => $header_styles["State".$ii]["borcolor"], "[header_message]" => $header_styles["State".$ii]["message"] )); $messageblock_header_str = wfu_encode_array_to_string($messageblock["header"]); $messageblock["msgblock"]["line".$i++] = ''; /* Construct file HTML block template and save it to hidden div to be used later on by Javascript to add file results to the upload message dynamically */ $messageblock_file_str = ""; foreach ( $messageblock_file as $messageblock_file_part ) $messageblock_file_str .= $dlp.$messageblock_file_part; $messageblock_file_str = wfu_plugin_encode_string($messageblock_file_str); $messageblock["msgblock"]["line".$i++] = ''; $messageblock["msgblock"]["line".$i++] = ''; return $messageblock; } function wfu_prepare_message_colors($template) { $color_array = explode(",", $template); $colors['color'] = $color_array[0]; $colors['bgcolor'] = $color_array[1]; $colors['borcolor'] = $color_array[2]; return $colors; } ?>