Inheritance: extends Horde_Form_Type
Example #1
0
 public function init($values = null, $prompt = null)
 {
     global $conf, $registry;
     // Get list of clients, if available.
     if ($registry->hasMethod('clients/getClientSource')) {
         $source = $registry->call('clients/getClientSource');
         if (!empty($source)) {
             $results = $registry->call('clients/searchClients', array(array('')));
             $clientlist = $results[''];
             $clients = array();
             foreach ($clientlist as $client) {
                 $key = isset($client['id']) ? $client['id'] : $client['__key'];
                 $clients[$key] = isset($client[$conf['client']['field']]) ? $client[$conf['client']['field']] : '';
             }
             asort($clients);
             parent::init($clients);
         }
     }
 }
Example #2
0
 function init($db, $sql, $prompt = null)
 {
     $values = array();
     try {
         $col = $db->selectValues($sql);
         $values = array_combine($col, $col);
     } catch (Horde_Db_Exception $e) {
     }
     parent::init($values, $prompt);
 }