/** * * @param Application $app * @param Request $Request * * @return Helper */ public function __construct(Application $app, Request $Request) { parent::__construct($app, $Request); $this->selection = new \set_selection($app); if (trim($Request->get('ssel')) !== '') { $Basket = $app['converter.basket']->convert($Request->get('ssel')); $app['acl.basket']->hasAccess($Basket, $app->getAuthenticatedUser()); $this->selection->load_basket($Basket); $this->is_basket = true; $this->original_basket = $Basket; } elseif (trim($Request->get('story')) !== '') { $repository = $app['repo.story-wz']; $storyWZ = $repository->findByUserAndId($app, $app->getAuthenticatedUser(), $Request->get('story')); $this->selection->load_list([$storyWZ->getRecord($this->app)->get_serialize_key()], $this->flatten_groupings); } else { $this->selection->load_list(explode(";", $Request->get('lst')), $this->flatten_groupings); } $this->elements_received = $this->selection->get_count(); $this->single_grouping = $this->get_count_actionable() == 1 && $this->get_count_actionable_groupings() == 1; $this->examinate_selection(); return $this; }