Logo Search packages:      
Sourcecode: nagvis version File versions  Download package

WuiEditMainCfg::getFields (  ) 

Parses the Form fields

Returns:
Array Html
Author:
Lars Michelsen <lars@vertical-visions.de>

Definition at line 67 of file WuiEditMainCfg.php.

References getBackends(), getHeaderTemplates(), getIconsets(), and getLanguages().

Referenced by getForm().

                           {
            if (DEBUG&&DEBUGLEVEL&1) debug('Start method WuiEditMainCfg::getFields()');
            $ret = Array();
            
            foreach($this->MAINCFG->validConfig AS $cat => $arr) {
                  // don't display backend,rotation and internal options
                  if(!preg_match("/^backend/i",$cat) && !preg_match("/^internal$/i",$cat) && !preg_match("/^rotation/i",$cat)) {
                        $ret = array_merge($ret,$this->FORM->getCatLine($cat));
                        
                        foreach($arr AS $key2 => $prop) {
                              // ignore some vars
                              if(isset($this->MAINCFG->validConfig[$cat][$key2]['editable']) && $this->MAINCFG->validConfig[$cat][$key2]['editable']) {
                                    $val2 = $this->MAINCFG->getValue($cat,$key2,TRUE);
                                    
                                    # we add a line in the form
                                    $ret[] = "<tr>";
                                    $ret[] = "\t<td class=\"tdlabel\">".$key2."</td>";
                                    
                                    if(preg_match('/^TranslationNotFound:/',$this->LANG->getLabel($key2,'',FALSE)) > 0) {
                                          $ret[] = "\t<td class=\"tdfield\"></td>";
                                    } else {
                                          $ret[] = "\t<td class=\"tdfield\">";
                                          $ret[] = "\t\t<img style=\"cursor:help\" src=\"./images/internal/help_icon.png\" onclick=\"javascript:alert('".$this->LANG->getLabel($key2,'',FALSE)." (".$this->LANG->getLabel('defaultValue').": ".$this->MAINCFG->validConfig[$cat][$key2]['default'].")')\" />";
                                          $ret[] = "\t</td>";
                                    }
                                    
                                    $ret[] = "\t<td class=\"tdfield\">";
                                    switch($key2) {
                                          case 'language':
                                          case 'backend':
                                          case 'icons':
                                          case 'rotatemaps':
                                          case 'displayheader':
                                          case 'recognizeservices':
                                          case 'onlyhardstates':
                                          case 'usegdlibs':
                                          case 'autoupdatefreq':
                                          case 'headertemplate':
                                                switch($key2) {
                                                      case 'language':
                                                            $arrOpts = $this->getLanguages();
                                                      break;
                                                      case 'backend':
                                                            $arrOpts = $this->getBackends();
                                                      break;
                                                      case 'icons':
                                                            $arrOpts = $this->getIconsets();
                                                      break;
                                                      case 'headertemplate':
                                                            $arrOpts = $this->getHeaderTemplates();
                                                      break;
                                                      case 'rotatemaps':
                                                      case 'displayheader':
                                                      case 'recognizeservices':
                                                      case 'onlyhardstates':
                                                      case 'usegdlibs':
                                                            $arrOpts = Array(Array('value'=>'1','label'=>$this->LANG->getLabel('yes')),
                                                                                     Array('value'=>'0','label'=>$this->LANG->getLabel('no')));
                                                      break;
                                                      case 'autoupdatefreq':
                                                            $arrOpts = Array(Array('value'=>'0','label'=>$this->LANG->getLabel('disabled')),
                                                                                     Array('value'=>'2','label'=>'2'),
                                                                                     Array('value'=>'5','label'=>'5'),
                                                                                     Array('value'=>'10','label'=>'10'),
                                                                                     Array('value'=>'25','label'=>'25'),
                                                                                     Array('value'=>'50','label'=>'50'));
                                                      break;
                                                }
                                                
                                                $ret = array_merge($ret,$this->FORM->getSelectField("conf_".$key2,$arrOpts));
                                          break;
                                          default:
                                                $ret = array_merge($ret,$this->FORM->getInputField("conf_".$key2,$val2));
                                                
                                                if(isset($prop['locked']) && $prop['locked'] == 1) {
                                                      $ret[] = "<script>document.edit_config.elements['conf_".$key2."'].disabled=true;</script>";
                                                }
                                                
                                                if(is_array($val2)) {
                                                      $val2 = implode(',',$val2);
                                                }
                                          break;
                                    }
                                    $ret[] = "\t\t<script>document.edit_config.elements['conf_".$key2."'].value='".$val2."';</script>";
                                    $ret[] = "\t</td>";
                                    $ret[] = "</tr>";
                              }
                        }
                  }
            }
            if (DEBUG&&DEBUGLEVEL&1) debug('End method WuiEditMainCfg::getFields(): Array(HTML)');
            return $ret;
      }


Generated by  Doxygen 1.6.0   Back to index