31        $ilias = 
$DIC[
'ilias'];
 
   34        $ilCtrl = 
$DIC[
'ilCtrl'];
 
   35        include_once 
"./Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php";
 
   36        $this->
ilias = $ilias;
 
   38        $lng->loadLanguageModule(
"sop");
 
   40        $this->ctrl = $ilCtrl;
 
   41        $this->ctrl->saveParameter($this, 
"ref_id");
 
   43        $this->offline_mode = $this->offlineMode->getOfflineMode();
 
   51        $ilCtrl = 
$DIC[
'ilCtrl'];
 
   53        $this->refId = 
$_GET[
"ref_id"];
 
   55        $this->clientIdSop = $this->offlineMode->getClientIdSop();
 
   56        $cmd = $ilCtrl->getCmd();
 
   57        $this->sop_frm_url = $this->offlineMode->cmd_url . 
'offlineMode_sop';
 
   58        $this->sopcache_url = $this->offlineMode->cmd_url . 
'offlineMode_sopcache';
 
   59        $this->lm_frm_url = $this->offlineMode->lm_cmd_url . 
'offlineMode_il2sop';
 
   60        $this->lmcache_url = $this->offlineMode->lm_cmd_url . 
'offlineMode_lmcache';
 
   61        $this->tracking_url = $this->offlineMode->lm_cmd_url . 
'offlineMode_tracking2sop';
 
   64            case 'offlineMode_sop':
 
   65                $log->write(
"offlineMode_sop");
 
   66                $sop_cache = 
new ilGlobalTemplate(
'tpl.cache.html', 
true, 
true, 
'Modules/ScormAicc');
 
   68                $sop_cache->setVariable(
"APPCACHE_URL", $this->sopcache_url);
 
   69                $sop_cache->setVariable(
"CACHE_TITLE", 
"SOP Cache Page");
 
   73            case 'offlineMode_sopcache':
 
   74                $log->write(
"offlineMode_manifest");
 
   75                $sop_manifest = 
new ilTemplate(
'tpl.sop.appcache', 
true, 
true, 
'Modules/ScormAicc');
 
   76                $entries = $this->offlineMode->getSopManifestEntries();
 
   77                $sop_manifest->setVariable(
"CACHE_ENTRIES", $entries);
 
   78                $sop_manifest->setVariable(
"VERSION", $this->vers);
 
   82            case 'offlineMode_il2sop':
 
   83                $log->write(
"offlineMode_il2sop");
 
   84                $lm_cache = 
new ilGlobalTemplate(
'tpl.cache.html', 
true, 
true, 
'Modules/ScormAicc');
 
   86                $lm_cache->setVariable(
"APPCACHE_URL", $this->lmcache_url);
 
   87                $lm_cache->setVariable(
"CACHE_TITLE", 
"LM Cache Page");
 
   91            case 'offlineMode_lmcache':
 
   92                $log->write(
"offlineMode_lmcache");
 
   93                $lm_manifest = 
new ilTemplate(
'tpl.lm.appcache', 
true, 
true, 
'Modules/ScormAicc');
 
   98                    $entries = $this->offlineMode->getLmManifestEntries();
 
  100                $lm_manifest->setVariable(
"CACHE_ENTRIES", $entries);
 
  101                $lm_manifest->setVariable(
"VERSION", $this->vers);
 
  105            case 'offlineMode_tracking2sop':
 
  106                $this->offlineMode->tracking2sop();
 
  109            case 'offlineMode_il2sopOk':
 
  110                $this->offlineMode->setOfflineMode(
"offline");
 
  111                $this->
view($this->offlineMode->getOfflineMode(), $cmd);
 
  114            case 'offlineMode_sop2ilpush':
 
  115                $this->offlineMode->sop2il();
 
  118            case 'offlineMode_sop2ilOk':
 
  119                $this->offlineMode->setOfflineMode(
"online");
 
  120                ilUtil::sendSuccess($this->lng->txt(
'sop_msg_push_tracking_ok'), 
true);
 
  125            case 'offlineMode_player12':
 
  126                $log->write(
"offlineMode_player12");
 
  127                $player12 = 
