Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcController::__construct(AbstractModule $module)
  */
 public function __construct(AbstractModule $module)
 {
     global $WT_TREE;
     parent::__construct($module);
     $this->sosa_provider = new SosaProvider($WT_TREE, Auth::user());
     $this->generation = Filter::getInteger('gen');
     $this->view_bag = new ViewBag();
     $this->view_bag->set('generation', $this->generation);
     $this->view_bag->set('max_gen', $this->sosa_provider->getLastGeneration());
     $this->view_bag->set('is_setup', $this->sosa_provider->isSetup() && $this->view_bag->get('max_gen', 0) > 0);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcController::__construct(AbstractModule $module)
  */
 public function __construct(AbstractModule $module)
 {
     global $WT_TREE;
     parent::__construct($module);
     $this->surname = Filter::get('surname');
     $this->alpha = Filter::get('alpha');
     // All surnames beginning with this letter where "@"=unknown and ","=none
     $this->show_all = Filter::get('show_all', 'no|yes', 'no');
     // All indis
     // Make sure selections are consistent.
     // i.e. can’t specify show_all and surname at the same time.
     if ($this->show_all === 'yes') {
         $this->alpha = '';
         $this->surname = '';
         $this->legend = I18N::translate('All');
         $this->show = Filter::get('show', 'surn|lineage', 'surn');
     } elseif ($this->surname) {
         $this->alpha = QueryName::initialLetter($this->surname);
         // so we can highlight the initial letter
         $this->show_all = 'no';
         if ($this->surname === '@N.N.') {
             $this->legend = I18N::translateContext('Unknown surname', '…');
         } else {
             $this->legend = Filter::escapeHtml($this->surname);
             // The surname parameter is a root/canonical form.
             // Display it as the actual surname
             foreach (QueryName::surnames($WT_TREE, $this->surname, $this->alpha, false, false) as $details) {
                 $this->legend = implode('/', array_keys($details));
             }
         }
         $this->show = 'lineage';
         // SURN list makes no sense here
     } elseif ($this->alpha === '@') {
         $this->show_all = 'no';
         $this->legend = I18N::translateContext('Unknown surname', '…');
         $this->show = 'lineage';
         // SURN list makes no sense here
     } elseif ($this->alpha === ',') {
         $this->show_all = 'no';
         $this->legend = I18N::translate('None');
         $this->show = 'lineage';
         // SURN list makes no sense here
     } elseif ($this->alpha) {
         $this->show_all = 'no';
         $this->legend = Filter::escapeHtml($this->alpha) . '…';
         $this->show = Filter::get('show', 'surn|lineage', 'surn');
     } else {
         $this->show_all = 'no';
         $this->legend = '…';
         $this->show = 'none';
         // Don't show lists until something is chosen
     }
     $this->legend = '<span dir="auto">' . $this->legend . '</span>';
 }
Ejemplo n.º 3
0
 /**
  * Constructor for SosaStatsController
  * @param AbstractModule $module
  */
 public function __construct(AbstractModule $module)
 {
     global $WT_TREE;
     parent::__construct($module);
     $this->sosa_provider = new SosaProvider($WT_TREE, Auth::user());
 }
Ejemplo n.º 4
0
 /**
  * Constructor for GeoAnalysis controller
  * @param AbstractModule $module
  */
 public function __construct(AbstractModule $module)
 {
     parent::__construct($module);
     $this->provider = $this->module->getProvider();
 }