/** * Handle the event. */ public function handle() { if (in_array($this->request->path(), ['admin/logout'])) { return; } if ($this->request->segment(1) !== 'admin') { return; } $this->template->put('cp', $this->controlPanel->build()); }
/** * Handle the command. * * @param Container $container * @param ViewTemplate $template * @param BreadcrumbCollection $breadcrumbs */ public function handle(Container $container, ViewTemplate $template, BreadcrumbCollection $breadcrumbs) { $tree = $this->builder->getTree(); $tree->addData('tree', $tree); if ($handler = $tree->getOption('data')) { $container->call($handler, compact('tree')); } if ($layout = $tree->getOption('layout_view')) { $template->put('layout', $layout); } if ($title = $tree->getOption('title')) { $template->put('title', $title); } if ($breadcrumb = $tree->getOption('breadcrumb')) { $breadcrumbs->put($breadcrumb, '#'); } }
/** * Handle the command. * * @param Container $container * @param ViewTemplate $template * @param BreadcrumbCollection $breadcrumbs */ public function handle(Container $container, ViewTemplate $template, BreadcrumbCollection $breadcrumbs) { $form = $this->builder->getForm(); if ($handler = $form->getOption('data')) { $container->call($handler, compact('form')); } if ($layout = $form->getOption('layout_view')) { $template->put('layout', $layout); } if ($title = $form->getOption('title')) { $template->put('title', $title); } // Move this to options so we can read it. $this->builder->setFormOption('read_only', $this->builder->isReadOnly()); $form->addData('form', $form); if ($breadcrumb = $form->getOption('breadcrumb', 'streams::form.mode.' . $this->builder->getFormMode())) { $breadcrumbs->put($breadcrumb, '#'); } }