Changeset 2549 for trunk/phpgwapi/inc/class.javascript.inc.php
- Timestamp:
- 04/15/10 15:26:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.