new ilGlobalTemplate(
'tpl.player12.html', 
false, 
false, 
'Modules/ScormAicc');
 
  128                $player12->setVariable(
"SOP_TITLE", 
"ILIAS SCORM 1.2 Offline Player"); 
 
  129                $js_data = file_get_contents(
"./Modules/ScormAicc/scripts/basisAPI.js");
 
  130                $js_data .= file_get_contents(
"./Modules/ScormAicc/scripts/SCORM1_2standard.js");
 
  131                $player12->setVariable(
"SOP_SCRIPT", $js_data);
 
  135            case 'offlineMode_player2004':
 
  136                $log->write(
"offlineMode_player2004");
 
  139                $langstrings[
'btnStart'] = 
$lng->txt(
'scplayer_start');
 
  140                $langstrings[
'btnExit'] = 
$lng->txt(
'scplayer_exit');
 
  141                $langstrings[
'btnExitAll'] = 
$lng->txt(
'scplayer_exitall');
 
  142                $langstrings[
'btnSuspendAll'] = 
$lng->txt(
'scplayer_suspendall');
 
  143                $langstrings[
'btnPrevious'] = 
$lng->txt(
'scplayer_previous');
 
  144                $langstrings[
'btnContinue'] = 
$lng->txt(
'scplayer_continue');
 
  145                $langstrings[
'btnhidetree'] = 
$lng->txt(
'scplayer_hidetree');
 
  146                $langstrings[
'btnshowtree'] = 
$lng->txt(
'scplayer_showtree');
 
  147                $langstrings[
'linkexpandTree'] = 
$lng->txt(
'scplayer_expandtree');
 
  148                $langstrings[
'linkcollapseTree'] = 
$lng->txt(
'scplayer_collapsetree');
 
  149                $langstrings[
'contCreditOff'] = 
$lng->txt(
'cont_credit_off');
 
  156                $player2004 = 
new ilGlobalTemplate(
'tpl.player2004.html', 
true, 
true, 
'Modules/ScormAicc');
 
  158                include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
  161                $player2004->setVariable(
'JSON_LANGSTRINGS', json_encode($langstrings));
 
  162                $player2004->setVariable(
'TREE_JS', 
"./Modules/Scorm2004/scripts/ilNestedList.js");
 
  163                $player2004->setVariable($langstrings);
 
  164                $player2004->setVariable(
"DOC_TITLE", 
"ILIAS SCORM 2004 Offline Player");
 
  166                list($tsfrac, $tsint) = explode(
' ', microtime());
 
  167                $player2004->setVariable(
'TIMESTAMP', sprintf(
'%d%03d', $tsint, 1000 * (
float) $tsfrac));
 
  168                $player2004->setVariable(
'BASE_DIR', 
'./Modules/Scorm2004/');
 
  170                $player2004->setVariable(
'INLINE_CSS', ilSCORM13PlayerGUI::getInlineCss());
 
  172                include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
  175                $player2004->setVariable(
'JS_SCRIPTS', 
'./Modules/Scorm2004/scripts/buildrte/rte.js');
 
  184                $this->
sendHtml($player2004->get());
 
  187            case 'offlineMode_som':
 
  188                $log->write(
"offlineMode_som");
 
  189                $som = 
new ilGlobalTemplate(
'tpl.som.html', 
true, 
true, 
'Modules/ScormAicc');
 
  190                $som->setVariable(
"SOM_TITLE", 
"ILIAS SCORM Offline Manager"); 
 
  191                $som->setVariable(
"PLAYER12_URL", $this->offlineMode->player12_url);
 
  192                $som->setVariable(
"PLAYER2004_URL", $this->offlineMode->player2004_url);
 
  197                $this->
view($this->offlineMode->getOfflineMode(), $cmd);
 
  206        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  208        $tpl->addJavascript(
'./Modules/ScormAicc/scripts/ilsop.js');
 
  209        $tpl->addJavascript(
'./libs/bower/bower_components/pouchdb/dist/pouchdb.min.js');
 
  210        $tpl->addCss(
'./Modules/ScormAicc/templates/sop/sop.css', 
"screen");
 
  211        $tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.scorm_offline_mode.html", 
