/** * PHP magic method * * @param string $strName Property name * @param string $mixValue Property value * * @return mixed|void * @throws Exception|QCallerException|QInvalidCastException */ public function __set($strName, $mixValue) { switch ($strName) { // APPEARANCE case "Template": try { $this->blnModified = true; if ($mixValue) { if (file_exists($strPath = $this->GetTemplatePath($mixValue))) { $this->strTemplate = QType::Cast($strPath, QType::String); } else { throw new QCallerException('Could not find template file: ' . $mixValue); } } else { $this->strTemplate = null; } break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "TagName": try { $this->blnModified = true; $this->strTagName = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ItemTagName': try { $this->blnModified = true; $this->strItemTagName = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ItemHtmlCallback': $this->blnModified = true; if (is_array($mixValue) && reset($mixValue) === $this->objForm) { // Do not pass [$objForm, 'methodName']. Rather, just set to 'methodName', and the form will be searched for that method. throw new QCallerException('Do not pass the form object in a callable array. Instead, just pass the method name.'); } $this->itemHtmlCallback = $mixValue; break; case 'ItemAttributeCallback': // callback should return an array of key/value items $this->blnModified = true; if (is_array($mixValue) && reset($mixValue) === $this->objForm) { // Do not pass [$objForm, 'methodName']. Rather, just set to 'methodName', and the form will be searched for that method. throw new QCallerException('Do not pass the form object in a callable array. Instead, just pass the method name.'); } $this->itemAttributeCallback = $mixValue; break; case 'ItemInnerHtmlCallback': $this->blnModified = true; if (is_array($mixValue) && reset($mixValue) === $this->objForm) { // Do not pass [$objForm, 'methodName']. Rather, just set to 'methodName', and the form will be searched for that method. throw new QCallerException('Do not pass the form object in a callable array. Instead, just pass the method name.'); } $this->itemInnerHtmlCallback = $mixValue; break; default: try { parent::__set($strName, $mixValue); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } break; } }
/** * Returns an description of the options available to modify by the designer for the code generator. * * @return QModelConnectorParam[] */ public static function GetModelConnectorParams() { return array_merge(parent::GetModelConnectorParams(), array(new QModelConnectorParam(get_called_class(), 'RowCssClass', 'Css class given to each row', QType::String), new QModelConnectorParam(get_called_class(), 'AlternateRowCssClass', 'Css class given to every other row', QType::String), new QModelConnectorParam(get_called_class(), 'HeaderRowCssClass', 'Css class given to the header rows', QType::String), new QModelConnectorParam(get_called_class(), 'ShowHeader', 'Whether or not to show the header. Default is true.', QType::Boolean), new QModelConnectorParam(get_called_class(), 'ShowFooter', 'Whether or not to show the footer. Default is false.', QType::Boolean), new QModelConnectorParam(get_called_class(), 'RenderColumnTags', 'Whether or not to render html column tags for the columns. Column tags are only needed in special situations. Default is false.', QType::Boolean), new QModelConnectorParam(get_called_class(), 'Caption', 'Text to print in the caption tag of the table.', QType::String), new QModelConnectorParam(get_called_class(), 'HideIfEmpty', 'Whether to draw nothing if there is no data, or draw the table tags with no cells instead. Default is to drag the table tags.', QType::Boolean))); }
public function __set($strName, $mixValue) { switch ($strName) { // APPEARANCE case "AlternateRowStyle": try { $this->objAlternateRowStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "BorderCollapse": try { $this->strBorderCollapse = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "HeaderRowStyle": try { $this->objHeaderRowStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "HeaderLinkStyle": try { $this->objHeaderLinkStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "RowStyle": try { $this->objRowStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // BEHAVIOR // BEHAVIOR case "UseAjax": try { $blnToReturn = parent::__set($strName, $mixValue); } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // Because we are switching to/from Ajax, we need to reset the events $this->RemoveAllActions('onclick'); if ($this->blnUseAjax) { $this->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'Sort_Click')); } else { $this->AddAction(new QClickEvent(), new QServerControlAction($this, 'Sort_Click')); } $this->AddAction(new QClickEvent(), new QTerminateAction()); return $blnToReturn; // LAYOUT // LAYOUT case "CellPadding": try { $this->intCellPadding = QType::Cast($mixValue, QType::Integer); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "CellSpacing": try { $this->intCellSpacing = QType::Cast($mixValue, QType::Integer); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "GridLines": try { $this->strGridLines = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "ShowHeader": try { $this->blnShowHeader = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "ShowFooter": try { $this->blnShowFooter = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // MISC // MISC case "SortColumnIndex": try { $this->intSortColumnIndex = QType::Cast($mixValue, QType::Integer); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "SortDirection": if ($mixValue == 1) { $this->intSortDirection = 1; } else { $this->intSortDirection = 0; } break; case 'LabelForNoneFound': try { $this->strLabelForNoneFound = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'LabelForOneFound': try { $this->strLabelForOneFound = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'LabelForMultipleFound': try { $this->strLabelForMultipleFound = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'LabelForPaginated': try { $this->strLabelForPaginated = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } default: try { parent::__set($strName, $mixValue); break; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
public function __set($strName, $mixValue) { $this->blnModified = true; switch ($strName) { // APPEARANCE case "Template": try { if (file_exists($mixValue)) { $this->strTemplate = QType::Cast($mixValue, QType::String); } else { throw new QCallerException('Template file does not exist: ' . $mixValue); } 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; } default: try { parent::__set($strName, $mixValue); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } break; } }
public function __set($strName, $mixValue) { switch ($strName) { case "RowCssClass": try { $this->strRowCssClass = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "AlternateRowCssClass": try { $this->strAlternateRowCssClass = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "HeaderRowCssClass": try { $this->strHeaderRowCssClass = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "ShowHeader": try { $this->blnShowHeader = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "ShowFooter": try { $this->blnShowFooter = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "RenderColumnTags": try { $this->blnRenderColumnTags = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "Caption": try { $this->strCaption = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } default: try { parent::__set($strName, $mixValue); break; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
public function __set($strName, $mixValue) { switch ($strName) { // APPEARANCE case "AlternateRowStyle": try { $this->objAlternateRowStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "BorderCollapse": try { $this->strBorderCollapse = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "HeaderRowStyle": try { $this->objHeaderRowStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "HeaderLinkStyle": try { $this->objHeaderLinkStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "FilterRowStyle": try { $this->objFilterRowStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "RowStyle": try { $this->objRowStyle = QType::Cast($mixValue, "QDataGridRowStyle"); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // BEHAVIOR // BEHAVIOR case "Paginator": //do whatever needs done try { $blnToReturn = parent::__set($strName, $mixValue); } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //Now make sure it knows about our spinner $this->objPaginator->WaitIcon = $this->objWaitIcon; return $blnToReturn; break; case "PaginatorAlternate": //do whatever needs done try { $blnToReturn = parent::__set($strName, $mixValue); } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //Now make sure it knows about our spinner $this->objPaginatorAlternate->WaitIcon = $this->objWaitIcon; return $blnToReturn; break; case "UseAjax": try { $blnToReturn = parent::__set($strName, $mixValue); } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // Because we are switching to/from Ajax, we need to reset the events $this->prxDatagridSorting->RemoveAllActions(QClickEvent::EventName); if ($this->blnUseAjax) { $this->prxDatagridSorting->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'Sort_Click', $this->objWaitIcon)); } else { $this->prxDatagridSorting->AddAction(new QClickEvent(), new QServerControlAction($this, 'Sort_Click')); } $this->prxDatagridSorting->AddAction(new QClickEvent(), new QTerminateAction()); $actionName = 'btnFilter_Click'; foreach ($this->objColumnArray as $objColumn) { if ($objColumn->HasFilter()) { $ctlFilter = $this->GetChildControl($this->GetColumnFilterControlId($objColumn)); if ($ctlFilter !== null) { $ctlFilter->RemoveAllActions(QKeyDownEvent::EventName); if ($this->blnUseAjax) { $ctlFilter->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, $actionName, $this->objWaitIcon)); } else { $ctlFilter->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, $actionName)); } $ctlFilter->AddAction(new QEnterKeyEvent(), new QTerminateAction()); } } } if (null !== $this->btnFilter) { $this->btnFilter->RemoveAllActions(QClickEvent::EventName); if ($this->blnUseAjax) { $this->btnFilter->AddAction(new QClickEvent(), new QAjaxControlAction($this, $actionName, $this->objWaitIcon)); } else { $this->btnFilter->AddAction(new QClickEvent(), new QServerControlAction($this, $actionName)); } $this->btnFilter->AddAction(new QClickEvent(), new QTerminateAction()); } foreach ($this->btnFilterResetArray as $btnFilterReset) { $btnFilterReset->RemoveAllActions(QClickEvent::EventName); if ($this->blnUseAjax) { $btnFilterReset->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnFilterReset_Click', $this->objWaitIcon)); } else { $btnFilterReset->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnFilterReset_Click')); } $btnFilterReset->AddAction(new QClickEvent(), new QTerminateAction()); } return $blnToReturn; // LAYOUT // LAYOUT case "CellPadding": try { $this->intCellPadding = QType::Cast($mixValue, QType::Integer); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "CellSpacing": try { $this->intCellSpacing = QType::Cast($mixValue, QType::Integer); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "GridLines": try { $this->strGridLines = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "ShowHeader": try { $this->blnShowHeader = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "ShowFooter": try { $this->blnShowFooter = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "ShowFilter": try { $this->blnShowFilter = QType::Cast($mixValue, QType::Boolean); // If the filter is being shown, the table gets its own wait icon. // When the wait icon changes we need to refresh a lot of actions // that would otherwise use the default wait icon. if ($this->blnShowFilter) { $this->objWaitIcon_Create(); } else { $this->objWaitIcon = "default"; } break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "ShowFilterButton": try { $this->blnShowFilterButton = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ShowFilterResetButton': try { $this->blnShowFilterResetButton = QType::Cast($mixValue, QType::Boolean); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // MISC // MISC case "SortColumnIndex": try { $this->intSortColumnIndex = QType::Cast($mixValue, QType::Integer); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case "SortDirection": if ($mixValue == 1) { $this->intSortDirection = 1; } else { $this->intSortDirection = 0; } break; case 'LabelForNoneFound': try { $this->strLabelForNoneFound = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'LabelForOneFound': try { $this->strLabelForOneFound = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'LabelForMultipleFound': try { $this->strLabelForMultipleFound = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'LabelForPaginated': try { $this->strLabelForPaginated = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'RowActionParameterHtml': try { $this->strRowActionParameterHtml = QType::Cast($mixValue, QType::String); break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Owner': try { $this->objOwner = $mixValue; break; } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } default: try { parent::__set($strName, $mixValue); break; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }