ILIAS  release_4-3 Revision
 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  "Services/Container");
72 
73  $type_ordering = array(
74  "cat", "fold", "crs", "icrs", "icla", "grp", "chat", "frm", "lres",
75  "glo", "webr", "file", "exc",
76  "tst", "svy", "mep", "qpl", "spl");
77 
78  $childs = $tree->getChilds($_GET["ref_id"]);
79  foreach($childs as $child)
80  {
81  if (in_array($child["type"], array("lm", "dbk", "sahs", "htlm")))
82  {
83  $cnt["lres"]++;
84  }
85  else
86  {
87  $cnt[$child["type"]]++;
88  }
89  }
90 
91  $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
92  $tpl->setVariable("TXT_HELP_HEADER", $lng->txt("help"));
93  foreach($type_ordering as $type)
94  {
95  $tpl->setCurrentBlock("row");
96  $tpl->setVariable("ROWCOL", "tblrow".((($i++)%2)+1));
97  if ($type != "lres")
98  {
99  $tpl->setVariable("TYPE", $lng->txt("objs_".$type).
100  " (".((int)$cnt[$type]).")");
101  }
102  else
103  {
104  $tpl->setVariable("TYPE", $lng->txt("learning_resources").
105  " (".((int)$cnt["lres"]).")");
106  }
107  $tpl->setVariable("TXT_LINK", "[list-".$type."]");
108  $tpl->parseCurrentBlock();
109  }
110  $tpl->show();
111  exit;
112 
113  }
114 
115 } // END class.ilContainerLinkListGUI
116 ?>