Displays a Bootstrap breadcrumbs.

@param NavigationTree $tree The tree.
@return string Returns the Bootstrap breadcrumbs.
435480
protected function bootstrapBreadcrumbs(NavigationTree $tree) {

        $attributes = [];

        $attributes["class"] = ["breadcrumb"];

        $innerHTML = [];

        $nodes = NavigationTreeHelper::getBreadcrumbs($tree);
        $count = count($nodes);

        for ($i = 0; $i < $count; ++$i) {
            $innerHTML[] = $this->bootstrapBreadcrumb($nodes[$i], $count === $i + 1);
        }

        return static::coreHTMLElement("ol", "\n" . implode("\n", $innerHTML) . "\n", $attributes);
    }
638480
public function menuMyIndividualRecord(Tree $tree): ?Menu
    {
        $record = Individual::getInstance($tree->getUserPreference(Auth::user(), 'gedcomid'), $tree);

        if ($record) {
            return new Menu(I18N::translate('My individual record'), $record->url(), 'menu-myrecord');
        }

        return null;
    }
286876
public function getMenu(Tree $tree): ?Menu
    {
        $submenu = [
            $this->menuSearchGeneral($tree),
            $this->menuSearchPhonetic($tree),
            $this->menuSearchAdvanced($tree),
            $this->menuSearchAndReplace($tree),
        ];

        $submenu = array_filter($submenu);

        return new Menu(I18N::translate('Search'), '#', 'menu-search', ['rel' => 'nofollow'], $submenu);
    }
281244
public function getMenu(Tree $tree): ?Menu
    {
        $menu = new Menu($this->title(), route('module', [
            'module' => $this->name(),
            'action' => 'ShowList',
            'ged'    => $tree->name(),
        ]), 'menu-story');

        return $menu;
    }
401283
private function checkLink(Tree $tree, string $xref): string
    {
        return '<b><a href="' . e(route('record', [
                'xref' => $xref,
                'ged'  => $tree->name(),
            ])) . '">' . $xref . '</a></b>';
    }
218413
private function printAdminBarTree( $tree, $nodes, $ul = true ) {
		if ( is_countable( $tree ) && count( $tree ) > 0 ) {
			if ( $ul ) {
				echo '<ul class="ul-disc">';
			}
			foreach ( $tree as $node ) {
				$title = trim( strip_tags( html_entity_decode( $nodes[ $node['name'] ]->title ) ) );
				$href = $nodes[ $node['name'] ]->href;
				if ( ! empty( $title ) && $href !== '#' ) {
					echo "<li><a href='{$href}'>{$title}</a>";
					$this->printAdminBarTree( $node['children'], $nodes, true );
					echo '</li>';
				} else {
					$this->printAdminBarTree( $node['children'], $nodes, false );
				}
			}
			if ( $ul ) {
				echo '</ul>';
			}
		}
	}
733689
public function displayNode( $node )
	{
		return ! isset( $node['label'] ) ||
			(
				! $this->nodeIsHypercube( $node ) &&
				! $this->nodeIsLineItemsAxis( $node ) &&
				! $this->nodeIsAxis( $node ) /* &&
				(
					( isset( $node['children'] ) && count( $node['children'] ) ) ||
					( isset( $node['elements'] ) && count( $node['elements'] ) )
				) */
			);
	}
863821
private function faqsForTree(Tree $tree): Collection
    {
        return DB::table('block')
            ->join('block_setting AS bs1', 'bs1.block_id', '=', 'block.block_id')
            ->join('block_setting AS bs2', 'bs2.block_id', '=', 'block.block_id')
            ->join('block_setting AS bs3', 'bs3.block_id', '=', 'block.block_id')
            ->where('module_name', '=', $this->name())
            ->where('bs1.setting_name', '=', 'header')
            ->where('bs2.setting_name', '=', 'faqbody')
            ->where('bs3.setting_name', '=', 'languages')
            ->where(static function (Builder $query) use ($tree): void {
                $query
                    ->whereNull('gedcom_id')
                    ->orWhere('gedcom_id', '=', $tree->id());
            })
            ->orderBy('block_order')
            ->select(['block.block_id', 'block_order', 'gedcom_id', 'bs1.setting_value AS header', 'bs2.setting_value AS faqbody', 'bs3.setting_value AS languages'])
            ->get();
    }
802849
public function build( $tree )
	{
		$lines	= array();
		$children	= $tree->getChildren();
		foreach( $children as $child )
			foreach( self::buildRecursive( $child ) as $line )
				$lines[]	= $line;
		return implode( self::$lineBreak, $lines );
	}
