19 $color[
'window_title_bg'] =
'#69A6DE';
20 $color[
'window_title_font'] =
'#294157';
21 $color[
'window_tab_active_bg'] =
'#E5E3F0';
22 $color[
'window_tab_inactive_bg'] =
'#FFFFFF';
23 $color[
'window_content_bg'] =
'#F2F2F2';
28 $xajax->registerFunction(
"window_open");
29 $xajax->registerFunction(
"window_submit");
62 if (!$window_name) {
return($response->getXML()); }
69 if ($file) { require_once($file); }
75 <!-- This wrapper table is so that
internal tables can be
set to 100% width and they won
't stretch the box too wide. --> 76 <table id="{$window_name}_table" cellspacing="0" border="0" cellpadding="0"> 80 <!-- Window bar and close button --> 81 <table id="{$window_name}_title_table" class="window_title" style="border-bottom: 1px solid #69A6DE;background-color: {$color['window_title_bg
']};" width="100%" cellspacing="0" border="0" cellpadding="0"> 84 <td id="{$window_name}_title" 88 onMouseDown="focus_window('$window_name
'); dragStart(event, '{$window_name}
');" 93 padding: 2px 4px;">{$window['title
']}</td> 95 <td id="{$window_name}_title_r" 98 style="color: {$color['window_title_font
']}; 101 padding: 2px 4px;"><span id="{$window_name}_title_help"></span> <a title="Close window" style="cursor: pointer;" onClick="removeElement('{$window_name}
');"><img src="{$images}/icon_close.gif" border="0" /></a></td> 107 if (!$window['footer
']) { 108 $window['footer
'] = <<<EOL 115 // Create a new div to display the content in 116 $response->addScript("removeElement('{$window_name}
');"); 117 $response->addCreate("window_container", "div", $window_name); 118 $response->addScript( 119 "initialize_window('{$window_name}
');" . 120 "el('$window_name
').style.display = 'none
';" . 121 "el('$window_name
').style.visibility = 'hidden
';" . 122 "el('$window_name
').onclick = function(ev) { focus_window(this.id); };" 124 $response->addAssign($window_name, "innerHTML", $window['header
'] . $window['html
'] . $window['footer
']); 125 $response->addScript("toggle_window('{$window_name}
');" . $window['js
']); 127 // Send an XML response to the web browser 128 return($response->getXML()); 137 // window_submit ($window_name, [$form_data], [$function]) 140 // Generic wrapper to handle window form submits. 141 // Is typically called when a client pushes a submit-like button in 142 // their web application. 145 // $window_name The name of the "window" submitting data 146 // $form[] An optional array/string containing the (form?) data 148 // This will often be generated by using this javascript 149 // xajax call: xajax.getFormValues('form_id
') 150 // $function The optional name of a PHP function to pass the first two 151 // parameters to. For security reasons, the actual function 152 // called will be "ws_{$function}". 153 // If a function name is not specified, the default is 154 // "ws_{$window_name}_submit" or "ws_submit" 157 function window_submit($window_name, $form='', $function='') { 158 // Instantiate the xajaxResponse object 159 $response = new xajaxResponse(); 160 if (!$window_name or !$form) { return($response->getXML()); } 163 printmsg("DEBUG => webwin_submit() Window: {$window_name} Function: {$function} Form: {$form}", 1); 165 // If a function name wasn't provided, we look
for a
function called:
168 $function =
"{$window_name}_submit";
170 $function =
'ws_' . $function;
173 if (function_exists($function)) {
return($function($window_name, $form)); }
177 if ($file) { require_once($file); }
178 else { $response->addAssign(
"work_space_content",
"innerHTML",
"<br><center><font color=\"red\"><b>Invalid window requested: {$window_name}</b></font></center>"); }
181 if (function_exists($function)) {
return($function($window_name, $form)); }
184 printmsg(
"NOTICE => webwin_submit() invalid function called! Window: {$window_name} Function: {$function}", 0);
185 return($response->getXML());
205 if (!$window_name) {
return(
''); }
211 $directories = array(
'.',
212 './local/plugins/'.$window_name,
214 './plugins/'.$window_name,
229 foreach ($directories as $directory) {
230 if (!file_exists($directory.
'/plugin_disabled')){
231 $file =
"{$directory}/{$window_name}.inc.php";
232 if (is_file($file)) {
239 if (is_file(
'.'.$window_name)) {
240 return(
'.'.$window_name);