Exemplo n.º 1
0
 /**
  * Retrieve list of modules installed in SugarCRM
  * @param string $filter
  * @return object
  */
 public function retrieveModules($filter = '')
 {
     $moduleList = PMSEEngineUtils::getStudioModules();
     $output = array();
     foreach ($moduleList as $module) {
         if (!empty($module->name) && (empty($filter) || stripos($module->name, $filter) !== false)) {
             $tmpField = array();
             $tmpField['value'] = $module->module;
             $tmpField['text'] = $module->name;
             $output[] = $tmpField;
         }
     }
     $value = array();
     $text = array();
     foreach ($output as $key => $row) {
         $value[$key] = $row['value'];
         $text[$key] = $row['text'];
     }
     // Sort the data with volume descending, edition ascending.
     // Add $data as the last parameter, to sort by the common key.
     array_multisort($text, SORT_ASC, $output);
     //$res->result = $output;
     return $output;
 }