Exemplo n.º 1
0
 public static function scan()
 {
     // Initialize defaults
     self::$recursive = false;
     self::$directories = array();
     self::$files = array();
     self::$ext_filter = false;
     // Check we have minimum parameters
     if (!($args = func_get_args())) {
         die("Must provide a path string or array of path strings");
     }
     if (gettype($args[0]) != "string" && gettype($args[0]) != "array") {
         die("Must provide a path string or array of path strings");
     }
     // Check if recursive scan | default action: no sub-directories
     if (isset($args[2]) && $args[2] == true) {
         self::$recursive = true;
     }
     // Was a filter on file extensions included? | default action: return all file types
     if (isset($args[1])) {
         if (gettype($args[1]) == "array") {
             self::$ext_filter = array_map('strtolower', $args[1]);
         } else {
             if (gettype($args[1]) == "string") {
                 self::$ext_filter[] = strtolower($args[1]);
             }
         }
     }
     // Grab path(s)
     self::verifyPaths($args[0]);
     return self::$files;
 }
Exemplo n.º 2
0
$gdbo->sql = "\nSELECT\na.id_sys_module,\na.sys_module,\nb.id_sys_module_sub,\nb.sys_module_sub,\nb.sys_module_sub_href,\nUNHEX(b.sys_module_sub_icon) as sys_module_sub_icon\nFROM _sys_module a\nJOIN _sys_module_sub b ON a.id_sys_module=b.id_sys_module\nWHERE b.sys_module_sub_enabled=1 " . $moduleFilter . "\nORDER BY a.sys_module_order asc,b.sys_module_sub_order";
$gdbo->getRec();
$aModules = $gdbo->dbData;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>BIFROST SOFTWARE LLC</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta http-equiv="Cache control" content="no-cache"/>
	<meta name="COPYRIGHT" content="&copy; 2014 Bifrost Softrware LLC">
<?php 
$dirs = array($path . '_lib/jquery', $path . '_lib/js/', $path . '_thirdparty/miniupload/assets/js', $path . '_thirdparty/amcharts');
$file_ext = array("css", "js");
$files = scanDir::scan($dirs, $file_ext);
$linkedFiles = "";
foreach ($files as $fso) {
    $fso = str_replace($serverrootpath, "", $fso);
    $ext = trim(end(explode(".", $fso)));
    switch ($ext) {
        case "js":
            $linkedFiles .= '<script type="text/javascript" src="' . $fso . '"></script>';
            break;
        case "css":
            $linkedFiles .= '<link type="text/css" rel="stylesheet" href="' . $fso . '"/>';
            break;
        default:
            break;
    }
}