Changeset 2549 for trunk/phpgwapi/inc/class.common.inc.php
- Timestamp:
- 04/15/10 15:26:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/inc/class.common.inc.php
r2547 r2549 368 368 define('PHPGW_FINAL',True); 369 369 370 $module_content = ob_get_contents( ); 371 372 ob_clean( ); 373 374 /*************************************************************************\ 375 * Load the header unless the developer turns it off * 376 \*************************************************************************/ 377 if ( array_key_exists( 'HTTP_BACKGROUNDREQUEST', $_SERVER ) || array_key_exists( 'BackgroundRequest', $_GET ) ) 378 $GLOBALS['phpgw_info']['flags'] = array_merge( $GLOBALS['phpgw_info']['flags'], array( 379 'noheader' => true, 380 'nonavbar' => true 381 ) ); 382 383 if ( ! @$GLOBALS['phpgw_info']['flags']['noheader'] ) 384 { 385 if ( ! isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] ) ) 386 $GLOBALS['phpgw_info']['flags']['java_script_thirst'] = ''; 387 388 $GLOBALS['phpgw_info']['flags']['java_script_thirst'] .= '<script type="text/javascript">var URL_SERVER = "' 389 . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] . '";' 390 . 'var template = "' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] . '";</script>'; 391 392 $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'wz_dragdrop', 'wz_dragdrop', NULL, true ); 393 $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'expressoAjax', 'expressoAjax', NULL, true ); 394 $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xlink', NULL, true ); 395 $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xconnector', NULL, true ); 396 $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xevent', NULL, true ); 397 398 $this -> phpgw_header( ); 399 } 400 else 401 echo $this -> get_java_script( ); 402 403 echo $module_content; 404 370 405 /*if (is_object($GLOBALS['phpgw']->accounts)) 371 406 { 372 407 $GLOBALS['phpgw']->accounts->save_session_cache(); 373 408 }*/ 409 374 410 // call the asyncservice check_run function if it is not explicitly set to cron-only 375 411 // … … 378 414 ExecMethod('phpgwapi.asyncservice.check_run','fallback'); 379 415 } 416 380 417 /* Clean up mcrypt */ 381 418 if (@is_object($GLOBALS['phpgw']->crypto)) … … 384 421 unset($GLOBALS['phpgw']->crypto); 385 422 } 423 386 424 $GLOBALS['phpgw']->db->disconnect(); 387 425 } … … 1213 1251 // add a content-type header to overwrite an existing default charset in apache (AddDefaultCharset directiv) 1214 1252 header('Content-type: text/html; charset='.$GLOBALS['phpgw']->translation->charset()); 1215 include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] 1216 . '/head.inc.php'); 1253 1254 include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/head.inc.php'); 1255 1217 1256 $this->navbar(False); 1218 include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] 1219 . '/navbar.inc.php'); 1220 1221 if(!@is_object($GLOBALS['phpgw']->js)) 1222 { 1223 $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); 1224 } 1225 1226 $GLOBALS['phpgw']->js->validate_file( 'tools','xevent' ); 1227 $GLOBALS['phpgw']->js->validate_file( 'tools','xconnector' ); 1228 $GLOBALS['phpgw']->js->validate_file( 'tools','xlink' ); 1229 1230 $GLOBALS['phpgw']->js->validate_file('expressoAjax','expressoAjax'); 1231 1232 $GLOBALS['phpgw']->js->validate_file('wz_dragdrop','wz_dragdrop'); 1233 1234 echo "\n<script type='text/javascript'>var URL_SERVER = '".$GLOBALS['phpgw_info']['server']['webserver_url']."';</script>\n"; 1235 echo $GLOBALS['phpgw']->js->get_script_links(); 1236 1237 $GLOBALS['phpgw']->js->unset_script_link( 'phpgwapi','tools' ); 1238 1239 $GLOBALS['phpgw']->js->unset_script_link('phpgwapi','expressoAjax'); 1240 1241 // TODO 1242 // Esse javascript será carregado sempre pois causa grandes 1243 // problemas em diversos módulos. Algum dia será substituido. 1244 $GLOBALS['phpgw']->js->unset_script_link('phpgwapi','wz_dragdrop'); 1257 1258 include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/navbar.inc.php'); 1245 1259 1246 1260 if (!@$GLOBALS['phpgw_info']['flags']['nonavbar'] && !@$GLOBALS['phpgw_info']['flags']['navbar_target']) 1247 {1248 1261 echo parse_navbar(); 1249 }1250 1262 } 1251 1263 … … 1343 1355 * @return string the javascript to be included 1344 1356 */ 1345 function get_java_script( )1357 function get_java_script( ) 1346 1358 { 1347 1359 $java_script = ''; … … 1349 1361 /* this flag is for all javascript code that has to be put before other jscode. 1350 1362 Think of conf vars etc... (pim@lingewoud.nl) */ 1351 if (isset($GLOBALS['phpgw_info']['flags']['java_script_thirst'])) 1352 { 1353 $java_script .= $GLOBALS['phpgw_info']['flags']['java_script_thirst'] . "\n"; 1354 } 1355 1356 if(@is_object($GLOBALS['phpgw']->js)) 1357 { 1358 $java_script .= $GLOBALS['phpgw']->js->get_script_links(); 1359 } 1363 if ( isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] ) ) 1364 $java_script .= $GLOBALS['phpgw_info']['flags']['java_script_thirst']; 1365 1366 if( is_object( $GLOBALS[ 'phpgw' ] -> js ) ) 1367 $java_script .= $GLOBALS[ 'phpgw' ] -> js -> get_script_links( ); 1360 1368 1361 1369 if(@isset($_GET['menuaction'])) … … 1368 1376 } 1369 1377 } 1370 if (isset($GLOBALS['phpgw_info']['flags']['java_script'])) 1371 {1372 $java_script .= $GLOBALS[ 'phpgw_info']['flags']['java_script'] . "\n";1373 } 1378 1379 if ( isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] ) ) 1380 $java_script .= $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ]; 1381 1374 1382 return $java_script; 1375 1383 }
Note: See TracChangeset
for help on using the changeset viewer.