<?PHP
if (!isset($rootpath))
$rootpath=$_SERVER['DOCUMENT_ROOT']."/";
include_once($rootpath . "common.php");
$ttem = new Template();
$ttem->set_filenames(array("header"=>$rootpath."html/header.tpl"));
$ttem->set_filenames(array("viewdirfile"=>$rootpath."html/webdrive/viewdirfile.tpl"));
$ttem->set_filenames(array("dirview"=>$rootpath."html/webdrive/dirview.tpl"));
$ttem->set_filenames(array("shortcut"=>$rootpath."html/webdrive/shortcut.tpl"));
$ttem->set_filenames(array("divpanel"=>$rootpath."html/webdrive/divpanel.tpl"));
$ttem->set_filenames(array("propreserve"=>$rootpath."html/webdrive/propreserve.tpl"));
$ttem->set_filenames(array("driveprop"=>$rootpath."html/webdrive/driveprop.tpl"));
$ttem->set_filenames(array("body"=>$rootpath."html/login/browsedir.tpl"));
$ttem->set_filenames(array("footer"=>$rootpath."html/footer.tpl"));
$ttem->assign_var("APP_ROOT", $webappcfg['APPPATH']);
@reset($rb);
while (list($key, $var) = each($rb))
{
$ttem->assign_var($key, $var);
}
@reset($rb);
while (list($key, $var) = each($rb))
{
$ttem->assign_var($key, $var);
}
$ttem->assign_var("HTTP_HOST", $_SERVER['HTTP_HOST']);
$phpdeclare= "";
if (isset($response['dirarray']) && (count($response['dirarray'])>0))
{
for ($i=0; $i<count($response['dirarray']); $i++)
{
if ($response['dirarray'][$i]!="~")
$phpdeclare .= "dirarray[dirarray.length]='".$response['dirarray'][$i] ."';\n";
}
}
$ttem->assign_var("PHP_DECLARE", $phpdeclare);
if (!isset($response['ownerid']))
$response['ownerid'] = NSession::getuid();
$ttem->assign_var("THEME_MENU0_BG", "/theme/basic/fileexback.gif");
$ttem->assign_var("THEME_PRELEVEL", "<img src='/img/folder_uplevel.gif' border='0' />");
$ttem->assign_var("THEME_HOME", "<img src='/img/folder_home.gif' border='0' />");
$ttem->assign_var("THEME_NETWORK", "<img src='/img/folder_network.gif' border='0' />");
$ttem->assign_var("THEME_SEARCH", "<img src='/img/folder_search.gif' border='0' />");
$ttem->assign_var("THEME_REFRESH", "<img src='/img/folder_refresh.gif' border='0' />");
$ttem->assign_var("THEME_MOVETO", "<img src='/img/go_pointer.gif' border='0' />");
$ttem->assign_var("THEME_FOLDER", "<img src='/img/folder_folder.gif' border='0' />");
$ttem->assign_var("THEME_SFOLDER", "<img src='/img/folder_folder.gif' border='0' width='50' />");
$ttem->assign_var("THEME_FILENAME", "<img src='/theme/basic/filename_icon.gif' border='0' />");
$ttem->assign_var("THEME_ICONVIEW", "<img src='/img/folder_iconview.gif' id='viewmode_iconview' border='0' />");
$ttem->assign_var("THEME_DETAILVIEW", "<img src='/img/folder_detailview.gif' id='viewmode_detailview' border='0' />");
$ttem->assign_var("THEME_PICVIEW", "<img src='/img/folder_picview.gif' id='viewmode_picview' border='0' />");
$ttem->assign_var("THEME_SEPARATOR", "<img src='/img/separator.gif' border='0' />");
$ttem->assign_var("FEED_BROWSEDIR", "/PHP_CON/filecontroller.php?action=browsedir&ownerid=".$response['ownerid']);
$ttem->assign_var("BROWSINGID", $response['ownerid']);
$ttem->assign_var("FEED_CREATEDIR", "/PHP_CON/filecontroller.php");
$ttem->assign_var("FEED_DOWNLOAD", "/PHP_CON/filecontroller.php");
$ttem->assign_var("FEED_GETATTR", "/PHP_CON/filecontroller.php?action=getattr&ownerid=".$response['ownerid']);
$ttem->assign_var("FEED_SHAREPUBLIC", "/PHP_CON/filecontroller.php?action=sharepublic&ownerid=".$response['ownerid']);
$ttem->assign_var("FEED_FILEPROP", "/PHP_CON/filecontroller.php?action=xmldirfileprop&ownerid=".$response['ownerid']);
$ttem->assign_var("FEED_GETUSERID", "/PHP_CON/xmlcontroller.php?action=xmlgetid&username=");
$ttem->assign_var("FEED_SAVEFILEPROP", "/PHP_CON/filecontroller.php?action=savefileprop");
$ttem->assign_var("FEED_DIRPROP", "/PHP_CON/xmlcontroller.php?action=dirprop&ownerid=".$response['ownerid']);
$ttem->assign_var("FEED_SAVEDIRPROP", "/PHP_CON/filecontroller.php?action=savedirprop");
$ttem->assign_var("FEED_DRIVEPROP", "/PHP_CON/xmlcontroller.php?action=xmldriveprop&ownerid=".$response['ownerid']);
$ttem->assign_var("FEED_RENAMEFILE", "/PHP_CON/filecontroller.php?action=renamefile");
$ttem->assign_var("FEED_RENAMEDIR", "/PHP_CON/filecontroller.php?action=renamedir");
$ttem->assign_var("FEED_DELFILE", "/PHP_CON/filecontroller.php?action=delfile");
$ttem->assign_var("FEED_DELDIR", "/PHP_CON/filecontroller.php?action=deldir");
$ttem->assign_var("FEED_IMGTHUMB", "/PHP_CON/imagecontroller.php?action=getthumb&fileid=");
$ttem->pparse("header");
$ttem->loadfile("viewdirfile");
$rtt = "";
eval(str_replace('$this->', '$ttem->', $ttem->compile($ttem->uncompiled_code["viewdirfile"], true, "rtt")));
$ttem->assign_var("BROWSEDIR_RIGHT", $rtt);
$ttem->loadfile("dirview");
$rtt = "";
eval(str_replace('$this->', '$ttem->', $ttem->compile($ttem->uncompiled_code["dirview"], true, "rtt")));
$ttem->loadfile("shortcut");
$rtt2 = "";
eval(str_replace('$this->', '$ttem->', $ttem->compile($ttem->uncompiled_code["shortcut"], true, "rtt2")));
$ttem->loadfile("divpanel");
$rtt3 = "";
eval(str_replace('$this->', '$ttem->', $ttem->compile($ttem->uncompiled_code["divpanel"], true, "rtt3")));
$ttem->loadfile("propreserve");
$rtt4 = "";
eval(str_replace('$this->', '$ttem->', $ttem->compile($ttem->uncompiled_code["propreserve"], true, "rtt4")));
$ttem->loadfile("driveprop");
$rtt5 = "";
eval(str_replace('$this->', '$ttem->', $ttem->compile($ttem->uncompiled_code["driveprop"], true, "rtt5")));
$ttem->assign_var("BROWSEDIR_LEFT", $rtt . $rtt2 . $rtt4 . $rtt3 . $rtt5);
$ttem->pparse("body");
$ttem->pparse("footer");
?>