本文整理汇总了PHP中renderer_base::page_heading_menu方法的典型用法代码示例。如果您正苦于以下问题:PHP renderer_base::page_heading_menu方法的具体用法?PHP renderer_base::page_heading_menu怎么用?PHP renderer_base::page_heading_menu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类renderer_base
的用法示例。
在下文中一共展示了renderer_base::page_heading_menu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: theme_ws_html_header
/**
* Returns the html for the <header> of the document.
*
* @param renderer_base $output Pass in $OUTPUT.
* @param moodle_page $page Pass in $PAGE.
* @return string The html.
*/
function theme_ws_html_header(renderer_base $output, moodle_page $page)
{
global $CFG;
//if the sitetitle hasn't been set, then set to the default
if (empty($page->theme->settings->sitetitle)) {
$page->theme->settings->sitetitle = get_string('sitetitledefault', 'theme_ws');
}
//save a css class to indicate whether there is a logo image or not
$logoimg = 'no-logo-img';
//if a logo file has been specified, then use it
if (!empty($page->theme->settings->logo)) {
$src = $page->theme->setting_file_url('logo', 'logo');
$brand = '<img alt="' . $page->theme->settings->sitetitle . '" src="' . $src . '">';
$logoimg = 'logo-img';
//if no logo file is specified, then use the site title
} else {
$brand = '<span class="site-title">' . $page->theme->settings->sitetitle . '</span>';
}
return '
<header role="banner" class="navbar navbar-static-top moodle-has-zindex' . (!empty($page->theme->settings->sitesubtitle) ? ' hassubtitle' : '') . '">
<nav role="navigation" class="navbar-inner">
<div class="container-fluid ' . $logoimg . '">
<a class="brand" href="' . $CFG->wwwroot . '">
' . $brand . '
</a>
' . (!empty($page->theme->settings->sitesubtitle) ? '<span class="sitesubtitle">' . $page->theme->settings->sitesubtitle . '</span>' : '') . '
' . (!empty($page->theme->settings->helpurl) ? '<a class="helpbtn" title="help" href="' . $page->theme->settings->helpurl . '" target="_blank"><span>?</span></a>' : '') . '
' . ($output->custom_menu() || $output->page_heading_menu() ? '<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>' : '') . $output->user_menu() . '
<div class="nav-collapse collapse">
' . $output->custom_menu() . '
<ul class="nav pull-right">
<li>' . $output->page_heading_menu() . '</li>
</ul>
</div>
</div>
</nav>
</header>
';
}