Esempio n. 1
0
 function read_url_methods($component)
 {
     $data = array();
     if ($component == 'midcom') {
         $exec_path = MIDCOM_ROOT . '/midcom/exec';
     } else {
         $component_path = str_replace('.', '/', $component);
         $exec_path = MIDCOM_ROOT . '/' . $component_path . '/exec';
     }
     if (!is_dir($exec_path) || !is_readable($exec_path)) {
         // Directory not accessible, skip loading it
         return $data;
     }
     $dir_handle = opendir($exec_path);
     while (false !== ($file = readdir($dir_handle))) {
         if (preg_match('/^\\./', $file)) {
             //Skip hidden files
             continue;
         }
         $data[$file] = array();
         $info_id = "urlmethod_" . str_replace('.php', '', $file);
         $data[$file]['url'] = '/midcom-exec-' . $component . '/' . $file;
         $data[$file]['description'] = midcom_admin_help_help::get_help_contents($info_id, $component);
         if (midcom_admin_help_help::help_exists($info_id, $component)) {
             $data[$file]['handler_help_url'] = $info_id;
         }
     }
     return $data;
 }