public function __set($strKey, $varValue)
{
switch ($strKey) {
case 'id':
$this->strId = $varValue;
break;
case 'name':
$this->strName = $varValue;
break;
case 'label':
$this->strLabel = $varValue;
break;
case 'value':
$this->varValue = \StringUtil::deserialize($varValue);
// Decrypt the value if it is encrypted
if ($this->arrConfiguration['encrypt']) {
$this->varValue = \Encryption::decrypt($this->varValue);
}
break;
case 'class':
if ($varValue != '' && strpos($this->strClass, $varValue) === false) {
$this->strClass = trim($this->strClass . ' ' . $varValue);
}
break;
case 'prefix':
$this->strPrefix = $varValue;
break;
case 'template':
$this->strTemplate = $varValue;
break;
case 'wizard':
$this->strWizard = $varValue;
break;
case 'autocomplete':
case 'autocorrect':
case 'autocapitalize':
case 'spellcheck':
if (is_bool($varValue)) {
$varValue = $varValue ? 'on' : 'off';
}
// Do not add a break; statement here
// Do not add a break; statement here
case 'alt':
case 'style':
case 'accesskey':
case 'onblur':
case 'onchange':
case 'onclick':
case 'ondblclick':
case 'onfocus':
case 'onmousedown':
case 'onmousemove':
case 'onmouseout':
case 'onmouseover':
case 'onmouseup':
case 'onkeydown':
case 'onkeypress':
case 'onkeyup':
case 'onselect':
$this->arrAttributes[$strKey] = $varValue;
break;
case 'tabindex':
if ($varValue > 0) {
$this->arrAttributes['tabindex'] = $varValue;
}
break;
case 'disabled':
case 'readonly':
$this->blnSubmitInput = $varValue ? false : true;
// Do not add a break; statement here
// Do not add a break; statement here
case 'autofocus':
if ($varValue) {
$this->arrAttributes[$strKey] = $strKey;
} else {
unset($this->arrAttributes[$strKey]);
}
break;
case 'required':
if ($varValue) {
$this->strClass = trim($this->strClass . ' mandatory');
}
// Do not add a break; statement here
// Do not add a break; statement here
case 'mandatory':
case 'nospace':
case 'allowHtml':
case 'storeFile':
case 'useHomeDir':
case 'storeValues':
case 'trailingSlash':
case 'spaceToUnderscore':
case 'doNotTrim':
$this->arrConfiguration[$strKey] = $varValue ? true : false;
break;
case 'forAttribute':
$this->blnForAttribute = $varValue;
break;
case 'dataContainer':
$this->objDca = $varValue;
break;
case strncmp($strKey, 'ng-', 3) === 0:
case strncmp($strKey, 'data-', 5) === 0:
$this->arrAttributes[$strKey] = $varValue;
break;
default:
$this->arrConfiguration[$strKey] = $varValue;
break;
}
}