2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 class Admin_Print_Class
15 function redirect($location, $timeout = 10)
17 $timeout = $timeout * 200;
21 <script type
="text/javascript">
23 var timeout
= $timeout;
27 setTimeout("redirect()", $timeout);
36 window
.location
= "$location";
42 $this->page_start(phrase('redirect'), ':default:', 15, $js);
44 $this->page_message(phrase('redirect'), phrase('wait_to_be_redirected', $location));
49 function error($message)
51 $this->page_start(phrase('error'));
52 $this->page_message(phrase('Error'), $message);
58 // ###################################################################
59 // ########################### PAGE CONTROL ##########################
60 // ###################################################################
61 function page_start($actiontitle, $pageclass = ':default:', $pagemargin = 15, $extra = '', $onload = false
, $margin = 0, $dotpath = '.')
63 $title = 'BugStrike - ' . phrase('administration_x', $actiontitle);
65 echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
66 echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>";
67 echo "\n\t<title>$title</title>";
68 echo "\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />";
69 echo "\n\t<link rel=\"stylesheet\" href=\"$dotpath/admin.css\" />" . (($extra) ?
"\n$extra" : '');
70 echo "\n</head>\n<body style=\"margin: {$margin}px;\"" . (($pageclass !== ':default:') ?
" class=\"$pageclass\"" : '') . (($onload) ?
" onload=\"$onload\"" : '') . ">\n";
72 if (!defined('HIDE_SETUP'))
76 echo "<div class=\"thead\">\n";
77 echo "\n\t<form action=\"jump.php\" method=\"post\" title=\"navigation\" style=\"display: inline\">";
79 foreach ($globalnav AS $grouptitle => $links)
81 echo "\n\t\t<select name=\"jump[$grouptitle]\">";
82 foreach ($links AS $title => $url)
84 echo "\n\t\t\t<option value=\"$url\">$title</option>";
86 echo "\n\t\t</select>";
92 echo "<div style=\"margin: {$pagemargin}px;\">\n<!-- / page head -->\n\n";
95 function page_code($code)
100 function page_message($title, $message)
102 $this->table_start(true
, '75%');
103 $this->table_head($title, 1);
104 $this->row_span("<blockquote>$message</blockquote>", ':swap:', 'left', 1);
108 function page_confirm($message, $location)
110 $this->page_start(phrase('confirm'));
112 $this->page_message(phrase('confirm'), $message . '<p><input type="button" name="confirm" value=" ' . phrase('yes') . ' " onclick="window.location = \'' . $location . '\';" />');
121 $copyright = "\n<br />\n<p align=\"center\" class=\"copyright\">\n\t<a href=\"http://www.iris-studios.com\" target=\"_blank\">BugStrike " . $bugsys->options
['trackerversion'] . ", © 2002 - " . date('Y') . " Iris Studios, Inc.</a>\n</p>";
123 if (!defined('HIDE_SETUP'))
125 echo "\n<!-- page end -->\n</div>\n$copyright";
129 echo "\n<!-- page end -->\n</div>";
132 echo "\n\n</body>\n</html>";
137 // ###################################################################
138 // ##################### TABLE SKELETON RENDERING ####################
139 // ###################################################################
140 function table_start($break = true
, $width = '90%')
147 echo "\n<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"$width\" class=\"tborder\">\n";
150 function table_head($title, $colspan = 2, $strong = true
)
152 echo "<tr>\n\t<td class=\"tcat\" align=\"center\" colspan=\"$colspan\">" . (($strong) ?
"<strong>$title</strong>" : $title) . "</td>\n</tr>\n";
155 function table_column_head($columnarray)
157 if (is_array($columnarray))
159 $render = "<tr valign=\"top\" align=\"center\">\n";
161 foreach ($columnarray AS $header)
163 $render .= "\t<td class=\"thead\" align=\"center\">$header</td>\n";
166 $render .= "</tr>\n";
177 // ###################################################################
178 // ########################## FORM CREATION ##########################
179 // ###################################################################
180 function form_start($action, $do, $enctype = false
, $name = 'inputform', $submitmethod = 'post')
182 echo "\n<!-- input form -->\n<form name=\"$name\" action=\"$action\"" . (($enctype) ?
" enctype=\"$enctype\"" : '') . " method=\"$submitmethod\">\n";
183 $this->form_hidden_field('do', $do);
186 function form_hidden_field($name, $value)
188 echo "<input type=\"hidden\" name=\"$name\" value=\"$value\" />\n";
193 echo "</form>\n<!-- / input form -->\n";
196 // ###################################################################
197 // ####################### TABLE ROW RENDERING #######################
198 // ###################################################################
199 function row_span($text, $class = ':swap:', $align = 'left', $colspan = 2)
202 if ($class === ':swap:')
204 $bugsys->funct
->exec_swap_bg();
205 $row_class = $bugsys->funct
->bgcolour
;
206 $is_style_element = false
;
210 if (preg_match('#:style:(.*?)#i', $class))
212 $is_style_element = true
;
213 $style = str_replace(':style:', '', $class);
218 $is_style_element = false
;
222 echo "<tr>\n\t<td ". (($is_style_element) ?
"style=\"$style\"" : "class=\"$row_class\"") . " colspan=\"$colspan\" align=\"$align\">$text</td>\n</tr>";
225 function row_multi_item($row_array)
228 $bugsys->funct
->exec_swap_bg();
230 foreach ($row_array AS $item => $align)
232 $row_data["$align"][] = $item;
235 echo "<tr valign=\"top\">";
237 foreach ($row_data AS $align_key => $item_array)
239 if ($align_key == 'c')
243 else if ($align_key == 'l')
247 else if ($align_key == 'r')
252 foreach ($item_array AS $value)
254 echo "\n\t<td class=\"{$bugsys->funct->bgcolour}\" align=\"$align\">$value</td>";
261 function row_text($label, $value = ' ', $valign = 'top', $colspan = 2, $class = -1)
263 global $bugsys, $IS_SETTINGS;
269 $bugsys->funct
->exec_swap_bg();
270 $row_class = $bugsys->funct
->bgcolour
;
282 echo "<tr valign=\"$valign\">";
283 echo "\n\t<td class=\"$row_class\">$label</td>";
284 echo "\n\t<td class=\"$row_class\">$value</td>";
288 echo "\n\t<td class=\"$row_class\" colspan=\"" . $colspan - 2 . "\"> </td>";
294 function row_input($label, $name, $value = '', $colspan = 2, $size = 35, $length = false
, $password = false
, $lalign = 'top')
296 $this->row_text($label, "<input type=\"" . (($password) ?
'password' : 'text') . "\" class=\"input\" name=\"$name\" value=\"$value\" size=\"$size\" " . (($length) ?
"maxlength=\"$length\" " : '') . "/>", $lalign, $colspan);
299 function row_textarea($label, $name, $value = '', $colspan = 2, $rows = 7, $cols = 50, $code = false
, $style = '')
301 $this->row_text($label, "<textarea name=\"$name\" class=\"" . (($code) ?
'code' : 'input') . "\" rows=\"$rows\" cols=\"$cols\"" . (($style) ?
' style="' . $style . '"' : '') . ">$value</textarea>", 'top', $colspan);
304 function row_tfoot($data, $colspan = 2)
306 echo $this->row_span($data, 'tfoot', 'center');
309 function row_submit($extra = false
, $submit = ':save:', $reset = ':reset:', $colspan = 2)
311 if ($submit === ':save:')
313 $submit = " " . phrase('submit') . " ";
317 $submit = " $submit ";
320 if ($reset === ':reset:')
322 $reset = " " . phrase('reset') . " ";
326 $reset = (($reset) ?
" $reset " : '');
329 $output = "\n\t\t<input type=\"submit\" class=\"button\" value=\"$submit\" accesskey=\"s\" />";
330 $output .= (($reset) ?
"\n\t\t<input type=\"reset\" class=\"button\" value=\"$reset\" accesskey=\"r\" /> $extra\n\t" : '');
331 $this->row_tfoot($output);
334 function row_upload($label, $name, $colspan = 2)
336 $this->row_text($label, "<input type=\"file\" class=\"button\" name=\"$name\" size=\"35\" />", 'top', $colspan);
339 function list_item($name, $value, $selected = false
)
343 $listitem[] = "\n\t<option value=\"$value\"" . (($selected == true
) ?
' selected="selected"' : '') . ">$name</option>";
346 function row_list($label, $name, $is_jump = true
, $colspan = 2)
350 foreach ($listitem AS $option)
352 $optionlist .= $option;
357 $this->row_text($label, "\n<select class=\"button\" name=\"$name\"" . (($is_jump) ?
" onchange=\"this.form.submit();\"" : '') . ">$optionlist\n</select>" . (($is_jump) ?
"\n<input type=\"submit\" class=\"button\" value=\" " . phrase('go') . " \" accesskey=\"g\" />" : '') . "\n", $colspan);
360 function row_yesno($label, $name, $value, $colspan = 2)
362 $this->row_text($label, "<input type=\"radio\" name=\"$name\" value=\"1\"" . (($value) ?
' checked="checked"' : '') . " /> " . phrase('yes') . " <input type=\"radio\" name=\"$name\" value=\"0\"" . ((!$value) ?
' checked="checked"' : '') . " /> " . phrase('no'), $colspan);
366 /*=====================================================================*\
367 || ###################################################################
370 || ###################################################################
371 \*=====================================================================*/