示例#1
0
 /**
  * @return VisibilityFilter
  */
 public function getVisibilityFilter()
 {
     if (!$this->visibilityFilter) {
         $this->visibilityFilter = $this->component->getVisibilityFilter();
     }
     return $this->visibilityFilter;
 }
示例#2
0
 /**
  * Grab the selected visible columns from POST and save them back to
  * the visibility filter.
  *
  * @param ResponseHelper $responseHelper
  */
 public function process(ResponseHelper $responseHelper)
 {
     $this->component->getPermissions()->haltIfNotAllowed('adjust-columns');
     $selections = $this->request->getPost('visible_columns');
     $applyToAllUsers = (bool) $this->request->getPost('apply_to_all_users', false);
     if (is_array($selections)) {
         /* @var $filter VisibilityFilter */
         $filter = $this->component->getVisibilityFilter();
         $filter->save($this->component->getFields(), $selections, $applyToAllUsers);
     }
     $responseHelper->redirectToAdminPage('index');
 }
示例#3
0
 /**
  * Pass a whole log of stuff into the view.
  */
 public function render()
 {
     $fields = $this->component->getFields();
     $listing = $this->component->getListing();
     $filter = $this->component->getVisibilityFilter();
     $this->view->assign(['component' => $this->component, 'permissions' => $this->component->getPermissions(), 'singularTitle' => $this->component->getPrimaryModel()->getSingularTitle(), 'pluralTitle' => $this->component->getPrimaryModel()->getPluralTitle(), 'listing' => $listing, 'visibilityFilter' => $filter, 'groupingFilter' => $this->component->getFieldGroupsFilter(), 'fields' => $fields, 'debug' => Pimple::getResource('debug'), 'isSortable' => $this->component instanceof SortableListingInterface, 'page' => $this, 'createUrl' => $this->getCreateUrl()]);
     if ($this->component instanceof BulkActionProcessorInterface) {
         $this->view->assign(['bulkActions' => $this->component->getBulkActions(), 'bulkActionFailureMessage' => $this->bulkActionFailureMessage]);
     }
     return $this->renderView();
 }