. * * Version 0.1 * Author: Octavio Benedi Sanchez */ function load_sections($container_folder) { $sections = array(); //$sections['base']=$container_folder; $ignore_dirs = array(".", ".."); // container folder is the folder that will be processed. $files=scandir($container_folder); //echo "
".print_r($files,true)."
"; $i=0; foreach ($files as $file) { // just looking for directories other than . and .. if ((is_dir($container_folder.'/'.$file))&&(!in_array($file,$ignore_dirs))) { // echo "$file lo es"; //Check for a configuration file. if(file_exists($container_folder.'/'.$file.'/configuration.php')) { include $container_folder.'/'.$file.'/configuration.php'; if ($type=="SELECTOR") { $sections[$i]['name']=$section_name; unset($section_name); $sections[$i]['description']=$section_description; unset($section_description); $sections[$i]['icon']=$section_icon; unset($section_icon); $sections[$i]['icon_hv']=$section_icon_selected; unset($section_icon); $sections[$i]['folder']=$file; } } $i++; } else { //echo "$file no lo es"; } } return $sections; } $core_sections_menu='
    '; $i='0'; foreach (load_sections($base_dir.'plugins') as $itm) { /* * Unselect this to provide more information. Note that CSS will be modified. $core_sections_menu.="
  • ".$itm['name']."

    description: ".$itm['description']."

    icon path: ".$itm['icon']."

  • "; */ if ($section!=$itm['folder']) { $core_sections_menu.='
  • '.$itm['name'].'
  • '; } else { // Highlight selected section. $core_sections_menu.='
  • '.$itm['name'].'
  • '; } $i++; } unset($i); $core_sections_menu.='
'; //echo "
".print_r(load_sections($base_dir.'plugins'),true)."
"; ?>