protected function shouldRenderToolBarElement($element, $elementInformation) { assert('$element instanceof ActionElement'); assert('is_array($elementInformation)'); if (!parent::shouldRenderToolBarElement($element, $elementInformation)) { return false; } $modelClassName = $this->modelClassName; //Todo: figure out how to not need to new up a new model. return ActionSecurityUtil::canCurrentUserPerformAction($element->getActionType(), new $modelClassName(false)); }
protected function shouldRenderToolBarElement($element, $elementInformation) { assert('$element instanceof ActionElement'); assert('is_array($elementInformation)'); if (!parent::shouldRenderToolBarElement($element, $elementInformation)) { return false; } // If element is ListByRelatedModelLink and there are no related items, do not show this element if ($element instanceof ListByRelatedModelLinkActionElement) { if ($this->getDataProvider()->totalItemCount <= 0) { return false; } } $modelClassName = $this->modelClassName; //Todo: figure out how to not need to new up a new model. return ActionSecurityUtil::canCurrentUserPerformAction($element->getActionType(), new $modelClassName(false)); }
protected function getCGridViewColumns() { $columns = parent::getCGridViewColumns(); $firstColumn = array('class' => 'CampaignItemsDrillDownColumn', 'id' => $this->gridId . $this->gridIdSuffix . '-rowDrillDown', 'htmlOptions' => array('class' => 'hasDrillDownLink')); array_unshift($columns, $firstColumn); return $columns; }
protected function getCGridViewParams() { return array_merge(parent::getCGridViewParams(), array('hideHeader' => true)); }