コード例 #1
0
 /**
  * Render the dashboard.
  *
  * @param SidebarPanelPair $result
  *
  * @return mixed
  */
 protected function renderDashboard(SidebarPanelPair $result)
 {
     $panel = $result->getPanel();
     // Redirect the user if we actually get a redirect response instead of
     // a panel.
     if ($panel instanceof RedirectResponse) {
         return $panel;
     }
     // Show any alerts on the top of the panel (if any).
     if (count($this->alerts->peekAll()) > 0) {
         $panel = new Div([], [new AlertPresenter($this->alerts), $panel]);
     }
     if ($result->hasSidebar()) {
         return (new ConferencePage($this->context, $this->dashboard, $panel, $result->getSidebar()))->render();
     }
     return (new ConferencePage($this->context, $this->dashboard, $panel))->render();
 }
コード例 #2
0
 /**
  * Push an alert informing the user about missing fields.
  *
  * @param string[] $missingFields
  */
 protected function pushMissingAlert($missingFields)
 {
     $this->alerts->push($missingFields, Alert::TYPE_VALIDATION, 'The following fields are missing:', 'alerts.validation');
 }
コード例 #3
0
 /**
  * Construct an instance of a AlertPresenter.
  *
  * @param AlertManager $manager
  */
 public function __construct(AlertManager $manager)
 {
     parent::__construct();
     $this->alerts = $manager->all();
 }