[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 include ("../inc/inc.Settings.php"); 3 include ("../inc/inc.AccessUtils.php"); 4 include ("../inc/inc.ClassAccess.php"); 5 include ("../inc/inc.ClassDocument.php"); 6 include ("../inc/inc.ClassFolder.php"); 7 include ("../inc/inc.ClassGroup.php"); 8 include ("../inc/inc.ClassUser.php"); 9 include ("../inc/inc.DBAccess.php"); 10 include ("../inc/inc.FileUtils.php"); 11 include ("../inc/inc.Language.php"); 12 include ("../inc/inc.OutUtils.php"); 13 14 include ("../inc/inc.Authentication.php"); 15 16 17 18 function printTree($path, $accessMode, $exclude, $level = 0) 19 { 20 GLOBAL $user, $form; 21 22 $folder = $path[$level]; 23 $subFolders = $folder->getSubFolders(); 24 $subFolders = filterAccess($subFolders, $user, M_READ); 25 26 if ($level+1 < count($path)) 27 $nextFolderID = $path[$level+1]->getID(); 28 else 29 $nextFolderID = -1; 30 31 print "<table cellpadding=0 cellspacing=0>\n"; 32 print " <tr>\n"; 33 print " <td valign=\"top\""; 34 if (count($subFolders) > 0) 35 print " background=\"".getImgPath("down.gif")."\""; 36 print "><img src=\""; 37 if ($level == 0) printImgPath("to_down.gif"); 38 else if (count($subFolders) > 0) printImgPath("right_in_to_down.gif"); 39 else printImgPath("right_in.gif"); 40 print "\" border=0></td>\n"; 41 print " <td class=\"foldertree\">"; 42 if ($folder->getAccessMode($user) >= $accessMode) { 43 print "<a class=\"foldertree_selectable\" href=\"javascript:folderSelected(" . $folder->getID() . ", '" . addslashes($folder->getName()) . "')\">"; 44 print "<img src=\"".getImgPath("folder_opened.gif")."\" border=0>".$folder->getName()."</a></td>\n"; 45 } 46 else 47 print "<img src=\"".getImgPath("folder_opened.gif")."\" width=18 height=18 border=0>".$folder->getName()."</td>\n"; 48 print " </tr>\n"; 49 50 for ($i = 0; $i < count($subFolders); $i++) { 51 if ($subFolders[$i]->getID() == $exclude) 52 continue; 53 54 print "<tr>"; 55 if ($i +1 < count($subFolders)) 56 print "<td background=\"".getImgPath("down.gif")."\" valign=\"top\"><img src=\"".getImgPath("right.gif")."\" border=0></td>"; 57 else 58 print "<td valign=\"top\"><img src=\"".getImgPath("right_last.gif")."\" border=0></td>"; 59 print "<td>"; 60 if ($subFolders[$i]->getID() == $nextFolderID) 61 printTree($path, $accessMode, $exclude, $level+1); 62 else { 63 $subFolders_ = $subFolders[$i]->getSubFolders(); 64 $subFolders_ = filterAccess($subFolders_, $user, M_READ); 65 66 print "<table cellpadding=0 cellspacing=0><tr>"; 67 if (count($subFolders_) > 0) 68 print " <td valign=\"top\"><a href=\"out.FolderChooser.php?form=$form&mode=$accessMode&exclude=$exclude&folderid=".$subFolders[$i]->getID()."\"><img src=\"".getImgPath("right_in_plus.gif")."\" border=0></a></td>"; 69 else 70 print " <td valign=\"top\"><img src=\"".getImgPath("right_in.gif")."\"></td>"; 71 print " <td class=\"foldertree\" valign=\"top\">"; 72 if ($subFolders[$i]->getAccessMode($user) >= $accessMode) { 73 print "<a class=\"foldertree_selectable\" href=\"javascript:folderSelected(" . $subFolders[$i]->getID() . ", '" . addslashes($subFolders[$i]->getName()) . "')\">"; 74 print "<img src=\"".getImgPath("folder_closed.gif")."\" border=0>".$subFolders[$i]->getName()."</a></td>\n"; 75 } 76 else 77 print "<img src=\"".getImgPath("folder_closed.gif")."\" border=0>".$subFolders[$i]->getName()."</td>"; 78 print "</tr></table>"; 79 } 80 print "</td>"; 81 print "</tr>"; 82 } 83 84 print "</table>\n"; 85 } 86 87 ?> 88 89 90 <html> 91 <head> 92 <link rel="STYLESHEET" type="text/css" href="styles.css"> 93 <title><?php echo getMLText("choose_target_folder")?></title> 94 95 <script language="JavaScript"> 96 var targetName; 97 var targetID; 98 99 function folderSelected(id, name) { 100 targetName.value = name; 101 targetID.value = id; 102 window.close(); 103 return true; 104 } 105 </script> 106 107 </head> 108 <body> 109 110 <?php 111 $folder = getFolder($folderid); 112 printTree($folder->getPath(), $mode, $exclude); 113 ?> 114 115 116 <script language="JavaScript"> 117 targetName = opener.document.<?php echo $form?>.targetname; 118 targetID = opener.document.<?php echo $form?>.targetid; 119 </script> 120 121 122 </body> 123 </html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |