Skip to content

Commit

Permalink
update header links
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-c committed Jan 3, 2024
1 parent 486509b commit 261c459
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
59 changes: 58 additions & 1 deletion classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,64 @@ public function navbar(): string {
$newnav = new \theme_boost_union\boostnavbar($this->page);
return $this->render_from_template('core/navbar', $newnav);
}



public function nav_language() {
global $CFG, $PAGE;
$lang = \current_language();

$currurl = $PAGE->url;

if ($lang == 'en') {
$currurl->param('lang','fr_ca');
$langlink = '<a href="'.$currurl->out().'">Français</a>';
} else {
$currurl->param('lang','en');
$langlink = '<a href="'.$currurl->out().'">English</a>';
}

//$langlink .= print_r($currurl,1);

return $langlink;
}


public function login_status() {
global $CFG;
//$lang = \current_language();

if (isloggedin()) {
$lslink = '<a href="'.$CFG->wwwroot.'/login/logout.php?sesskey='.sesskey().'">'.get_string('logout').'</a>';
} else {
$lslink = '<a href="'.$CFG->wwwroot.'/login/index.php">'.get_string('login').'</a>';
}
/*
if ($lang == 'en') {
} else {
if (isloggedin()) {
$lslink = '<a href="'.$CFG->wwwroot.'/login/logout.php?sesskey='.sesskey().'">Log out</a>';
} else {
$lslink = '<a href="'.$CFG->wwwroot.'/login/index.php">Log in</a>';
}
}
*/

return $lslink;
}

public function contact_email() {
global $CFG;
$lang = \current_language();

$contact_str = ($lang == 'fr_ca') ? 'Contactez-nous' : 'Contact Us';

$contact_link = '<a href="mailto:'.$CFG->noreplyaddress.'">'.$contact_str.'</a>';

return $contact_link;
}

/**
* Prints a nice side block with an optional header.
*
Expand Down
4 changes: 3 additions & 1 deletion templates/navbar.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
* Added the possibility to change navbar color.
* Include button for off-canvas region.
}}
<div class="lang-social"><a href="#">Français</a> <a href="#">Login</a> <a href="#">Contact Us</a> <a href="" class="soc-icon"><i class="fa fa-facebook-official" aria-hidden="true"></i></a> <a href="#" class="soc-icon"><i class="fa fa-instagram" aria-hidden="true"></i></a> <a href="#" class="soc-icon"><i class="fa fa-youtube" aria-hidden="true"></i></a>
<div class="lang-social">{{{output.nav_language}}} {{{ output.login_status }}} {{{ output.contact_email }}}

<a href="#" class="soc-icon"><i class="fa fa-twitter" aria-hidden="true"></i></a> <a href="#" class="soc-icon"><i class="fa fa-facebook-official" aria-hidden="true"></i></a> <a href="#" class="soc-icon"><i class="fa fa-instagram" aria-hidden="true"></i></a> <a href="#" class="soc-icon"><i class="fa fa-youtube" aria-hidden="true"></i></a>
</div>
<nav class="navbar fixed-top {{navbarcolorclasses}} navbar-expand" aria-label="{{#str}}sitemenubar, admin{{/str}}">

Expand Down

0 comments on commit 261c459

Please sign in to comment.