示例#1
0
 public function getTitle()
 {
     if (!$this->title) {
         $this->title = $this->component->getTitle();
     }
     return $this->title;
 }
示例#2
0
 /**
  * On POST requests, save the new settings to the filter, set a success
  * message and redirect back to the component's listing.
  *
  * @param ResponseHelper $responseHelper
  */
 public function process(ResponseHelper $responseHelper)
 {
     if ($this->request->isPost()) {
         $responseHelper->run('save', function () {
             $this->filter->save(json_decode($this->request->getPost('sorted_fields'), true));
         });
         $responseHelper->setSuccessMessage("Successfully sorted and grouped {$this->component->getTitle()} fields")->redirectToAdminPage('index');
     }
 }
示例#3
0
 /**
  * Assemble elements from the component and a Counter object and pass them along
  * to the view.
  */
 public function render()
 {
     $fields = $this->component->getFields();
     $selected = $fields->getVisibleFields()->getByQueryStringId($this->request->getQuery('group_field'));
     $counter = new Counter($selected, $fields, $this->component->getListing());
     $renderer = $this->view->csvCellRenderer();
     $this->component->setShouldRenderLayout(false);
     $this->view->assign(['title' => $this->component->getTitle(), 'selected' => $selected, 'fields' => $counter->buildRenderFields(), 'data' => $counter->fetchData($renderer), 'renderer' => $renderer]);
     return $this->renderView();
 }
示例#4
0
 /**
  * Assemble elements from the component and a Counter object and pass them along
  * to the view.
  */
 public function render()
 {
     $fields = $this->component->getFields();
     $selected = null;
     $counter = null;
     $renderer = $this->view->tableCellRenderer();
     if ($this->request->getQuery('group_field')) {
         $selected = $fields->getVisibleFields()->getByQueryStringId($this->request->getQuery('group_field'));
         $counter = new Counter($selected, $fields, $this->component->getListing());
     }
     $this->view->assign(['title' => $this->component->getTitle(), 'model' => $this->component->getPrimaryModel(), 'fields' => $this->component->getFields(), 'listing' => $this->component->getListing(), 'renderer' => $renderer, 'selectedField' => $selected ? $selected->getQueryStringId() : null, 'countFields' => $counter ? $counter->buildRenderFields() : null, 'data' => $selected ? $counter->fetchData($renderer) : [], 'request' => $this->request]);
     return $this->renderView();
 }
示例#5
0
 public function render()
 {
     $handler = $this->component->getActivityLogHandler();
     $currentPage = $this->request->getQuery('listing-page', 1);
     $criteria = ['handlers' => $handler, 'limit' => $this->pageSize, 'offset' => ($currentPage - 1) * $this->pageSize];
     if ($this->request->getQuery('id')) {
         $entity = $handler->createEntity($this->request->getQuery('id'));
         $criteria['entities'] = $entity;
         $this->view->assign('entity', $entity);
     }
     $entries = $this->getActivityLog()->getEntries($criteria);
     $this->view->assign('entries', $entries)->assign('title', $this->component->getTitle())->assign('entryCount', $entries->getTotalCount())->assign('pageSize', $this->pageSize)->assign('currentPage', $currentPage);
 }
示例#6
0
 public function render()
 {
     $this->view->assign(['title' => $this->component->getTitle(), 'model' => $this->component->getPrimaryModel(), 'dataCopier' => $this->component->getDataCopier()]);
 }