コード例 #1
0
 /**
  * Load dictionary source definitions from the MCL database in
  * enhanced mode.
  * @return Array of ConceptSearchSource objects
  */
 public function loadDictionaryDefinitions($cxn_mcl)
 {
     // load dictionary sources
     $arr_dict = array();
     $sql_dict = 'select * from concept_dict where active = 1 order by sort_order, dict_name';
     if (!($rsc_dict = mysql_query($sql_dict))) {
         trigger_error('Could not load dictionary sources: ' . mysql_error($cxn_mcl), E_USER_ERROR);
     }
     if ($this->debug) {
         echo '<p><b>Loading dictionary sources:</b><br> ' . $sql_dict . '</p>';
     }
     while ($row = mysql_fetch_assoc($rsc_dict)) {
         $css = new ConceptSearchSource();
         $css->setSourceDictionary($row['dict_id'], $row['db_name'], $row['dict_name'], $row['fulltext_mode'], $row['last_updated']);
         $css->setConnectionParameters($row['host'], $row['uid'], $row['pwd']);
         $arr_dict[] = $css;
     }
     return $arr_dict;
 }