ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSCORMOfflineModeGUI Class Reference

GUI class ilSCORMOfflineModeGUI. More...

+ Collaboration diagram for ilSCORMOfflineModeGUI:

Public Member Functions

 __construct ($type)
 
 executeCommand ()
 
 view ($offline_mode, $message="")
 
 importStop ()
 
 setOfflineModeTabs ($a_active)
 

Data Fields

 $lmId
 
 $clientIdSop
 
 $offlineMode
 
 $online_icon
 
 $offline_icon
 
 $icon
 

Detailed Description

GUI class ilSCORMOfflineModeGUI.

GUI class for scorm offline player connection

Author
Uwe Kohnle kohnl.nosp@m.e@in.nosp@m.terne.nosp@m.tleh.nosp@m.rer-g.nosp@m.mbh..nosp@m.de
Version
Id
class.ilSCORMOfflineModeGUI.php

Definition at line 14 of file class.ilSCORMOfflineModeGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCORMOfflineModeGUI::__construct (   $type)

Definition at line 23 of file class.ilSCORMOfflineModeGUI.php.

References $ilCtrl, $lng, $online_icon, and $tpl.

23  {
24  global $ilias, $tpl, $lng, $ilCtrl;
25  include_once "./Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php";
26  $this->ilias = $ilias;
27  $this->tpl = $tpl;
28  $lng->loadLanguageModule("sop");
29  $this->lng = $lng;
30  $this->ctrl = $ilCtrl;
31  $this->ctrl->saveParameter($this, "ref_id");
32  $this->offlineMode = new ilSCORMOfflineMode();
33  $this->online_icon = 'icon_lm.svg';
34  $this->offline_icon = 'icon_slm_offline.svg';
35  $this->icon = $this->online_icon;
36  }
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
global $lng
Definition: privfeed.php:17
Class ilSCORMOfflineMode.

Member Function Documentation

◆ executeCommand()

ilSCORMOfflineModeGUI::executeCommand ( )

Definition at line 38 of file class.ilSCORMOfflineModeGUI.php.

References $_GET, $cmd, $ilCtrl, $tpl, ilObject\_lookupObjectId(), ilUtil\deliverFile(), ilUtil\getDataDir(), setOfflineModeTabs(), and view().

