<?php
require 'inc.php';

$arr_file_ext=array("html","js","css");
if(!isset($get_folder_path)) $get_folder_path="";
if(!isset($get_filename)) $get_filename="";
$arr_x=array("root_path"=>"/".TEMPLATES_DIR."/temp".$get_folder_path);
$obj_ctl_file=new cls_ctl_file($arr_x);
$page_footer_info=<<<HTML
<input type='hidden' name='folder_path' value='{$get_folder_path}'>
HTML;

$str_path="";
$arr_x=explode("/",$get_folder_path);
for($i=0;$i<count($arr_x);$i++){
	if(empty($arr_x[$i])) continue;
	$str_path.="/".$arr_x[$i];
	$arr_x[$i]="<a href=\"javascript:meOpendir('".$str_path."');\">".$arr_x[$i]."</a>";
}
$this_folder_path="<a href=\"javascript:meOpendir('');\">¸ùÄ¿Â¼</a>".implode(" -> ",$arr_x);


switch($get_act)
{	
	default:
	{
		$arr_dir=$obj_ctl_file->get_dirs();
		if(empty($get_folder_path)){
			$arr_x=$arr_dir;
			$arr_dir=array();
			foreach($arr_x as $item){
				if($item["name"]=="sys") continue;
				$arr_dir[]=$item;
			}
		}
		$arr_f=$obj_ctl_file->get_files();
		$arr_file=array();
		foreach($arr_f as $item){
			$arr_x=explode(".",$item["name"]);
			if(!in_array(strtolower(end($arr_x)),$arr_file_ext)) continue;
			$item["app"]=$arr_x[0];
			$arr_file[]=$item;
		}
		include "tpl/getfile.tpl.php";

	}
}

?>
