Revision 2,
1.4 KB
checked in by niltonneto, 18 years ago
(diff) |
Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
|
Line | |
---|
1 | <?php |
---|
2 | class Functions{ |
---|
3 | |
---|
4 | |
---|
5 | function getDirContents($dir){ |
---|
6 | //$dir = dirname($dir); |
---|
7 | |
---|
8 | if (!is_dir($dir)) { |
---|
9 | return 'Error: Cannot load files in :'. $dir.' !'; |
---|
10 | } |
---|
11 | |
---|
12 | if ($root=@opendir($dir)) { |
---|
13 | |
---|
14 | while ($file=readdir($root)) { |
---|
15 | if($file!="." && $file!="..") |
---|
16 | $files[]=$dir."/".$file; |
---|
17 | } |
---|
18 | |
---|
19 | } |
---|
20 | |
---|
21 | return $files; |
---|
22 | } |
---|
23 | |
---|
24 | function getFilesJs($excludeFiles = '', $update_version = ''){ |
---|
25 | |
---|
26 | $files = $this -> getDirContents('js'); |
---|
27 | $str_files = ''; |
---|
28 | |
---|
29 | if($excludeFiles) { |
---|
30 | $excludeFiles = explode(",",trim($excludeFiles)); |
---|
31 | // Bug fixed for array_search function |
---|
32 | $excludeFiles[count($excludeFiles)] = $excludeFiles[0]; |
---|
33 | $excludeFiles[0] = null; |
---|
34 | } |
---|
35 | for($i = 0; $i < count($files); $i++) { |
---|
36 | |
---|
37 | if(count(explode('.js',$files[$i])) > 1) { |
---|
38 | if(!$excludeFiles || ($excludeFiles && !array_search(trim($files[$i]),$excludeFiles))){ |
---|
39 | $str_files .= "<script src='".$files[$i]."?".$update_version."' type='text/javascript'></script>"; |
---|
40 | } |
---|
41 | } |
---|
42 | } |
---|
43 | |
---|
44 | return $str_files; |
---|
45 | } |
---|
46 | |
---|
47 | function getReturnExecuteForm(){ |
---|
48 | $response = $_SESSION['response']; |
---|
49 | $_SESSION['response'] = null; |
---|
50 | return $response; |
---|
51 | } |
---|
52 | |
---|
53 | function getLang($key){ |
---|
54 | return $_SESSION['phpgw_info']['expressomail']['lang'][$key]; |
---|
55 | } |
---|
56 | } |
---|
57 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.