31 $ilias = $DIC[
'ilias'];
35 include_once
"./Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php";
36 $this->
ilias = $ilias;
38 $lng->loadLanguageModule(
"sop");
41 $this->ctrl->saveParameter($this,
"ref_id");
43 $this->offline_mode = $this->offlineMode->getOfflineMode();
53 $this->refId =
$_GET[
"ref_id"];
55 $this->clientIdSop = $this->offlineMode->getClientIdSop();
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 ilTemplate(
'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 ilTemplate(
'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 ilTemplate(
'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 ilTemplate(
'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 include_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
171 $player2004->setVariable(
'INLINE_CSS', ilSCORM13Player::getInlineCss());
173 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
176 $player2004->setVariable(
'JS_SCRIPTS',
'./Modules/Scorm2004/scripts/buildrte/rte.js');
185 $this->
sendHtml($player2004->get());
188 case 'offlineMode_som':
189 $log->write(
"offlineMode_som");
190 $som =
new ilTemplate(
'tpl.som.html',
true,
true,
'Modules/ScormAicc');
191 $som->setVariable(
"SOM_TITLE",
"ILIAS SCORM Offline Manager");
192 $som->setVariable(
"PLAYER12_URL", $this->offlineMode->player12_url);
193 $som->setVariable(
"PLAYER2004_URL", $this->offlineMode->player2004_url);
198 $this->
view($this->offlineMode->getOfflineMode(), $cmd);
209 $tpl->addJavascript(
'./Modules/ScormAicc/scripts/ilsop.js');
210 $tpl->addJavascript(
'./libs/bower/bower_components/pouchdb/dist/pouchdb.min.js');
211 $tpl->addCss(
'./Modules/ScormAicc/templates/sop/sop.css',
"screen");
212 $tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.scorm_offline_mode.html",
"Modules/ScormAicc");
213 $tpl->setCurrentBlock(
'offline_content');
214 $tpl->setVariable(
"Command", $cmd);
215 $tpl->setVariable(
"CHECK_SYSTEM_REQUIREMENTS", $this->lng->txt(
'sop_check_system_requirements'));
216 $tpl->setVariable(
"SOP_SYSTEM_CHECK_HTTPS", $this->lng->txt(
'sop_system_check_https'));
217 $tpl->setVariable(
"SOP_SYSTEM_CHECK_ERROR", $this->lng->txt(
'sop_system_check_error'));
218 $tpl->setVariable(
"LM_NOT_EXISTS", $this->lng->txt(
'sop_lm_not_exists'));
219 $tpl->setVariable(
"EXPORT", $this->lng->txt(
'sop_export'));
220 $tpl->setVariable(
"DESC_EXPORT", $this->lng->txt(
'sop_desc_export'));
221 $tpl->setVariable(
"TEXT_START_OFFLINE", $this->lng->txt(
'sop_text_start_offline'));
222 $tpl->setVariable(
"START_SOP", $this->lng->txt(
'sop_start_sop'));
223 $tpl->setVariable(
"TEXT_START_SOM", $this->lng->txt(
'sop_text_start_som'));
224 $tpl->setVariable(
"START_SOM", $this->lng->txt(
'sop_start_som'));
225 $tpl->setVariable(
"TEXT_PUSH_TRACKING", $this->lng->txt(
'sop_text_push_tracking'));
226 $tpl->setVariable(
"PUSH_TRACKING", $this->lng->txt(
'sop_push_tracking'));
227 $tpl->setVariable(
"CLIENT_ID", CLIENT_ID);
228 $tpl->setVariable(
"CLIENT_ID_SOP", $this->clientIdSop);
229 $tpl->setVariable(
"REF_ID",
$_GET[
'ref_id']);
230 $tpl->setVariable(
"LM_ID", $this->lmId);
232 $tpl->setVariable(
"PURGE_CACHE", $this->lng->txt(
'sop_purge_cache'));
233 $tpl->setVariable(
"CMD_URL", $this->cmd_url);
234 $tpl->setVariable(
"LM_CMD_URL", $this->offlineMode->lm_cmd_url);
235 $tpl->setVariable(
"SOP_FRM_URL", $this->sop_frm_url);
236 $tpl->setVariable(
"LM_FRM_URL", $this->lm_frm_url);
237 $tpl->setVariable(
"PLAYER12_URL", $this->offlineMode->player12_url);
238 $tpl->setVariable(
"PLAYER2004_URL", $this->offlineMode->player2004_url);
239 $tpl->setVariable(
"SOM_URL", $this->offlineMode->som_url);
240 $tpl->setVariable(
"TRACKING_URL", $this->tracking_url);
241 $tpl->parseCurrentBlock();
248 $ilTabs = $DIC[
'ilTabs'];
249 $ilLocator = $DIC[
'ilLocator'];
252 $icon = (
$offline_mode ==
"online") ?
"icon_sahs.svg" :
"icon_sahs_offline.svg";
253 $tabTitle = $this->lng->txt(
"offline_mode");
255 $thisurl = $this->ctrl->getLinkTarget($this, $a_active);
256 $ilTabs->addTab($a_active, $tabTitle, $thisurl);
257 $ilTabs->activateTab($a_active);
258 $tpl->getStandardTemplate();
261 $ilLocator->addRepositoryItems();
268 header(
'Content-Type: text/html');
269 header(
"Cache-Control: no-cache, must-revalidate");
270 header(
"Expires: Sat, 26 Jul 1997 05:00:00 GMT");
276 header(
'Content-Type: text/cache-manifest');
277 header(
"Cache-Control: no-cache, must-revalidate");
278 header(
"Expires: Sat, 26 Jul 1997 05:00:00 GMT");
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
GUI class ilSCORMOfflineModeGUI.
static _lookupTitle($a_id)
lookup object title
setOfflineModeTabs($offline_mode)
static _lookupObjectId($a_ref_id)
lookup object id
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
sendManifest($manifest_str)
Class ilSCORMOfflineMode.
static redirect($a_script)
static getLocaljQueryPath()
view($offline_mode, $cmd)