Guest User

Untitled

a guest
Nov 24th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1.     public static function add_js_file($file, $index = -1) {
  2.    
  3.         if (!file_exists(FS_ROOT.$file)) {
  4.             Throw new Exception('Tried to add Javascript file that doesn\'t exist');
  5.         }
  6.        
  7.         if ($index != -1) {
  8.             for ($x = count(self::$js_includes); $x > $index + 1; $x --) {
  9.                 self::$js_includes[$x] = self::$js_includes[$x - 1];
  10.             }
  11.             self::$js_includes[$index] = $file;
  12.         } else {
  13.             self::$js_includes[] = $file;
  14.         }
  15.  
  16.         global $_FirePHP; $_FirePHP->info('jiffy', 'JS File Added');
  17.        
  18.     }
Add Comment
Please, Sign In to add comment