function imageFiles($dir) { $result = array(); $acceptable_file_ext = array('jpg', 'png', 'gif'); $cdir = scandir($dir); foreach ($cdir as $key => $value) { if (substr($value, 0, 1) != '.') { $filename = $dir . DIRECTORY_SEPARATOR . $value; $ext = pathinfo($filename, PATHINFO_EXTENSION); if (is_dir($filename)) { $subfiles = imageFiles($filename); $result = array_merge($result, $subfiles); } else { if (in_array($ext, $acceptable_file_ext)) { $result[$filename] = $filename; } } } } ksort($result); return $result; }
//require_once( JPATH_COMPONENT.DS.'language'.DS.'english.php' ) ; require_once JPATH_COMPONENT . DS . "admin.swmenupro.class.php"; $cid = JRequest::getVar('cid', array(0), 'post'); if (!is_array($cid)) { $cid = array(0); } //JTable::addTableDir(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_swmenupro'.DS.'tables'); switch (JRequest::getVar('task')) { case 'preview': preview($cid[0], $option); break; case 'images': imageManager($cid[0], $option); break; case 'imageFiles': imageFiles($cid[0], $option); break; case "new": editModule('0', $option); break; case "saveedit": saveconfig($cid[0], $option); break; case 'uploadfile': uploadPackage(); break; case 'uploadlanguage': uploadPackage(); break; case 'changelanguage': changeLanguage();