Skip to content

Commit

Permalink
Fix "Search in Site administration is missing"
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jun 30, 2023
1 parent 1c44d91 commit 3bb7c92
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
9 changes: 8 additions & 1 deletion classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class core_renderer extends \theme_boost\output\core_renderer {
* @return string HTML to display the main header.
*/
public function full_header() {
$html = html_writer::start_tag('header', array('id' => 'main-header', 'class' => 'row p-a-1'));
$html = html_writer::start_tag('header', array('id' => 'main-header', 'class' => 'row mt-1 p-a-1'));
$usecourseimage = ((!empty($this->page->layout_options['courseimage'])) &&
(!empty($this->page->theme->settings->courseheaderimage)));
$courseheader = $this->course_header();
Expand Down Expand Up @@ -74,6 +74,13 @@ public function full_header() {
$html .= html_writer::end_div();
$html .= html_writer::start_div('col-4');
$html .= $courseitemsearch;
} else {
$headeractions = $this->page->get_header_actions();
if (!empty($headeractions)) {
$context = new stdClass;
$context->headeractions = $headeractions;
$html .= $this->render_from_template('theme_squared/header_actions', $context);
}
}
$html .= html_writer::end_div();
$html .= html_writer::start_div('col-12');
Expand Down
17 changes: 17 additions & 0 deletions templates/header_actions.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{!
This file is part of the Squared theme for Moodle
}}
{{!
@template theme_squared/header_actions
Render the header actions as a part of the header.
Example context (json): {
"headeractions": []
}
}}
<div class="header-actions-container ml-auto" data-region="header-actions-container">
{{#headeractions}}
<div class="header-action ml-2">{{{.}}}</div>
{{/headeractions}}
</div>

0 comments on commit 3bb7c92

Please sign in to comment.