Exemplo n.º 1
0
 public function actionDashboardDetails()
 {
     $params = array('controllerId' => $this->getId(), 'moduleId' => $this->getModule()->getId());
     $gridViewId = 'notUsed';
     $pageVar = 'notUsed';
     $introCookieValue = Yii::app()->request->cookies[MarketingDashboardIntroView::resolveCookieId()];
     $actionBarView = new SecuredActionBarForMarketingSearchAndListView('default', 'marketing', new EmailTemplate(), $gridViewId, $pageVar, false, 'MarketingDashboardLink');
     $actionBarView->setIntroCookieValue($introCookieValue);
     $introView = new MarketingDashboardIntroView($introCookieValue);
     $marketingDashboardView = new MarketingDashboardView($this->getId(), $this->getModule()->getId(), 'MarketingDashboard', $params);
     $marketingDashboardView->setCssClasses(array('clearfix'));
     //todo: don't show introView if hidden
     $gridView = new GridView(3, 1);
     $gridView->setView($actionBarView, 0, 0);
     $gridView->setView($introView, 1, 0);
     $gridView->setView($marketingDashboardView, 2, 0);
     $breadcrumbLinks = static::getDashboardBreadcrumbLinks();
     $view = new MarketingPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $gridView, $breadcrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
 protected function registerScripts()
 {
     $script = "\$('#" . MarketingDashboardIntroView::PANEL_ID . "-checkbox-id').click(function()\n                        {\n                            if (!\$(this).attr('checked'))\n                            {\n                                document.cookie = '" . MarketingDashboardIntroView::resolveCookieId() . "=" . MarketingDashboardIntroView::HIDDEN_COOKIE_VALUE . "';\n                            }\n                            else\n                            {\n                                document.cookie = '" . MarketingDashboardIntroView::resolveCookieId() . "=';\n                            }\n                            \$('#" . MarketingDashboardIntroView::PANEL_ID . "').slideToggle();\n                        });";
     Yii::app()->clientScript->registerScript(get_class() . 'CheckBoxClickScript', $script);
 }