[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare - Insert File Dialog, File Manager -plugin for tinymce * 4 * http://www.eGroupWare.org * 5 * Authors Al Rashid <alrashid@klokan.sk> * 6 * and Xiang Wei ZHUO <wei@zhuo.org> * 7 * Modified for eGW by Cornelius Weiss <egw@von-und-zu-weiss.de> * 8 * -------------------------------------------- * 9 * This program is free software; you can redistribute it and/or modify it * 10 * under the terms of the GNU General Public License as published by the * 11 * Free Software Foundation; version 2 of the License. * 12 \**************************************************************************/ 13 14 15 function dirs($dir,$abs_path) { 16 $d = dir($dir); 17 $dirs = array(); 18 while (false !== ($entry = $d->read())) { 19 if(is_dir($dir.'/'.$entry) && substr($entry,0,1) != '.') { 20 $path['path'] = $dir.'/'.$entry; 21 $path['name'] = $entry; 22 $dirs[$entry] = $path; 23 } 24 } 25 $d->close(); 26 ksort($dirs); 27 $cntDir = count($dirs); 28 for($i=0; $i<$cntDir; $i++) { 29 $name = key($dirs); 30 $current_dir = $abs_path.'/'.$dirs[$name]['name']; 31 echo ", '".sanitize2($current_dir)."/'\n"; 32 dirs($dirs[$name]['path'],$current_dir); 33 next($dirs); 34 } 35 } 36 37 function checkName($name) { 38 $name = str_replace('../', '', $name); 39 $name = str_replace('./', '', $name); 40 return $name; 41 } 42 function sanitize2($name) { 43 return str_replace("'", "\'", $name); 44 } 45 46 function unsanitize($name) { 47 return str_replace("\'", "'", $name); 48 } 49 50 function pathSlashes($path) { 51 if ('/' != substr($path,0,1)) $path = '/'.$path; 52 if ('/' != substr($path,-1,1)) $path = $path.'/'; 53 return $path; 54 } 55 function alertSanitize($path) { 56 return ( sanitize2(str_replace("\\", "\\\\", $path)) ); 57 } 58 59 function percent($p, $w) 60 { 61 return (real)(100 * ($p / $w)); 62 } 63 64 function unpercent($percent, $whole) 65 { 66 return (real)(($percent * $whole) / 100); 67 } 68 ?>
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 |