Beispiel #1
0
 public function displayValue()
 {
     $value = '';
     switch ($this->html) {
         case 'countryList':
             $value = fieldAdapterGmp::displayCountry($this->value);
             break;
         case 'statesList':
             $value = fieldAdapterGmp::displayState($this->value);
             break;
         case 'checkboxlist':
             $options = $this->getHtmlParam('optionsGmp');
             $value = array();
             if (!empty($options) && is_array($options)) {
                 foreach ($options as $opt) {
                     if (isset($opt['checked']) && $opt['checked']) {
                         $value[] = $opt['text'];
                     }
                 }
             }
             if (empty($value)) {
                 $value = __('N/A', GMP_LANG_CODE);
             } else {
                 $value = implode('<br />', $value);
             }
             break;
         case 'selectbox':
         case 'radiobuttons':
             $options = $this->getHtmlParam('optionsGmp');
             if (!empty($options) && !empty($options[$this->value])) {
                 $value = $options[$this->value];
             } else {
                 $value = __('N/A', GMP_LANG_CODE);
             }
             break;
         default:
             if ($this->value == '') {
                 $value = __('N/A', GMP_LANG_CODE);
             } else {
                 if (is_array($this->value)) {
                     $options = $this->getHtmlParam('optionsGmp');
                     if (!empty($options) && is_array($options)) {
                         $valArr = array();
                         foreach ($this->value as $v) {
                             $valArr[] = $options[$v];
                         }
                         $value = recImplode('<br />', $valArr);
                     } else {
                         $value = recImplode('<br />', $this->value);
                     }
                 } else {
                     $value = $this->value;
                 }
             }
             break;
     }
     if ($echo) {
         echo $value;
     } else {
         return $value;
     }
 }