public function __construct($renderType, $controllerId, $moduleId, $model, $title) { parent::__construct($renderType, $controllerId, $moduleId, $model); $this->title = $title; $user = $this->model->user; self::$notificationConfigurationPanels = $this->resolveNotificationConfigurationViewContentByUserType($user); }
protected function resolveElementInformationDuringFormLayoutRender(&$elementInformation) { parent::resolveElementInformationDuringFormLayoutRender($elementInformation); if ($elementInformation['attributeName'] == 'primary') { $elementInformation['disabled'] = true; } }
protected function renderFormLayout($form = null) { $baseUrl = Yii::app()->createAbsoluteUrl('sendGrid/external/writeLog'); $text = SendGridUtil::renderEventWebHookUrlOnForm($this->model, 'username', '30%'); SendGridUtil::registerEventWebhookUrlScript('SendGridWebApiConfigurationForm_username', $baseUrl); return $text . parent::renderFormLayout($form); }
protected function resolveActionElementInformationDuringRender(&$elementInformation) { parent::resolveActionElementInformationDuringRender($elementInformation); if ($elementInformation['type'] == 'SaveButton') { $metadata = $this->externalViewMetadata; $elementInformation['label'] = $metadata['global']['toolbar']['elements'][0]['label']; } }
/** * Override to check for delete rights * Checks for $elementInformation['resolveToDisplay'] to be present and if it is, * will run the resolveName as a function on the group model. * @param $element * @param $elementInformation * @return bool */ protected function shouldRenderToolBarElement($element, $elementInformation) { assert('$element instanceof ActionElement'); assert('is_array($elementInformation)'); if (!parent::shouldRenderToolBarElement($element, $elementInformation)) { return false; } $actionType = $element->getActionType(); if ($actionType == null || $actionType != 'Delete') { return true; } return RightsUtil::doesUserHaveAllowByRightName('RolesModule', $actionType, Yii::app()->user->userModel); }
/** * Override to check for different scenarios depending on if the group is * special or not. Everyone and SuperAdministrators are special groups * for example. * Checks for $elementInformation['resolveToDisplay'] to be present and if it is, * will run the resolveName as a function on the group model. * @param $element * @param $elementInformation * @return bool */ protected function shouldRenderToolBarElement($element, $elementInformation) { assert('$element instanceof ActionElement'); assert('is_array($elementInformation)'); if (!parent::shouldRenderToolBarElement($element, $elementInformation)) { return false; } if (isset($elementInformation['resolveToDisplay'])) { $resolveMethodName = $elementInformation['resolveToDisplay']; if (!$this->model->{$resolveMethodName}()) { return false; } } $actionType = $element->getActionType(); if ($actionType == null || $actionType != 'Delete') { return true; } return RightsUtil::doesUserHaveAllowByRightName('GroupsModule', GroupsModule::RIGHT_DELETE_GROUPS, Yii::app()->user->userModel); }
protected function renderAfterFormLayoutForDetailsContent() { $content = parent::renderAfterFormLayoutForDetailsContent(); $ownedSecurableItemDetailsContent = OwnedSecurableItemDetailsViewUtil::renderAfterFormLayoutForDetailsContent($this->getModel(), $content); return $ownedSecurableItemDetailsContent; }