ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjLearningModuleSubItemListGUI.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 include_once './Services/Object/classes/class.ilSubItemListGUI.php';
24 
35 {
36 
41  public function getHTML()
42  {
43  global $lng,$ilUser;
44 
45  include_once 'Modules/LearningModule/classes/class.ilLMObject.php';
46  foreach($this->getSubItemIds(true) as $sub_item)
47  {
48  if(is_object($this->getHighlighter()) and strlen($this->getHighlighter()->getContent($this->getObjId(),$sub_item)))
49  {
50  $this->tpl->setCurrentBlock('sea_fragment');
51  $this->tpl->setVariable('TXT_FRAGMENT',$this->getHighlighter()->getContent($this->getObjId(),$sub_item));
52  $this->tpl->parseCurrentBlock();
53  }
54  $this->tpl->setCurrentBlock('subitem');
55 
56  $this->tpl->setVariable('SEPERATOR',':');
57 
58 
59  switch(ilLMObject::_lookupType($sub_item,$this->getObjId()))
60  {
61  case 'pg':
62  $this->getItemListGUI()->setChildId($sub_item);
63  $this->tpl->setVariable("SUBITEM_TYPE",$lng->txt('obj_pg'));
64  $link = $this->getItemListGUI()->getCommandLink('page');
65  include_once './Services/Search/classes/class.ilUserSearchCache.php';
66  $link .= ('&srcstring=1');
67  $this->tpl->setVariable('LINK',$link);
68  $this->tpl->setVariable('TARGET',$this->getItemListGUI()->getCommandFrame('page'));
69  $this->tpl->setVariable('TITLE',ilLMObject::_lookupTitle($sub_item));
70  break;
71 
72  case 'st':
73 
74  $this->getItemListGUI()->setChildId($sub_item);
75  $this->tpl->setVariable("SUBITEM_TYPE",$lng->txt('obj_st'));
76  $link = $this->getItemListGUI()->getCommandLink('page');
77  include_once './Services/Search/classes/class.ilUserSearchCache.php';
78  $link .= ('&srcstring=1');
79  $this->tpl->setVariable('LINK',$link);
80  $this->tpl->setVariable('TARGET',$this->getItemListGUI()->getCommandFrame('page'));
81  $this->tpl->setVariable('TITLE',ilLMObject::_lookupTitle($sub_item));
82  break;
83 
84  default:
85 
86  if(ilObject::_lookupType($sub_item) != 'file')
87  {
88  return '';
89  }
90 
91  $this->getItemListGUI()->setChildId('il__file_'.$sub_item);
92  $this->tpl->setVariable('SUBITEM_TYPE',$lng->txt('obj_file'));
93  $link = $this->getItemListGUI()->getCommandLink('downloadFile');
94  $this->tpl->setVariable('LINK',$link);
95  $this->tpl->setVariable('TITLE',ilObject::_lookupTitle($sub_item));
96  break;
97  }
98 
99 
100  $this->tpl->parseCurrentBlock();
101  }
102 
103  $this->showDetailsLink();
104 
105  return $this->tpl->get();
106  }
107 }
108 ?>