Skip to content

Commit

Permalink
Added HtmlEntities support to QListBoxBase
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeho committed Apr 22, 2009
1 parent 9ff7d7f commit 65dd718
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions wwwroot/includes/qcodo/_core/qform/QListBoxBase.class.php
Expand Up @@ -17,6 +17,8 @@ abstract class QListBoxBase extends QListControl {
protected $strLabelForRequiredUnnamed;
protected $objItemStyle = null;

protected $blnHtmlEntities = true;

// BEHAVIOR
protected $strSelectionMode = QSelectionMode::Single;

Expand Down Expand Up @@ -92,7 +94,7 @@ protected function GetItemHtml($objItem, $intIndex) {
$intIndex,
($objItem->Selected) ? 'selected="selected"' : "",
$objStyle->GetAttributes(),
QApplication::HtmlEntities($objItem->Name)
($this->blnHtmlEntities) ? QApplication::HtmlEntities($objItem->Name) : $objItem->Name
);

return $strToReturn;
Expand Down Expand Up @@ -186,7 +188,8 @@ public function __get($strName) {
case "LabelForRequired": return $this->strLabelForRequired;
case "LabelForRequiredUnnamed": return $this->strLabelForRequiredUnnamed;
case "ItemStyle": return $this->objItemStyle;

case "HtmlEntities": return $this->blnHtmlEntities;

// BEHAVIOR
case "SelectionMode": return $this->strSelectionMode;

Expand Down Expand Up @@ -232,6 +235,14 @@ public function __set($strName, $mixValue) {
$objExc->IncrementOffset();
throw $objExc;
}
case "HtmlEntities":
try {
$this->blnHtmlEntities = QType::Cast($mixValue, QType::Boolean);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}

// BEHAVIOR
case "SelectionMode":
Expand Down

0 comments on commit 65dd718

Please sign in to comment.