/**
  * {@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>';
 }
Beispiel #2
0
        $show = 'indi';
    } elseif ($falpha) {
        $alpha = '';
        $surname = '';
        $legend = I18N::translate('All') . ', ' . Filter::escapeHtml($falpha) . '…';
        $url = WT_SCRIPT_NAME . '?show_all=yes&amp;ged=' . $WT_TREE->getNameUrl();
        $show = 'indi';
    } else {
        $alpha = '';
        $surname = '';
        $legend = I18N::translate('All');
        $url = WT_SCRIPT_NAME . '?show_all=yes' . '&amp;ged=' . $WT_TREE->getNameUrl();
        $show = Filter::get('show', 'surn|indi', 'surn');
    }
} elseif ($surname) {
    $alpha = QueryName::initialLetter($surname);
    // so we can highlight the initial letter
    $show_all = 'no';
    if ($surname === '@N.N.') {
        $legend = I18N::translateContext('Unknown surname', '…');
    } else {
        $legend = Filter::escapeHtml($surname);
    }
    $url = WT_SCRIPT_NAME . '?surname=' . rawurlencode($surname) . '&amp;ged=' . $WT_TREE->getNameUrl();
    switch ($falpha) {
        case '':
            break;
        case '@':
            $legend .= ', ' . I18N::translateContext('Unknown given name', '…');
            $url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
            break;