Exemple #1
0
 function load_album($parameters)
 {
     global $_PATH;
     if ($node = $this->_tree->getNodeInfo($parameters['id'])) {
         if ($node["obj_type"] != '_ALBUM') {
             $this->result["not_album"] = 1;
             return;
         }
         $this->result['category_data'] = $node['params'];
         $this->result['category_data']['basic'] = $node['basic'];
         $this->result['outerLink']['isOuterLink'] = $node['params']['isOuterLink'];
         $this->get_intitial_outer_link($node['params']['Destination_page']);
         $folders = XFILES::directory_list($_PATH['PATH_MEDIA'] . 'gallery/');
         $this->result['category_data']['folders'] = XHTML::arr_select_opt(XARRAY::combine($folders, $folders), $node['params']['folders'], $node['params']['folders'], true);
     }
 }
Exemple #2
0
 public static function pluginsList()
 {
     if (self::$plugins) {
         return self::$plugins;
     }
     if ($plugs = XFILES::directory_list(xConfig::get('PATH', 'PLUGINS'))) {
         foreach ($plugs as $plug) {
             $plugParts = explode('.', $plug);
             self::$plugins[$plugParts[0]][$plugParts[1]] = $plug;
         }
         return self::$plugins;
     }
 }
Exemple #3
0
 public static function files_list($pth, $types = 'files', $allow_types = null, $recursive = 0, $get_basenames = false)
 {
     if ($dir = @opendir($pth)) {
         $file_list = array();
         while (FALSE !== ($file = readdir($dir))) {
             if ($file != '.' and $file != '..') {
                 if (is_dir($pth . '/' . $file) and ($types == 'directories' or $types == 'all')) {
                     $file_list[] = $file;
                     if ($recursive) {
                         $file_list = array_merge($file_list, XFILES::directory_list($pth . '/' . $file . '/', $types, $recursive, !$get_basenames));
                         continue;
                     }
                     continue;
                 }
                 if ($types == 'files' and !is_dir($pth . '/' . $file)) {
                     if (is_array($allow_types)) {
                         preg_match("/\\.(.?)+/", $file, $ftype);
                         if (in_array($ftype[0], $allow_types) != false) {
                             if (!$get_basenames) {
                                 $file_list[] = $pth . '/' . $file;
                             } else {
                                 $file_list[] = $file;
                             }
                         }
                     } else {
                         if (!$get_basenames) {
                             $file_list[] = $pth . '/' . $file;
                         } else {
                             $file_list[] = $file;
                         }
                     }
                     continue;
                 } else {
                     if ($types == 'all') {
                         if (is_array($allow_types)) {
                             preg_match("/\\.(.?)+/", $file, $ftype);
                             if (in_array(strtolower($ftype[0]), $allow_types) != false) {
                                 if (!$get_basenames) {
                                     $file_list[] = $pth . '/' . $file;
                                 } else {
                                     $file_list[] = $file;
                                 }
                             }
                         } else {
                             if (!$get_basenames) {
                                 $file_list[] = $pth . '/' . $file;
                             } else {
                                 $file_list[] = $file;
                             }
                         }
                         continue;
                     }
                     continue;
                 }
                 continue;
             }
         }
         closedir($dir);
         return $file_list;
     }
     return FALSE;
 }