Example #1
0
 /**
  * Enter description here...
  *
  * @param unknown_type $type
  * @param unknown_type $recurse
  * @param unknown_type $fullpath
  * @return unknown
  */
 function &listAll($type = 'file', $recurse = false, $fullpath = false)
 {
     $results = array();
     if ($dir = @opendir($this->path)) {
         while (false !== ($file = readdir($dir))) {
             if ($file == '.' or $file == '..') {
                 continue;
             }
             if (is_dir($this->path . $file)) {
                 if ($recurse) {
                     $subdir = new mosDirectory($this->path . $file);
                     $results = array_merge($results, $subdir->listAll($type, $recurse, $fullpath));
                     unset($subdir);
                 }
                 if ($type == 'file') {
                     continue;
                 }
             } elseif ($type == 'dir') {
                 continue;
             }
             if ($fullpath) {
                 $results[] = $this->path . $file;
             } else {
                 $results[] = $file;
             }
         }
         closedir($dir);
     }
     asort($results);
     return $results;
 }
Example #2
0
 function &getIcons()
 {
     $iconList = '';
     $live_site = mamboCore::get('mosConfig_live_site');
     $iconDir = new mosDirectory(mamboCore::get('mosConfig_absolute_path') . '/administrator/components/com_containers/images/folder_icons');
     $files = $iconDir->listAll();
     $ss = 0;
     foreach ($files as $file) {
         $iconList .= "\n<a href=\"JavaScript:paste_strinL('{$file}')\" onmouseover=\"window.status='{$file}'; return true\"><img src=\"{$live_site}/administrator/components/com_containers/images/folder_icons/{$file}\" width=\"32\" height=\"32\" border=\"0\" alt=\"{$file}\" /></a>&nbsp;&nbsp;";
         $ss++;
         if ($ss % 10 == 0) {
             $iconList .= "<br/>\n";
         }
     }
     return $iconList;
 }