当前位置: 首页>>代码示例>>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;未经允许,请勿转载。