39  {
40  global $tpl, $ilCtrl;
41  $this->lmId = ilObject::_lookupObjectId($_GET["ref_id"]);
42  $this->clientIdSop = $this->offlineMode->getClientIdSop();
43  $cmd = $ilCtrl->getCmd();
44  $this->setOfflineModeTabs($cmd);
45  switch($cmd){
46  case 'offlineMode_il2sopContent':
47  ilUtil::deliverFile(ilUtil::getDataDir()."/lm_data/lm_".$this->lmId.".zip","lm_".$this->lmId.".zip");
48  break;
49  case 'offlineMode_il2sop':
50  $this->offlineMode->il2sop();
51  break;
52  case 'offlineMode_il2sopStop':
53  $this->offlineMode->setOfflineMode("online");
54  $this->view($this->offlineMode->getOfflineMode(),"msg_export_failure");
55  break;
56  case 'offlineMode_il2sopOk':
57  $this->offlineMode->setOfflineMode("offline");
58  $this->view($this->offlineMode->getOfflineMode(),"msg_export_ok");
59  break;
60  case 'offlineMode_sop2il':
61  $this->offlineMode->sop2il();
62  break;
63  case 'offlineMode_sop2ilStop':
64  $this->offlineMode->setOfflineMode("offline");
65  $this->view($this->offlineMode->getOfflineMode(),"msg_push_tracking_failure");
66  break;
67  case 'offlineMode_sop2ilOk':
68  $this->offlineMode->setOfflineMode("online");
69  $this->view($this->offlineMode->getOfflineMode(),"msg_push_tracking_ok");
70  break;
71  default:
72  if ($this->offlineMode->getOfflineMode() == "il2sop") $this->offlineMode->setOfflineMode("online");
73  $this->view($this->offlineMode->getOfflineMode());
74  break;
75  }
76  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
view($offline_mode, $message="")
global $tpl
Definition: ilias.php:8
static _lookupObjectId($a_ref_id)
lookup object id
global $ilCtrl
Definition: ilias.php:18
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ importStop()

ilSCORMOfflineModeGUI::importStop ( )

Definition at line 132 of file class.ilSCORMOfflineModeGUI.php.

132  {
133  }

◆ setOfflineModeTabs()

ilSCORMOfflineModeGUI::setOfflineModeTabs (   $a_active)

Definition at line 135 of file class.ilSCORMOfflineModeGUI.php.

References $tpl, ilObject\_lookupTitle(), and ilUtil\getImagePath().

Referenced by executeCommand().

136  {
137  global $ilTabs, $ilLocator,$tpl;
138  $icon = ($this->offlineMode->getOfflineMode() == "online") ? "icon_lm.svg" : "icon_slm_offline.svg";
139  $tabTitle = $this->lng->txt("offline_mode");
140  $thisurl =$this->ctrl->getLinkTarget($this, $a_active);
141  $ilTabs->addTab($a_active, $tabTitle, $thisurl);
142  $ilTabs->activateTab($a_active);
143  $tpl->getStandardTemplate();
144  $tpl->setTitle(ilObject::_lookupTitle($this->lmId));
145  $tpl->setTitleIcon(ilUtil::getImagePath($icon));
146  $ilLocator->addRepositoryItems();
147  $ilLocator->addItem(ilObject::_lookupTitle($this->lmId),$thisurl);
148  $tpl->setLocator();
149  }
static _lookupTitle($a_id)
lookup object title
global $tpl
Definition: ilias.php:8
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilSCORMOfflineModeGUI::view (   $offline_mode,
  $message = "" 
)

Definition at line 78 of file class.ilSCORMOfflineModeGUI.php.

References $_GET, $tpl, and ilUtil\getImagePath().

Referenced by executeCommand().

78  {
79  global $tpl;
80  $this->icon = ($offline_mode == "offline") ? $this->offline_icon : $this->online_icon;
81  // Fill meta header tags
82  $tpl->setCurrentBlock('mh_meta_item');
83  $tpl->setVariable('MH_META_NAME','require-sop-version');
84  $tpl->setVariable('MH_META_CONTENT',"0.1");
85  $tpl->parseCurrentBlock();
86 // $tpl->addJavascript('./Modules/ScormAicc/scripts/sopConnector.js');
87  $tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scorm_offline_mode.html", "Modules/ScormAicc");
88  $tpl->setCurrentBlock('offline_content');
89  $tpl->setTitleIcon(ilUtil::getImagePath($this->icon));
90 
91  $tpl->setVariable("CHECK_SYSTEM_REQUIREMENTS",$this->lng->txt('sop_check_system_requirements'));
92  $tpl->setVariable("FIREFOX_REQUIRED",$this->lng->txt('sop_firefox_required'));
93  $tpl->setVariable("MSG_YOUR_BROWSER",$this->lng->txt('sop_msg_your_browser'));
94  $tpl->setVariable("MSG_FIREFOX_NOT_PORTABLE",$this->lng->txt('sop_msg_firefox_not_portable'));
95  $tpl->setVariable("MSG_FIREFOX_VERSION_NOT_SUPPORTED",$this->lng->txt('sop_msg_firefox_version_not_supported'));
96  $tpl->setVariable("MSG_FIREFOX_DOWNLOAD_WIN",$this->lng->txt('sop_msg_firefox_download_win'));
97  $tpl->setVariable("MSG_FIREFOX_DOWNLOAD_LINUX",$this->lng->txt('sop_msg_firefox_download_linux'));
98  $tpl->setVariable("MSG_FIREFOX_DOWNLOAD_MAC",$this->lng->txt('sop_msg_firefox_download_mac'));
99  $tpl->setVariable("MSG_FIREFOX_AFTER_DOWNLOAD",$this->lng->txt('sop_msg_firefox_after_download'));
100  $tpl->setVariable("MSG_FIREFOX_CONFIG",$this->lng->txt('sop_msg_firefox_config'));
101  $tpl->setVariable("MSG_FIREFOX_HTML5",$this->lng->txt('sop_msg_firefox_html5'));
102  $tpl->setVariable("ALREADY_EXPORTED",$this->lng->txt('sop_already_exported'));
103  $tpl->setVariable("XPI_INSTALL",sprintf($this->lng->txt('sop_xpi_install'),"<a href='./Modules/ScormAicc/sop/sop.xpi'>sop.xpi</a>",false));
104  $tpl->setVariable("RELOAD_PAGE",$this->lng->txt('sop_reload_page'));
105  $tpl->setVariable("TEXT_EXPORT",$this->lng->txt('sop_text_export'));
106  $tpl->setVariable("EXPORT",$this->lng->txt('sop_export'));
107  $tpl->setVariable("DESC_EXPORT",$this->lng->txt('sop_desc_export'));
108  $tpl->setVariable("TEXT_START_OFFLINE",$this->lng->txt('sop_text_start_offline'));
109  $tpl->setVariable("START_OFFLINE",$this->lng->txt('sop_start_offline'));
110  $tpl->setVariable("TEXT_START_SOM",$this->lng->txt('sop_text_start_som'));
111  $tpl->setVariable("START_SOM",$this->lng->txt('sop_start_som'));
112  $tpl->setVariable("TEXT_PUSH_TRACKING",$this->lng->txt('sop_text_push_tracking'));
113  $tpl->setVariable("PUSH_TRACKING",$this->lng->txt('sop_push_tracking'));
114  $tpl->setVariable("MSG_LM_NOT_EXISTS",$this->lng->txt('sop_msg_lm_not_exists'));
115  $tpl->setVariable("MSG_CLOSE_LM",$this->lng->txt('sop_msg_close_lm'));
116  $tpl->setVariable("MSG_EXPORT_CONTENT",$this->lng->txt('sop_msg_export_content'));
117  $tpl->setVariable("MSG_EXPORT_TRACKING",$this->lng->txt('sop_msg_export_tracking'));
118  $tpl->setVariable("MSG_PUSH_TRACKING",$this->lng->txt('sop_msg_push_tracking'));
119  $tpl->setVariable("MSG_PUSH_TRACKING_OK",$this->lng->txt('sop_msg_push_tracking_ok'));
120 
121  $tpl->setVariable("CLIENT_ID",CLIENT_ID);
122  $tpl->setVariable("CLIENT_ID_SOP",$this->clientIdSop);
123  $tpl->setVariable("REF_ID",$_GET['ref_id']);
124  $tpl->setVariable("LM_ID",$this->lmId);
125  $tpl->setVariable("OFFLINE_MODE",$offline_mode);
126  if ($message != "") $tpl->setVariable("MESSAGE_RESULT",$this->lng->txt('sop_'.$message));
127 // if ($message==""msg_export_failure,msg_export_ok,msg_push_tracking_failure,msg_push_tracking_ok
128 
129  $tpl->parseCurrentBlock();
130  $tpl->show();
131  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $clientIdSop

ilSCORMOfflineModeGUI::$clientIdSop

Definition at line 17 of file class.ilSCORMOfflineModeGUI.php.

◆ $icon

ilSCORMOfflineModeGUI::$icon

Definition at line 21 of file class.ilSCORMOfflineModeGUI.php.

◆ $lmId

ilSCORMOfflineModeGUI::$lmId

Definition at line 16 of file class.ilSCORMOfflineModeGUI.php.

◆ $offline_icon

ilSCORMOfflineModeGUI::$offline_icon

Definition at line 20 of file class.ilSCORMOfflineModeGUI.php.

◆ $offlineMode

ilSCORMOfflineModeGUI::$offlineMode

Definition at line 18 of file class.ilSCORMOfflineModeGUI.php.

◆ $online_icon

ilSCORMOfflineModeGUI::$online_icon

Definition at line 19 of file class.ilSCORMOfflineModeGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: