- //Set section
- $section = $user->getPseudonym();
-
- //Set title
- $title = $this->translator->trans($this->config['site']['title']).' - '.$section;
-
- //Set description
- $this->context['description'] = $this->translator->trans('%pseudonym% outdoor Argentine Tango session calendar', [ '%pseudonym%' => $user->getPseudonym() ]);
-
- //Set keywords
- $this->context['keywords'] = [
- $user->getPseudonym(),
- $this->translator->trans('outdoor'),
- $this->translator->trans('Argentine Tango'),
- $this->translator->trans('calendar')
- ];
-
- //Compute period
- $period = new \DatePeriod(
- //Start from first monday of week
- new \DateTime('Monday this week'),
- //Iterate on each day
- new \DateInterval('P1D'),
- //End with next sunday and 4 weeks
- new \DateTime(
- $this->isGranted('IS_AUTHENTICATED_REMEMBERED')?'Monday this week + 3 week':'Monday this week + 2 week'
- )
- );
-
- //Fetch calendar
- //TODO: highlight with current session route parameter
- $calendar = $doctrine->getRepository(Session::class)->fetchUserCalendarByDatePeriod($this->translator, $period, $isGuest?$id:null, $request->get('session'), $request->getLocale());
-
- //Fetch locations
- //XXX: we want to display all active locations anyway
- $locations = $doctrine->getRepository(Location::class)->findTranslatedSortedByPeriod($this->translator, $period, $id);
+ //Create the RegisterType form and give the proper parameters
+ $edit = $this->createForm($this->config['edit']['view']['edit'], $user, [
+ //Set action to register route name and context
+ 'action' => $this->generateUrl($this->config['route']['edit']['name'], ['mail' => $smail, 'hash' => $this->slugger->hash($smail)]+$this->config['route']['edit']['context']),
+ //Set civility class
+ 'civility_class' => $this->config['class']['civility'],
+ //Set civility default
+ 'civility_default' => $this->doctrine->getRepository($this->config['class']['civility'])->findOneByTitle($this->config['default']['civility']),
+ //Set country class
+ 'country_class' => $this->config['class']['country'],
+ //Set country default
+ 'country_default' => $this->doctrine->getRepository($this->config['class']['country'])->findOneByTitle($this->config['default']['country']),
+ //Set country favorites
+ 'country_favorites' => $this->doctrine->getRepository($this->config['class']['country'])->findByTitle($this->config['default']['country_favorites']),
+ //Disable mail
+ 'mail' => $this->isGranted('ROLE_ADMIN'),
+ //Disable pseudonym
+ 'pseudonym' => $this->isGranted('ROLE_GUEST'),
+ //Disable password
+ 'password' => false,
+ //Set method
+ 'method' => 'POST'
+ ]+$this->config['edit']['field']);