Index: trunk/kernel/include/config.php =================================================================== diff -u -r1462 -r1566 --- trunk/kernel/include/config.php (.../config.php) (revision 1462) +++ trunk/kernel/include/config.php (.../config.php) (revision 1566) @@ -56,7 +56,18 @@ function Get($property) { - return isset($this->config[$property]) ? $this->config[$property] : ''; + if( isset($this->config[$property]) ) + { + return $this->config[$property]; + } + elseif( isset($this->config[ strtolower($property)] ) ) + { + return $this->config[ strtolower($property) ]; + } + else + { + return ''; + } } function Set($property, $value,$type=0,$force=FALSE) @@ -186,6 +197,8 @@ var $NextItem=NULL; var $Section; + var $TabIndex = 0; + function clsConfigAdminItem($config_name=NULL) { $this->adodbConnection = &GetADODBConnection(); @@ -254,118 +267,92 @@ return $string; } - function ItemFormElement($StartFrom=1) - { - global $objConfig; - static $TabIndex; + function ItemFormElement($StartFrom=1) + { + global $objConfig; - if (empty($TabIndex)) - $TabIndex = $StartFrom; + if(!$this->TabIndex) $this->TabIndex = $StartFrom; - $o = ""; - if($objConfig->Get($this->name)!="") - $this->default_value = $objConfig->Get($this->name); - $this->default_value=inp_htmlize($this->default_value); - switch($this->ElementType) - { - case "text": - $o .= "name."\" "; - $o .= "VALUE=\"".$this->default_value."\">"; - break; - case "checkbox": - $o .= "name."\" tabindex=\"".($TabIndex++)."\""; - if($this->default_value) - { - $o .= " CHECKED>"; - } - else - $o .= ">"; - - break; - case "password": - - /* To exclude config form from populating with Root (md5) password */ - if ($this->Section == "in-portal:configure_users") - $this->default_value = ""; + $o = ''; + if( $objConfig->Get($this->name) != '' ) + { + $this->default_value = $objConfig->Get($this->name); + } + $this->default_value = inp_htmlize($this->default_value); + switch($this->ElementType) + { + case 'text': + $o .= 'default_value.'">'; + break; + + case 'checkbox': + $o .= 'default_value ? ' checked>' : '>'; + break; + + case 'password': + /* To exclude config form from populating with Root (md5) password */ + if( $this->Section == 'in-portal:configure_users' ) $this->default_value = ''; - $o .= "name."\" "; - $o .= "VALUE=\"".$this->default_value."\">"; - break; - case "textarea": - $o .= ""; - break; - case "label": - if($this->default_value) - { - $o .= $this->default_value; - } - break; - case "radio": - $radioname = $this->name; - - $ValList = $this->replace_sql($this->ValueList); + $o .= 'default_value.'">'; + break; + + case 'textarea': + $o .= ''; + break; + + case 'label': + if($this->default_value) $o .= $this->default_value; + break; + + case 'radio': + $radioname = $this->name; + $ValList = $this->replace_sql($this->ValueList); - $TabIndex++; - $localTabIndex = $TabIndex; - $TabIndex++; - - $val = explode(",",$ValList); - for($i=0;$i<=count($val);$i++) - { - if(strlen($val[$i])) - { - $parts = explode("=",$val[$i]); - $s = $parts[1]; - if(strlen($s)==0) - $s=""; - - $o .= "name."\" VALUE=\"".$parts[0]."\""; - if($this->default_value==$parts[0]) - { - $o .= " CHECKED>"; - } - else - $o .= ">"; - if(substr($s,0,1)=="+") - { - $o .= $s; - } - else - $o .= prompt_language($s); - } - } - - break; - case "select": - $o .= ""; - } - return $o; - } + $this->TabIndex++; + $val = explode(',',$ValList); + for($i=0;$i<=count($val);$i++) + { + if(strlen($val[$i])) + { + $parts = explode('=',$val[$i]); + $s = $parts[1]; + if(strlen($s)==0) + $s = ''; + $o .= 'default_value == $parts[0]) ? ' checked>' : '>'; + + $o .= (substr($s,0,1)=="+") ? $s : prompt_language($s); + } + } + $this->TabIndex++; + break; + + case 'select': + $o .= ''; + break; + } + return $o; + } function GetPrompt() {