mirror of
https://github.com/moodle/moodle.git
synced 2025-04-24 18:04:43 +02:00
MDL-72845 core: add services and support link to help popover
This commit is contained in:
parent
9dc03a9e36
commit
be018b7c42
lang/en
lib
theme/boost/templates
@ -1334,6 +1334,7 @@ $string['moodledocs'] = 'Moodle Docs';
|
||||
$string['moodledocslink'] = 'Help and documentation';
|
||||
$string['moodleversion'] = 'Moodle version';
|
||||
$string['moodlerelease'] = 'Moodle release';
|
||||
$string['moodleservicesandsupport'] = 'Services and support';
|
||||
$string['more'] = 'more';
|
||||
$string['morehelp'] = 'More help';
|
||||
$string['morehelpaboutmodule'] = 'More help about the {$a} activity';
|
||||
|
@ -401,6 +401,7 @@ class icon_system_fontawesome extends icon_system_font {
|
||||
'core:t/index_drawer' => 'fa-list',
|
||||
'core:t/left' => 'fa-arrow-left',
|
||||
'core:t/less' => 'fa-caret-up',
|
||||
'core:t/life-ring' => 'fa-life-ring',
|
||||
'core:t/locked' => 'fa-lock',
|
||||
'core:t/lock' => 'fa-unlock',
|
||||
'core:t/locktime' => 'fa-lock',
|
||||
|
@ -4146,6 +4146,36 @@ EOD;
|
||||
return html_writer::tag('a', $icon . $label, ['href' => 'mailto:' . $supportemail]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the services and support link for the help pop-up.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function services_support_link(): string {
|
||||
global $CFG;
|
||||
|
||||
if ((isset($CFG->showservicesandsupportcontent) && $CFG->showservicesandsupportcontent == false) || !is_siteadmin()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$liferingicon = $this->pix_icon('t/life-ring', '', 'moodle', ['class' => 'fa fa-life-ring']);
|
||||
$newwindowicon = $this->pix_icon('i/externallink', get_string('opensinnewwindow'), 'moodle',
|
||||
['class' => 'fa fa-externallink fa-fw']);
|
||||
$link = 'https://moodle.com/help/?utm_source=CTA-banner&utm_medium=platform&utm_campaign=name~Moodle4+cat~lms+mp~no';
|
||||
$content = $liferingicon . get_string('moodleservicesandsupport') . $newwindowicon;
|
||||
|
||||
return html_writer::tag('a', $content, ['target' => '_blank', 'href' => $link]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to decide whether to show the help popover header or not.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has_popover_links(): bool {
|
||||
return !empty($this->services_support_link()) || !empty($this->page_doc_link()) || !empty($this->supportemail());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the page heading menu.
|
||||
*
|
||||
|
@ -24,6 +24,8 @@
|
||||
"output": {
|
||||
"page_doc_link": "Help and documentation",
|
||||
"supportemail": "<a href=\"#\">Contact site support</a>",
|
||||
"has_popover_links": true,
|
||||
"services_support": "Services and support",
|
||||
"login_info": "You are logged in as cute kitten",
|
||||
"moodle_release": "90210"
|
||||
}
|
||||
@ -37,14 +39,21 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="footer-content-popover container" data-region="footer-content-popover">
|
||||
<div class="footer-section p-3 border-bottom">
|
||||
{{# output.page_doc_link }}
|
||||
<div>{{{ output.page_doc_link }}}</div>
|
||||
{{/ output.page_doc_link }}
|
||||
{{# output.supportemail }}
|
||||
<div>{{{ output.supportemail }}}</div>
|
||||
{{/ output.supportemail }}
|
||||
</div>
|
||||
{{# output.has_popover_links }}
|
||||
<div class="footer-section p-3 border-bottom">
|
||||
{{# output.page_doc_link }}
|
||||
<div>{{{ output.page_doc_link }}}</div>
|
||||
{{/ output.page_doc_link }}
|
||||
|
||||
{{# output.services_support_link }}
|
||||
<div>{{{ output.services_support_link }}}</div>
|
||||
{{/ output.services_support_link }}
|
||||
|
||||
{{# output.supportemail }}
|
||||
<div>{{{ output.supportemail }}}</div>
|
||||
{{/ output.supportemail }}
|
||||
</div>
|
||||
{{/ output.has_popover_links }}
|
||||
<div class="footer-section p-3 border-bottom">
|
||||
<div class="logininfo">
|
||||
{{{ output.login_info }}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user