Changeset 2549 for trunk/phpgwapi
- Timestamp:
- 04/15/10 15:26:02 (14 years ago)
- Location:
- trunk/phpgwapi/inc
- Files:
-
- 4 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 } -
trunk/phpgwapi/inc/class.javascript.inc.php
r2547 r2549 49 49 * @var array list of validated files to be included in the head section of a page 50 50 */ 51 var $files;51 private $files = array( ); 52 52 53 53 /** … … 153 153 $links .= '<script type="text/javascript" src="' 154 154 . $GLOBALS['phpgw_info']['server']['webserver_url'] 155 . "/$app/js/$pkg/$file" . '.js ">'155 . "/$app/js/$pkg/$file" . '.js?' . microtime( true ) . '">' 156 156 . "</script>\n"; 157 157 } 158 159 $this -> unset_script_link( $app, $pkg, $file ); 158 160 } 159 161 } … … 223 225 * @returns bool was the file found? 224 226 */ 225 function validate_file($package, $file, $app='phpgwapi') 226 { 227 if(is_readable(PHPGW_INCLUDE_ROOT .SEP .$app .SEP .'js' .SEP . $package .SEP. $file . '.js')) 228 { 229 $this->files[$app][$package][$file] = $file; 230 return True; 231 } 232 elseif($app != 'phpgwapi') 233 { 234 if(is_readable(PHPGW_INCLUDE_ROOT .SEP .'phpgwapi' .SEP .'js' .SEP . $package .SEP . $file . '.js')) 235 { 236 $this->files['phpgwapi'][$package][$file] = $file; 237 return True; 238 } 239 return False; 240 } 227 function validate_file( $package, $file, $app = NULL, $stack = false ) 228 { 229 if ( $app == NULL ) 230 $app = 'phpgwapi'; 231 232 $_file = PHPGW_INCLUDE_ROOT . SEP . $app . SEP . 'js' . SEP . $package . SEP. $file . '.js'; 233 if ( is_readable( $_file ) ) 234 { 235 unset( $_file ); 236 237 if ( ! array_key_exists( $app, $this -> files ) ) 238 $this -> files[ $app ] = array( ); 239 240 if ( ! array_key_exists( $package, $this -> files[ $app ] ) ) 241 $this -> files[ $app ][ $package ] = array( ); 242 243 if ( $stack ) 244 $this -> files[ $app ][ $package ] = array_merge( array( $file => $file ), $this -> files[ $app ][ $package ] ); 245 else 246 $this -> files[ $app ][ $package ][ $file ] = $file; 247 248 return true; 249 } 250 return false; 241 251 } 242 252 } -
trunk/phpgwapi/inc/class.preferences.inc.php
r2002 r2549 174 174 foreach($val as $k => $v) 175 175 { 176 if (!is_array($v) && strstr($val,'$$') !== False)176 if (!is_array($v) && is_string( $val ) && strstr($val,'$$') !== False) 177 177 { 178 178 $this->data[$app][$key][$k] = $this->parse_notify($v); -
trunk/phpgwapi/inc/functions.inc.php
r2419 r2549 30 30 error_reporting(error_reporting() & ~E_NOTICE); 31 31 32 include (PHPGW_API_INC.'/common_functions.inc.php');32 include_once(PHPGW_API_INC.'/common_functions.inc.php'); 33 33 34 34 /*! … … 234 234 $GLOBALS['phpgw']->preferences = CreateObject('phpgwapi.preferences'); 235 235 $GLOBALS['phpgw']->applications = CreateObject('phpgwapi.applications'); 236 $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); 236 237 print_debug('main class loaded', 'messageonly','api'); 237 238 if (! isset($GLOBALS['phpgw_info']['flags']['included_classes']['error']) || … … 403 404 ! $GLOBALS['phpgw_info']['user']['apps']['admin'])) 404 405 { 405 $GLOBALS['phpgw']->common->phpgw_header();406 //$GLOBALS['phpgw']->common->phpgw_header(); 406 407 407 408 $GLOBALS['phpgw']->log->write(array('text'=>'W-Permissions, Attempted to access %1','p1'=>$GLOBALS['phpgw_info']['flags']['currentapp'])); … … 416 417 $GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.date_time'); 417 418 } 419 418 420 $GLOBALS['phpgw']->applications->read_installed_apps(); // to get translated app-titles 419 420 /*************************************************************************\ 421 * Load the header unless the developer turns it off * 422 \*************************************************************************/ 423 if ( array_key_exists( 'HTTP_BACKGROUNDREQUEST', $_SERVER ) || array_key_exists( 'BackgroundRequest', $_GET ) ) 424 { 425 $GLOBALS['phpgw_info']['flags'] = array( 426 'noheader' => true, 427 'nonavbar' => true 428 ); 429 } 430 if (!@$GLOBALS['phpgw_info']['flags']['noheader']) 431 { 432 $GLOBALS['phpgw']->common->phpgw_header(); 433 } 434 } 421 }
Note: See TracChangeset
for help on using the changeset viewer.