"Modules/ScormAicc");
 
  212        $tpl->setCurrentBlock(
'offline_content');
 
  213        $tpl->setVariable(
"Command", $cmd);
 
  214        $tpl->setVariable(
"CHECK_SYSTEM_REQUIREMENTS", $this->lng->txt(
'sop_check_system_requirements'));
 
  215        $tpl->setVariable(
"SOP_SYSTEM_CHECK_HTTPS", $this->lng->txt(
'sop_system_check_https'));
 
  216        $tpl->setVariable(
"SOP_SYSTEM_CHECK_ERROR", $this->lng->txt(
'sop_system_check_error'));
 
  217        $tpl->setVariable(
"LM_NOT_EXISTS", $this->lng->txt(
'sop_lm_not_exists'));
 
  218        $tpl->setVariable(
"EXPORT", $this->lng->txt(
'sop_export'));
 
  219        $tpl->setVariable(
"DESC_EXPORT", $this->lng->txt(
'sop_desc_export'));
 
  220        $tpl->setVariable(
"TEXT_START_OFFLINE", $this->lng->txt(
'sop_text_start_offline'));
 
  221        $tpl->setVariable(
"START_SOP", $this->lng->txt(
'sop_start_sop')); 
 
  222        $tpl->setVariable(
"TEXT_START_SOM", $this->lng->txt(
'sop_text_start_som'));
 
  223        $tpl->setVariable(
"START_SOM", $this->lng->txt(
'sop_start_som'));
 
  224        $tpl->setVariable(
"TEXT_PUSH_TRACKING", $this->lng->txt(
'sop_text_push_tracking'));
 
  225        $tpl->setVariable(
"PUSH_TRACKING", $this->lng->txt(
'sop_push_tracking'));
 
  227        $tpl->setVariable(
"CLIENT_ID_SOP", $this->clientIdSop);
 
  228        $tpl->setVariable(
"REF_ID", 
$_GET[
'ref_id']);
 
  229        $tpl->setVariable(
"LM_ID", $this->lmId);
 
  231        $tpl->setVariable(
"PURGE_CACHE", $this->lng->txt(
'sop_purge_cache')); 
 
  232        $tpl->setVariable(
"CMD_URL", $this->cmd_url);
 
  233        $tpl->setVariable(
"LM_CMD_URL", $this->offlineMode->lm_cmd_url);
 
  234        $tpl->setVariable(
"SOP_FRM_URL", $this->sop_frm_url);
 
  235        $tpl->setVariable(
"LM_FRM_URL", $this->lm_frm_url);
 
  236        $tpl->setVariable(
"PLAYER12_URL", $this->offlineMode->player12_url);
 
  237        $tpl->setVariable(
"PLAYER2004_URL", $this->offlineMode->player2004_url);
 
  238        $tpl->setVariable(
"SOM_URL", $this->offlineMode->som_url);
 
  239        $tpl->setVariable(
"TRACKING_URL", $this->tracking_url);
 
  240        $tpl->parseCurrentBlock();
 
  241        $tpl->printToStdout();
 
  247        $ilTabs = 
$DIC[
'ilTabs'];
 
  248        $ilLocator = 
$DIC[
'ilLocator'];
 
  251        $icon = (
$offline_mode == 
"online") ? 
"icon_sahs.svg" : 
"icon_sahs_offline.svg";
 
  252        $tabTitle = $this->lng->txt(
"offline_mode");
 
  254        $thisurl = $this->ctrl->getLinkTarget($this, $a_active);
 
  255        $ilTabs->addTab($a_active, $tabTitle, $thisurl);
 
  256        $ilTabs->activateTab($a_active);
 
  257        $tpl->loadStandardTemplate();
 
  260        $ilLocator->addRepositoryItems();
 
  267        header(
'Content-Type: text/html');
 
  268        header(
"Cache-Control: no-cache, must-revalidate"); 
 
  269        header(
"Expires: Sat, 26 Jul 1997 05:00:00 GMT"); 
 
  275        header(
'Content-Type: text/cache-manifest');
 
  276        header(
"Cache-Control: no-cache, must-revalidate"); 
 
  277        header(
"Expires: Sat, 26 Jul 1997 05:00:00 GMT"); 
 
An exception for terminatinating execution or to throw for unit testing.
special template class to simplify handling of ITX/PEAR
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
GUI class ilSCORMOfflineModeGUI.
view($offline_mode, $cmd)
sendManifest($manifest_str)
setOfflineModeTabs($offline_mode)
Class ilSCORMOfflineMode.
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getLocaljQueryPath()
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
redirection script todo: (a better solution should control the processing via a xml file)