/** * msg_box() * * Display a 'message box like' table * * @param $title * @param $msg_text * @param string $button_text * @param string $button_link * @param string $width * @return **/ function msg_box($title, $msg_text, $button_text = "", $button_link = "", $width = "-1") { if (function_exists('theme_msg_box')) { theme_msg_box($title, $msg_text, $button_text, $button_link, $width); return; } global $template_msg_box; if (!$button_text) { template_extract_block($template_msg_box, 'button'); } $params = array('{MESSAGE}' => $msg_text, '{LINK}' => $button_link, '{TEXT}' => $button_text); starttable($width, $title); echo template_eval($template_msg_box, $params); endtable(); }
/** * msg_box() * * Display a 'message box like' table * * @param $title * @param $msg_text * @param string $button_text * @param string $button_link * @param string $width * @return **/ function msg_box($title, $msg_text, $button_text = '', $button_link = '', $type = 'info') { if ($type == 'error') { $css_class = 'cpg_message_error'; } elseif ($type == 'warning') { $css_class = 'cpg_message_warning'; } elseif ($type == 'validation') { $css_class = 'cpg_message_validation'; } elseif ($type == 'success') { $css_class = 'cpg_message_success'; } else { $css_class = 'cpg_message_info'; } // Call theme function to display message box theme_msg_box($title, $msg_text, $css_class, $button_text, $button_link); }