27 include(
"../class/config.php");
30 "caller" => array (
"request",
"string",
""),
31 "select" => array (
"request",
"string",
""),
32 "curdir" => array (
"request",
"string",
""),
33 "lastcurdir" => array (
"request",
"string",
""),
34 "file" => array (
"request",
"string",
""),
35 "bid" => array (
"request",
"string",
""),
48 $rot=substr($curdir,0,$pos);
49 $next=@strpos($curdir,
"/",$pos+1);
50 $nextstr=substr($curdir,$pos+1,$next-$pos-1);
53 while (
$r=readdir(
$c)) {
54 if (is_dir(
$root.$rot.
"/".
$r) &&
$r!=
"." &&
$r!=
"..") { $tmp[
$i++]=
$r; }
57 foreach ($tmp as
$r) {
59 $brlist[]=array(
"dir"=>
$r,
"level"=>$level,
"put"=>
ife($curdir==$rot.
"/".
$r.
"/",
"",$rot.
"/".
$r));
72 $brlist=array(array(
"dir"=>
"/",
"level"=>0,
"put"=>
ife($curdir==
"/",
"",
"/") ));
80 if (substr($file,0,1)!=
"/") $file=
"/".$file;
81 if (substr($file,-1)!=
"/") $file.=
"/";
82 if (!$file) $file=
"/";
88 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
89 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:lang=
"fr" lang=
"fr">
91 <title>Recherche
d'un dossier</title>
92 <link rel="stylesheet" href="styles/style.css" type="text/css" />
93 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
94 <script src="/javascript/jquery/jquery.min.js" type="text/javascript"></script>
95 <script type="text/javascript">
96 /* Fonction appellée lors du lancement d'un popup Fichier : */
97 function popupfile() {
99 if (document.forms[
"main"].file)
100 document.forms[
"main"].file.focus();
103 function addslashes(ch) {
104 ch = ch.replace(/\\/g,
"\\\\")
105 ch = ch.replace(/\
'/g,"\\'")
106 ch = ch.replace(/\"/g,"\\\
"")
112 window.parent.jQuery(
'#<?php echo $caller; ?>').val( $(
"#file").val() );
113 window.parent.jQuery(
'#<?php echo $bid; ?>').dialog(
'close');
119 <body
class=
"light" onload=
"popupfile();">
120 <h3><?php
__(
"Searching for a folder"); ?></h3>
126 echo _(
"Error, cannot find this folder").
"<br />";
128 echo
"<a href=\"browseforfolder2.php?caller=".urlencode($caller).
"&curdir=".
$root.
"&bid=".$bid.
"\">"._(
"Back to the root folder").
"</a><br />";
133 <form method=
"post" id=
"main" name=
"main" action=
"browseforfolder2.php">
136 <input type=
"hidden" name=
"caller" value=
"<?php ehe($caller); ?>" />
137 <input type=
"hidden" name=
"lastcurdir" value=
"<?php ehe($curdir); ?>" />
138 <input type=
"hidden" name=
"bid" value=
"<?php ehe($bid); ?>" />
140 <input type=
"text" class=
"int" id=
"file" name=
"file" size=
"20" value=
"<?php ehe($file); ?>" /><br />
142 <input type=
"button" name=
"select" value=
"<?php __("Select
"); ?>" class=
"inb" onclick=
"retour();" />
143 <input type=
"button" name=
"cancel" value=
"<?php __("Cancel
"); ?>" class=
"inb" onclick=
"window.parent.jQuery('#<?php ehe($bid); ?>').dialog('close');" />
147 <table style=
"border: 0" cellspacing=
"2" cellpadding=
"0">
153 echo
"<td width=\"16\"></td>";
154 if (
$val[
"put"]!=
"") {
156 <td width=
"16"><img src=
"icon/folder.png" width=
"16" height=
"16" alt=
"" /></td>
160 <td width=
"16"><img src=
"icon/openfold.png" width=
"16" height=
"16" alt=
"" /></td>
163 echo
"<td colspan=\"".($maxlevel-
$val[
"level"]+1).
"\">";
164 if (
$val[
"put"]!=
"") {
165 echo
"<a href=\"browseforfolder2.php?caller=".eue($caller,
false).
"&bid=".
eue($bid,
false).
"&file=".
eue(
$val[
"put"],
false).
"\">".
ehe(
$val[
"dir"],
false).
"</a>";
167 echo
"<b>".ehe(
$val[
"dir"],
false).
"</b>";
169 echo
"</td>\n</tr>\n";
_subbrowse($curdir, $pos, $level)
$fields
An HTML page to browse for a folder on a remote server and choose it using Javascript.
d($mess)
Debug function that print infos.
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
eue($str, $display=TRUE)
Echo the URLENCODED version of a value.
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
getuserpath($user=null)
get the home of the user
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...
if(empty($_POST['key'])||empty($_POST['val'])) $key