Commit 8331ea64 authored by Francois Marier's avatar Francois Marier
Browse files

googleapps block: use https images when needed



On Mahara sites served over HTTPS, the Google Books, Calendar,
Docs and Maps logos were seen by the browser as insecure content.

This patch uses the HTTPS version of the logos when needed.

It also always links to the secure versions of Docs and Calendar
just to ensure that our users are directed to the secure versions
of these Google services.

Change-Id: I40aefc4798cde90bd31c4ac711cbb9d2a7b1b602
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent 42ad7937
......@@ -229,6 +229,12 @@ class PluginBlocktypeGoogleApps extends SystemBlocktype {
private static function get_html_of_supported_googleapps() {
$smarty = smarty_core();
$smarty->assign('lang', substr(get_config('lang'), 0, 2));
if (stripos(get_config('wwwroot'), 'https') === 0) {
$smarty->assign('protocol', 'https');
}
else {
$smarty->assign('protocol', 'http');
}
return $smarty->fetch('blocktype:googleapps:supported.tpl');
}
......
<ul style="list-style-type: none;">
<li>
<a href="http://books.google.com/" target="_blank">
<img src="http://books.google.com/intl/{$lang}/googlebooks/images/books_logo_sm.gif" border="0" height="20">
<img src="{$protocol}://www.google.com/intl/{$lang}/googlebooks/images/books_logo_sm.gif" border="0" height="20">
</a>
</li>
<li>
<a href="http://www.google.com/calendar" target="_blank">
<img src="http://calendar.google.com/googlecalendar/images/calendar_logo_sm_{$lang}.gif" border="0" height="20">
<a href="https://www.google.com/calendar" target="_blank">
<img src="{$protocol}://calendar.google.com/googlecalendar/images/calendar_logo_sm_{$lang}.gif" border="0" height="20">
</a>
</li>
<li>
<a href="http://docs.google.com/" target="_blank">
<img src="http://docs.google.com/images/doclist/docs_logo_sm.gif" border="0" height="20">
<a href="https://docs.google.com/" target="_blank">
<img src="{$protocol}://docs.google.com/images/doclist/docs_logo_sm.gif" border="0" height="20">
</a>
</li>
<li>
<a href="http://maps.google.com/" target="_blank">
<img src="http://maps.google.com/intl/{$lang}/images/logos/maps_logo.gif" border="0" height="20">
<img src="{$protocol}://maps.google.com/intl/{$lang}/images/logos/maps_logo.gif" border="0" height="20">
</a>
</li>
</ul>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment