ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilContainerLinkListGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 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 
24 
36 {
37  var $ctrl;
38 
44  {
45  global $ilCtrl;
46 
47  $this->ctrl =& $ilCtrl;
48  }
49 
50  function &executeCommand()
51  {
52  $next_class = $this->ctrl->getNextClass($this);
53  $cmd = $this->ctrl->getCmd();
54  //$this->prepareOutput();
55 
56  switch($next_class)
57  {
58  default:
59  $this->$cmd();
60 
61  break;
62  }
63  return true;
64  }
65 
66  function show()
67  {
68  global $lng, $tree;
69 
70  $tpl = new ilTemplate("tpl.container_link_help.html", true, true);
71 
72  $type_ordering = array(
73  "cat", "fold", "crs", "icrs", "icla", "grp", "lres",
74  "glo", "webr", "file", "exc",
75  "tst", "svy", "mep", "qpl", "spl");
76 
77  $childs = $tree->getChilds($_GET["ref_id"]);
78  foreach($childs as $child)
79  {
80  if (in_array($child["type"], array("lm", "dbk", "sahs", "htlm")))
81  {
82  $cnt["lres"]++;
83  }
84  else
85  {
86  $cnt[$child["type"]]++;
87  }
88  }
89 
90  $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
91  $tpl->setVariable("TXT_HELP_HEADER", $lng->txt("help"));
92  foreach($type_ordering as $type)
93  {
94  $tpl->setCurrentBlock("row");
95  $tpl->setVariable("ROWCOL", "tblrow".((($i++)%2)+1));
96  if ($type != "lres")
97  {
98  $tpl->setVariable("TYPE", $lng->txt("objs_".$type).
99  " (".((int)$cnt[$type]).")");
100  }
101  else
102  {
103  $tpl->setVariable("TYPE", $lng->txt("learning_resources").
104  " (".((int)$cnt["lres"]).")");
105  }
106  $tpl->setVariable("TXT_LINK", "[list-".$type."]");
107  $tpl->parseCurrentBlock();
108  }
109  $tpl->show();
110  exit;
111 
112  }
113 
114 } // END class.ilContainerLinkListGUI
115 ?>