592471
public static function expandUrls(string $text, Tree $tree): string
    {
        // If it looks like a URL, turn it into a markdown autolink.
        $text = preg_replace('/' . addcslashes(self::URL_REGEX, '/') . '/', '<$0>', $text);

        // Create a minimal commonmark processor - just add support for autolinks.
        $environment = new Environment();
        $environment->mergeConfig([
            'renderer'           => [
                'block_separator' => "\n",
                'inner_separator' => "\n",
                'soft_break'      => "\n",
            ],
            'html_input'         => Environment::HTML_INPUT_ESCAPE,
            'allow_unsafe_links' => true,
        ]);

        $environment
            ->addBlockRenderer(Document::class, new DocumentRenderer())
            ->addBlockRenderer(Paragraph::class, new ParagraphRenderer())
            ->addInlineRenderer(Text::class, new TextRenderer())
            ->addInlineRenderer(Link::class, new LinkRenderer())
            ->addInlineParser(new AutolinkParser());

        $environment->addExtension(new CensusTableExtension());
        $environment->addExtension(new XrefExtension($tree));

        $converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));

        try {
            return $converter->convertToHtml($text);
        } catch (Throwable $ex) {
            // See issue #1824
            return $text;
        }
    }
646548
public function treePageEdit(Tree $tree): ResponseInterface
    {
        $main_blocks = $this->treeBlocks($tree->id(), 'main');
        $side_blocks = $this->treeBlocks($tree->id(), 'side');

        $all_blocks = $this->availableTreeBlocks();
        $title      = I18N::translate('Change the “Home page” blocks');
        $url_cancel = route('tree-page', ['ged' => $tree->name()]);
        $url_save   = route('tree-page-update', ['ged' => $tree->name()]);

        return $this->viewResponse('edit-blocks-page', [
            'all_blocks'  => $all_blocks,
            'can_reset'   => true,
            'main_blocks' => $main_blocks,
            'side_blocks' => $side_blocks,
            'title'       => $title,
            'url_cancel'  => $url_cancel,
            'url_save'    => $url_save,
        ]);
    }
1328605
protected function htmllize_tree($tree, $dir) {
        global $CFG;
        $yuiconfig = array();
        $yuiconfig['type'] = 'html';

        if (empty($dir['subdirs']) and empty($dir['files'])) {
            return '';
        }
        $result = '<ul>';
        foreach ($dir['subdirs'] as $subdir) {
            $image = $this->output->pix_icon(file_folder_icon(), $subdir['dirname'], 'moodle', array('class'=>'icon'));
            $result .= '<li yuiConfig=\''.json_encode($yuiconfig).'\'><div>'.$image.' '.s($subdir['dirname']).'</div> '.$this->htmllize_tree($tree, $subdir).'</li>';
        }
        foreach ($dir['files'] as $file) {
            $url = file_encode_url("$CFG->wwwroot/pluginfile.php", '/'.$tree->context->id.'/mod_wiki/attachments/' . $tree->subwiki->id . '/'. $file->get_filepath() . $file->get_filename(), true);
            $filename = $file->get_filename();
            $image = $this->output->pix_icon(file_file_icon($file), $filename, 'moodle', array('class'=>'icon'));
            $result .= '<li yuiConfig=\''.json_encode($yuiconfig).'\'><div>'.$image.' '.html_writer::link($url, $filename).'</div></li>';
        }
        $result .= '</ul>';

        return $result;
    }
37501
public static function getFontAwesomeBreadcrumbNodes() {

        $breadcrumbNodes = [];

        $breadcrumbNodes[] = new BreadcrumbNode("label.edit_profile", "fa:user", "fos_user_profile_edit", NavigationInterface::NAVIGATION_MATCHER_ROUTER);
        $breadcrumbNodes[] = new BreadcrumbNode("label.show_profile", "fa:user", "fos_user_profile_show", NavigationInterface::NAVIGATION_MATCHER_ROUTER);
        $breadcrumbNodes[] = new BreadcrumbNode("label.change_password", "fa:lock", "fos_user_change_password", NavigationInterface::NAVIGATION_MATCHER_ROUTER);

        return $breadcrumbNodes;
    }
275927
public function listMenu(Tree $tree): ?Menu
    {
        if ($this->listIsEmpty($tree)) {
            return null;
        }
        
        return new Menu(
            $this->listTitle(),
            $this->listUrl($tree),
            $this->listMenuClass(),
            $this->listUrlAttributes()
        );
    }
532291
public function menuMyPage(Tree $tree): Menu
    {
        return new Menu(I18N::translate('My page'), route('user-page', ['ged' => $tree->name()]), 'menu-mypage');
    }
856316
public function getMenu(Tree $tree): ?Menu
    {
        $submenu = [
            $this->calendarDayMenu($tree),
            $this->calendarMonthMenu($tree),
            $this->calendarYearMenu($tree),
        ];

        return new Menu(I18N::translate('Calendar'), '#', 'menu-calendar', ['rel' => 'nofollow'], $submenu);
    }
900088
public function breadcrumbs($locations)
    {
        $trail = '';

        foreach ($locations as $location) {
            if (is_array($location)) {
                foreach ($location as $key => $value) {
                    $trail .= '<li class="breadcrumb-item"><a href="'.$value.'">'.ucfirst($key).'</a></li>';
                }
            } else {
                $trail .= '<li class="breadcrumb-item">'.ucfirst($location).'</li>';
            }
        }

        return $trail;
    }