Skip to content

Commit

Permalink
Fixed #1225 - Bootstrap: %ADDTHISSCRIPT% is visable when hosting an e…
Browse files Browse the repository at this point in the history
…xported LO on a server
  • Loading branch information
torinfo committed Jun 13, 2023
1 parent bbbf13a commit fe0aefd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
14 changes: 13 additions & 1 deletion modules/site/export.php
Expand Up @@ -189,10 +189,22 @@ function fixFileLocation($LO_icon_path, $fileLocation) {
*/
$lo_name = $xml->getName();

/*
* Do we need the s7 script for the social icons
*/
$hidesocial = $xml->getLOAttribute('hidesocial');
$footerhide = $xml->getLOAttribute('footerHide');
$footerpos = $xml->getLOAttribute('footerPos');
if ($hidesocial != 'true' && $footerhide != 'true' && $footerpos != 'replace' && ($xerte_toolkits_site->globalhidesocial != 'true' || $xerte_toolkits_site->globalsocialauth != 'false')) {
$s7script = true;
} else {
$s7script = false;
}

/*
* Create basic HTML page
*/
basic_html5_page_create($row['template_id'], $row['template_framework'], $row['template_framework'], $lo_name, $row['date_modified'], $row['date_created'], false, false, '', false, $LO_logoL, $LO_logoR);
basic_html5_page_create($row['template_id'], $row['template_framework'], $row['template_framework'], $lo_name, $row['date_modified'], $row['date_created'], false, false, '', false, $LO_logoL, $LO_logoR, '', $s7script);


/*
Expand Down
11 changes: 10 additions & 1 deletion website_code/php/scorm/scorm_library.php
Expand Up @@ -208,7 +208,7 @@ function scorm_html_page_create($id, $name, $type, $rlo_file, $lo_name, $languag
* @version 1.0
* @author Patrick Lockley
*/
function basic_html5_page_create($id, $type, $parent_name, $lo_name, $date_modified, $date_created, $tsugi=false, $offline=false, $offline_includes="", $need_download_url=false, $logo='', $logo_r='', $plugins='') {
function basic_html5_page_create($id, $type, $parent_name, $lo_name, $date_modified, $date_created, $tsugi=false, $offline=false, $offline_includes="", $need_download_url=false, $logo='', $logo_r='', $plugins='', $adds7script=false) {

global $xerte_toolkits_site, $dir_path, $delete_file_array, $zipfile;

Expand Down Expand Up @@ -281,6 +281,15 @@ function basic_html5_page_create($id, $type, $parent_name, $lo_name, $date_modif
}
$buffer = str_replace("%POPCORN_CONFIG%", $popcorn_config, $buffer);

if ($type == 'site')
{
//add socialicons script
if ($adds7script) {
$buffer = str_replace("%ADDTHISSCRIPT%", '<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50f40a8436e8c4c5" async="async"></script>', $buffer);
} else {
$buffer = str_replace("%ADDTHISSCRIPT%", '', $buffer);
}
}
$index = "index.htm";


Expand Down

0 comments on commit fe0aefd

Please sign in to comment.