本文整理汇总了PHP中QControl类的典型用法代码示例。如果您正苦于以下问题:PHP QControl类的具体用法?PHP QControl怎么用?PHP QControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ValidateControlAndChildren
protected function ValidateControlAndChildren(QControl $objControl)
{
// Initially Assume Validation is True
$blnToReturn = true;
// Check the Control Itself
if (!$objControl->Validate()) {
$objControl->MarkAsModified();
$blnToReturn = false;
}
// Recursive call on Child Controls
foreach ($objControl->GetChildControls() as $objChildControl) {
// Only Enabled and Visible and Rendered controls should be validated
if ($objChildControl->Visible && $objChildControl->Enabled && $objChildControl->RenderMethod && $objChildControl->OnPage) {
if (!$this->ValidateControlAndChildren($objChildControl)) {
$blnToReturn = false;
}
}
}
return $blnToReturn;
}
示例2: Wakeup
/**
* @param QForm $objForm
*/
public function Wakeup(QForm $objForm)
{
parent::Wakeup($objForm);
$this->objDataBinder = QControl::WakeupHelper($objForm, $this->objDataBinder);
}
示例3: Wakeup
/**
* Restore references.
*
* @param QForm $objForm
*/
public function Wakeup(QForm $objForm)
{
parent::Wakeup($objForm);
$this->objRowParamsCallback = QControl::WakeupHelper($objForm, $this->objRowParamsCallback);
if ($this->objColumnArray) {
foreach ($this->objColumnArray as $objColumn) {
$objColumn->Wakeup($objForm);
}
}
}
示例4: helpTest
protected function helpTest($objTestDataArray, $objProperiesArray, $strGetStyleMethod = "GetWrapperStyleAttributes")
{
foreach ($objProperiesArray as $strProperty => $strCssProperty) {
$strValue = $objTestDataArray["Value"];
if ($strProperty) {
$this->ctlTest->{$strProperty} = $strValue;
} else {
$this->ctlTest->SetCustomStyle($strCssProperty, $strValue);
}
$strAttrs = $this->ctlTest->{$strGetStyleMethod}();
$intResult = strpos($strAttrs, $strCssProperty . ':' . $objTestDataArray["Expected"]);
$strMessage = $objTestDataArray["Msg"] . " Expected: '" . $objTestDataArray["Expected"] . "'" . " Obtained: '" . $strAttrs . "'";
$this->assertTrue(false !== $intResult, $strMessage);
}
}
示例5: GetEndScript
public function GetEndScript()
{
$strId = $this->ControlId;
$strJs = parent::GetEndScript();
$strJs .= ';';
$strJs .= "\$j('#{$strId}').change(function(event) {\n\t\t\tqcubed.setAdditionalPostVar('{$strId}_extra', {txt: \$j(this).val(), 'nullVal': null});\n\t\t\tqcubed.recordControlModification('{$strId}', 'Name', \$j(this).val());\n\t\t\t})";
return $strJs;
}
示例6: __construct
public function __construct($objParentObject, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->objParentObject = $objParentObject;
$this->dlgAssetModelSearchTool_Create();
}
示例7: __set
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
case 'CalendarImageSource':
try {
return $this->strCalendarImageSource = QType::Cast($mixValue, QType::Integer);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
return parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例8: __set
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
case "SelectedIndex":
try {
$mixValue = QType::Cast($mixValue, QType::Integer);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// Special Case
if ($mixValue == -1) {
$mixValue = null;
}
if ($mixValue < 0 || $mixValue > count($this->objItemsArray) - 1) {
throw new QIndexOutOfRangeException($mixValue, "SelectedIndex");
}
for ($intIndex = 0; $intIndex < count($this->objItemsArray); $intIndex++) {
if ($mixValue == $intIndex) {
$this->objItemsArray[$intIndex]->Selected = true;
} else {
$this->objItemsArray[$intIndex]->Selected = false;
}
}
return $mixValue;
break;
case "SelectedName":
foreach ($this->objItemsArray as $objItem) {
if ($objItem->Name == $mixValue) {
$objItem->Selected = true;
} else {
$objItem->Selected = false;
}
}
return $mixValue;
break;
case "SelectedValue":
foreach ($this->objItemsArray as $objItem) {
if ($objItem->Value == $mixValue) {
$objItem->Selected = true;
} else {
$objItem->Selected = false;
}
}
return $mixValue;
break;
case "SelectedNames":
try {
$mixValue = QType::Cast($mixValue, QType::ArrayType);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
foreach ($this->objItemsArray as $objItem) {
$objItem->Selected = false;
foreach ($mixValue as $mixName) {
if ($objItem->Name == $mixName) {
$objItem->Selected = true;
break;
}
}
}
return $mixValue;
break;
case "SelectedValues":
try {
$mixValue = QType::Cast($mixValue, QType::ArrayType);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
foreach ($this->objItemsArray as $objItem) {
$objItem->Selected = false;
foreach ($mixValue as $mixName) {
if ($objItem->Value == $mixName) {
$objItem->Selected = true;
break;
}
}
}
return $mixValue;
break;
case "SelectedIndexes":
try {
$intIndexArray = QType::Cast($mixValue, QType::ArrayType);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
//First remove all indexes
$this->SelectedIndex = -1;
//Assign selected
foreach ($intIndexArray as $intIndex) {
if ($this->objItemsArray[$intIndex]) {
$this->objItemsArray[$intIndex]->Selected = true;
} else {
throw new QIndexOutOfRangeException($intIndex, "SelectedIndexes");
}
}
//.........这里部分代码省略.........
示例9: __set
/**
* PHP magic method
*
* @param string $strName Property name
* @param string $mixValue Property value
*
* @return mixed
* @throws Exception|QCallerException
*/
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
// Deprecated
case 'TargetControlId':
try {
return $this->strTargetControlId = QType::Cast($mixValue, QType::String);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
return parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例10: __set
public function __set($strName, $mixValue) {
$this->blnModified = true;
switch ($strName) {
// APPEARANCE
case "Text":
try {
$this->strText = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "TextAlign":
try {
$this->strTextAlign = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "HtmlEntities":
try {
$this->blnHtmlEntities = QType::Cast($mixValue, QType::Boolean);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// MISC
case "Checked":
try {
$this->blnChecked = QType::Cast($mixValue, QType::Boolean);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
parent::__set($strName, $mixValue);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例11: __set
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
case "objInventoryLocationArray":
$this->objInventoryLocationArray = $mixValue;
break;
case "strTitleVerb":
$this->strTitleVerb = $mixValue;
break;
case "blnEditMode":
$this->blnEditMode = $mixValue;
break;
case "dtgInventoryTransact":
$this->dtgInventoryTransact = $mixValue;
break;
case "intTransactionTypeId":
$this->intTransactionTypeId = $mixValue;
break;
default:
try {
parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
}
}
示例12: __set
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
// APPEARANCE
case "Text":
try {
$this->strText = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Format":
try {
$this->strFormat = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Template":
try {
if ($mixValue) {
if (file_exists($mixValue)) {
$this->strTemplate = QType::Cast($mixValue, QType::String);
} else {
throw new QCallerException('Template file does not exist: ' . $mixValue);
}
} else {
$this->strTemplate = null;
}
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "AutoRenderChildren":
try {
$this->blnAutoRenderChildren = QType::Cast($mixValue, QType::Boolean);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "TagName":
try {
$this->strTagName = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "HtmlEntities":
try {
$this->blnHtmlEntities = QType::Cast($mixValue, QType::Boolean);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Padding":
try {
$this->strPadding = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "DropTarget":
try {
$this->blnDropTarget = QType::Cast($mixValue, QType::Boolean);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "HorizontalAlign":
try {
$this->strHorizontalAlign = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "VerticalAlign":
try {
$this->strVerticalAlign = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "ResizeHandleDirection":
try {
$this->strResizeHandleDirection = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
//.........这里部分代码省略.........
示例13: __set
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
// APPEARANCE
case "Text":
try {
$this->strText = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "TagName":
try {
$this->strTagName = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Padding":
try {
$this->strPadding = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "HorizontalAlign":
try {
$this->strHorizontalAlign = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "VerticalAlign":
try {
$this->strVerticalAlign = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
}
}
示例14: __set
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
case "objAsset":
$this->objAsset = $mixValue;
break;
case "blnEditMode":
$this->blnEditMode = $mixValue;
break;
case "strTitleVerb":
$this->strTitleVerb = $mixValue;
break;
case "dtgAssetTransaction":
$this->dtgAssetTransaction = $mixValue;
break;
default:
try {
parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
}
}
示例15: __set
/**
* PHP __set magic method implementation
* @param string $strName Name of the property
* @param string $mixValue Value of the property
*
* @throws Exception|QCallerException
* @throws Exception|QInvalidCastException
*/
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
// APPEARANCE
case "Columns":
try {
$this->intColumns = QType::Cast($mixValue, QType::Integer);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Format":
try {
$this->strFormat = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Text":
try {
$this->strText = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "LabelForRequired":
try {
$this->strLabelForRequired = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "LabelForRequiredUnnamed":
try {
$this->strLabelForRequiredUnnamed = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "LabelForTooShort":
try {
$this->strLabelForTooShort = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "LabelForTooShortUnnamed":
try {
$this->strLabelForTooShortUnnamed = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "LabelForTooLong":
try {
$this->strLabelForTooLong = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "LabelForTooLongUnnamed":
try {
$this->strLabelForTooLongUnnamed = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Placeholder":
try {
$this->strPlaceholder = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// BEHAVIOR
// BEHAVIOR
case "CrossScripting":
try {
$this->strCrossScripting = QType::Cast($mixValue, QType::String);
// Protect from XSS to the best we can do with HTMLPurifier.
if ($this->strCrossScripting == QCrossScripting::HTMLPurifier) {
//.........这里部分代码省略.........