本文整理汇总了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'));
}
示例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();
}
示例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'));
}
示例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 .= ' (' . 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;
}
}
示例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();
}