ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLearningProgressGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
38 include_once './Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
39 
41 {
42  function ilLearningProgressGUI($a_mode,$a_ref_id = 0,$a_user_id = 0)
43  {
44  parent::ilLearningProgressBaseGUI($a_mode,$a_ref_id,$a_user_id);
45  }
46 
50  function &executeCommand()
51  {
52  global $ilBench;
53 
54  $ilBench->start('LearningProgress','0000_Start');
55 
56 
57  $this->ctrl->setReturn($this, "");
58 
59  // E.g personal desktop mode needs locator header icon ...
60  $this->__buildHeader();
61  switch($this->__getNextClass())
62  {
63  case 'illplistofprogressgui':
64  include_once 'Services/Tracking/classes/class.ilLPListOfProgressGUI.php';
65 
67  $this->__setCmdClass('illplistofprogressgui');
68  $lop_gui = new ilLPListOfProgressGUI($this->getMode(),$this->getRefId(),$this->getUserId());
69  $this->ctrl->forwardCommand($lop_gui);
70  break;
71 
72  case 'illplistofobjectsgui':
73  include_once 'Services/Tracking/classes/class.ilLPListOfObjectsGUI.php';
74 
76  $loo_gui = new ilLPListOfObjectsGUI($this->getMode(),$this->getRefId());
77  $this->__setCmdClass('illplistofobjectsgui');
78  $this->ctrl->forwardCommand($loo_gui);
79  break;
80 
81  case 'illplistofsettingsgui':
82  include_once 'Services/Tracking/classes/class.ilLPListOfSettingsGUI.php';
83 
85  $los_gui = new ilLPListOfSettingsGUI($this->getMode(),$this->getRefId());
86  $this->__setCmdClass('illplistofsettingsgui');
87  $this->ctrl->forwardCommand($los_gui);
88  break;
89 
90  case 'illmstatisticsgui':
91  include_once 'Services/Tracking/classes/class.ilLMStatisticsGUI.php';
92 
94  $los_gui = new ilLMStatisticsGUI($this->getMode(),$this->getRefId());
95  $this->__setCmdClass('illmstatisticsgui');
96  $this->ctrl->forwardCommand($los_gui);
97  break;
98 
99 
100  default:
101  die("No mode given");
102  }
103 
104  // E.G personal desktop mode needs $tpl->show();
105  $this->__buildFooter();
106 
107 
108  $ilBench->stop('LearningProgress','0000_Start');
109 
110  return true;
111  }
112 
113  function __setCmdClass($a_class)
114  {
115  // If cmd class == 'illearningprogressgui' the cmd class is set to the the new forwarded class
116  // otherwise e.g illplistofprogressgui tries to forward (back) to illearningprogressgui.
117 
118  if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
119  {
120  $this->ctrl->setCmdClass(strtolower($a_class));
121  }
122  return true;
123  }
124 
125  function __getNextClass()
126  {
127  global $ilAccess;
128 
129  if(strlen($next_class = $this->ctrl->getNextClass()))
130  {
131  if($this->getMode() == LP_MODE_PERSONAL_DESKTOP)
132  {
133  $_SESSION['il_lp_history'] = $next_class;
134  }
135  return $next_class;
136  }
137  switch($this->getMode())
138  {
140  return 'illplistofobjectsgui';
141 
142  case LP_MODE_REPOSITORY:
143  if(!$this->anonymized and
144  !$this->isObjectAnonymized() and
145  $ilAccess->checkAccess('edit_learning_progress','',$this->getRefId()))
146  {
147  return 'illplistofobjectsgui';
148  }
149  return 'illplistofprogressgui';
150 
152  if(strlen($_SESSION['il_lp_history']))
153  {
154  return $_SESSION['il_lp_history'];
155  }
156  return 'illplistofprogressgui';
157 
158  case LP_MODE_USER_FOLDER:
159  return 'illplistofprogressgui';
160  }
161  }
162 }
163 ?>