當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tree::getNameUrl方法代碼示例

本文整理匯總了PHP中Fisharebest\Webtrees\Tree::getNameUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tree::getNameUrl方法的具體用法?PHP Tree::getNameUrl怎麽用?PHP Tree::getNameUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Fisharebest\Webtrees\Tree的用法示例。


在下文中一共展示了Tree::getNameUrl方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMenu

 /**
  * {@inhericDoc}
  * @see \MyArtJaub\Webtrees\Module\ModuleMenuItemInterface::getMenu()
  */
 public function getMenu(Tree $tree, $reference = null)
 {
     $tree_url = $tree ? $tree->getNameUrl() : '';
     return new Menu($this->getTitle(), 'module.php?mod=' . $this->getName() . '&mod_action=Certificate@listAll&ged=' . $tree_url, 'menu-maj-list-certificate', array('rel' => 'nofollow'));
 }
開發者ID:jon48,項目名稱:webtrees-lib,代碼行數:9,代碼來源:CertificatesModule.php

示例2: init

 /**
  * Initialise the theme. We cannot pass these in a constructor, as the construction
  * happens in a theme file, and we need to be able to change it.
  *
  * @param Tree|null $tree The current tree (if there is one).
  */
 public final function init(Tree $tree = null)
 {
     $this->tree = $tree;
     $this->tree_url = $tree ? 'ged=' . $tree->getNameUrl() : '';
     $this->hookAfterInit();
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:12,代碼來源:AbstractTheme.php

示例3: getMenu

 /** 
  * {@inhericDoc}
  * @see \MyArtJaub\Webtrees\Module\ModuleMenuItemInterface::getMenu()
  */
 public function getMenu(fw\Tree $tree, $reference)
 {
     $tree_url = $tree ? $tree->getNameUrl() : '';
     $surname = $reference && is_string($reference) ? $reference : '';
     return new fw\Menu($this->getTitle(), 'module.php?mod=' . $this->getName() . '&mod_action=Lineage&ged=' . $tree_url . '&surname=' . $surname, 'menu-maj-list-lineage', array('rel' => 'nofollow'));
 }
開發者ID:jon48,項目名稱:webtrees-lib,代碼行數:10,代碼來源:PatronymicLineageModule.php

示例4: surnameList

 /**
  * Print a list of surnames.
  *
  * @param string[][] $surnames array (of SURN, of array of SPFX_SURN, of array of PID)
  * @param int $style 1=bullet list, 2=semicolon-separated list, 3=tabulated list with up to 4 columns
  * @param bool $totals show totals after each name
  * @param string $script indilist or famlist
  * @param Tree $tree Link back to the individual list in this tree
  *
  * @return string
  */
 public static function surnameList($surnames, $style, $totals, $script, Tree $tree)
 {
     $html = array();
     foreach ($surnames as $surn => $surns) {
         // Each surname links back to the indilist
         if ($surn) {
             $url = $script . '?surname=' . urlencode($surn) . '&ged=' . $tree->getNameUrl();
         } else {
             $url = $script . '?alpha=,&ged=' . $tree->getNameUrl();
         }
         // If all the surnames are just case variants, then merge them into one
         // Comment out this block if you want SMITH listed separately from Smith
         $first_spfxsurn = null;
         foreach ($surns as $spfxsurn => $indis) {
             if ($first_spfxsurn) {
                 if (I18N::strtoupper($spfxsurn) == I18N::strtoupper($first_spfxsurn)) {
                     $surns[$first_spfxsurn] = array_merge($surns[$first_spfxsurn], $surns[$spfxsurn]);
                     unset($surns[$spfxsurn]);
                 }
             } else {
                 $first_spfxsurn = $spfxsurn;
             }
         }
         $subhtml = '<a href="' . $url . '" dir="auto">' . Filter::escapeHtml(implode(I18N::$list_separator, array_keys($surns))) . '</a>';
         if ($totals) {
             $subtotal = 0;
             foreach ($surns as $indis) {
                 $subtotal += count($indis);
             }
             $subhtml .= '&nbsp;(' . I18N::number($subtotal) . ')';
         }
         $html[] = $subhtml;
     }
     switch ($style) {
         case 1:
             return '<ul><li>' . implode('</li><li>', $html) . '</li></ul>';
         case 2:
             return implode(I18N::$list_separator, $html);
         case 3:
             $i = 0;
             $count = count($html);
             if ($count > 36) {
                 $col = 4;
             } elseif ($count > 18) {
                 $col = 3;
             } elseif ($count > 6) {
                 $col = 2;
             } else {
                 $col = 1;
             }
             $newcol = ceil($count / $col);
             $html2 = '<table class="list_table"><tr>';
             $html2 .= '<td class="list_value" style="padding: 14px;">';
             foreach ($html as $surns) {
                 $html2 .= $surns . '<br>';
                 $i++;
                 if ($i == $newcol && $i < $count) {
                     $html2 .= '</td><td class="list_value" style="padding: 14px;">';
                     $newcol = $i + ceil($count / $col);
                 }
             }
             $html2 .= '</td></tr></table>';
             return $html2;
     }
 }
開發者ID:tunandras,項目名稱:webtrees,代碼行數:76,代碼來源:FunctionsPrintLists.php

示例5: getHtmlUrl

 /**
  * Get the URL for the GeoAnalysis.
  *
  * @return string
  */
 public function getHtmlUrl()
 {
     return 'module.php?mod=' . Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl();
 }
開發者ID:jon48,項目名稱:webtrees-lib,代碼行數:9,代碼來源:GeoAnalysis.php


注:本文中的Fisharebest\Webtrees\Tree::getNameUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。