/**
  * Extracts the extension of the file passed as parameter
  */
 public static function includeAll($argDir)
 {
     if ($tmpOpenedDir = opendir($argDir)) {
         while ($tmpFile = readdir($tmpOpenedDir)) {
             if (is_file($argDir . '/' . $tmpFile) && JavaScriptIncluder::ext($tmpFile) == 'js') {
                 echo '<script type="text/javascript" src="' . $argDir . '/' . $tmpFile . '" ></script>' . PHP_EOL;
             }
         }
     }
     closedir($tmpOpenedDir);
 }
Example #2
0
    <!--  CSS INCLUDES - END -->

    <!--  PHP INCLUDES - START -->

    <?php 
include 'util/JavaScriptIncluder.php';
?>

    <!--  PHP INCLUDES - END -->

    <!--  JAVASCRIPT INCLUDES - START -->

    <script type="text/javascript" src="ext-js/ext-all-debug.js"></script>

    <?php 
JavaScriptIncluder::includeAll('core');
JavaScriptIncluder::includeAll('ux');
JavaScriptIncluder::includeAll('util');
?>

    <script type="text/javascript" src="application/app.js"></script>

    <!--  JAVASCRIPT INCLUDES - END -->

</head>

<body>
</body>

</html>
Example #3
0
<?php

session_start();
// include constants
require_once 'lib/php/constants.php';
// include classloader and register it to autoloading
require_once 'lib/php/classloader.php';
spl_autoload_register('loadClass');
// start session and save client
require_once 'lib/php/functions/client.register.php';
// set content language
I18n::initialize();
// load current page content and required JS files
$currentPage = FileFunctions::getCurrentPage();
$externalJS = JavaScriptIncluder::getExternalJSFiles($currentPage);
$customJS = JavaScriptIncluder::getCustomJSFiles($currentPage);
?>
<!DOCTYPE html>
<html lang="<?php 
echo I18n::getLang();
?>
">

<head>
  <meta charset="utf-8">
  <title>hiragana.ch</title>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="description" content="Learn Hiragana and Katakana" />
  <meta name="keywords" content="hiragana katakana kana trainer japanese japanisch PHP" />
  <meta name="author" content="Steven Cardini, Raphael Laubscher" />