New attribute 'display_style' for Strings, Enums and ExternalKeys: when the list is short, display it as a set of radio buttons instead of a drop-down list. Possible values: 'radio', 'radio_vertical' and 'radio_horizontal'. ('radio' == 'radio_vertical').

SVN:trunk[1426]
This commit is contained in:
Denis Flaven
2011-08-06 09:51:06 +00:00
parent 61727aca02
commit 23b1d15b64
4 changed files with 138 additions and 47 deletions

View File

@@ -1109,6 +1109,11 @@ class AttributeString extends AttributeDBField
$sEscaped = str_replace($sFrom, $sTo, (string)$sValue);
return $sTextQualifier.$sEscaped.$sTextQualifier;
}
public function GetDisplayStyle()
{
return $this->GetOptional('display_style', 'select');
}
}
/**
@@ -2355,6 +2360,7 @@ class AttributeExternalKey extends AttributeDBFieldVoid
public function GetTargetClass($iType = EXTKEY_RELATIVE) {return $this->Get("targetclass");}
public function GetKeyAttDef($iType = EXTKEY_RELATIVE){return $this;}
public function GetKeyAttCode() {return $this->GetCode();}
public function GetDisplayStyle() { return $this->GetOptional('display_style', 'select'); }
public function GetDefaultValue() {return 0;}