コード例 #1
0
 /**
  * Render a toolbar above the form layout. This includes
  * a link to edit the dashboard as well as a link to add
  * portlets to the dashboard
  * @return A string containing the element's content.
  */
 protected function renderActionElementBar($renderedInForm)
 {
     $content = parent::renderActionElementBar($renderedInForm);
     $deleteDashboardLinkActionElement = new DeleteDashboardMenuActionElement($this->controllerId, $this->moduleId, $this->modelId, array('htmlOptions' => array('confirm' => Zurmo::t('HomeModule', 'Are you sure want to delete this dashboard?')), 'iconClass' => 'icon-delete'));
     $pushDashboardLinkActionElement = new PushDashboardLinkActionElement($this->controllerId, $this->moduleId, $this->modelId, array('htmlOptions' => array('id' => 'PushDashboardLink'), 'iconClass' => 'icon-push-dashboard'));
     if (ActionSecurityUtil::canCurrentUserPerformAction($deleteDashboardLinkActionElement->getActionType(), $this->model) && !$this->isDefaultDashboard) {
         $content .= $deleteDashboardLinkActionElement->render();
     }
     if (PushDashboardUtil::canCurrentUserPushDashboardOrLayout()) {
         $content .= $pushDashboardLinkActionElement->render();
     }
     $content .= $this->renderChangeDashboardMenuActionContent();
     return $content;
 }
 protected function renderPushLayoutButton()
 {
     if (PushDashboardUtil::canCurrentUserPushDashboardOrLayout()) {
         $pushLayoutLinkActionElement = new PushLayoutLinkActionElement($this->controllerId, $this->moduleId, $this->modelId, array('htmlOptions' => array('id' => 'PushLayoutLink'), 'iconClass' => 'icon-change-dashboard'));
         return $pushLayoutLinkActionElement->render();
     }
 }