ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPCImageMapTableGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 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 include_once("Services/Table/classes/class.ilTable2GUI.php");
25 include_once("Services/MediaObjects/classes/class.ilImageMapTableGUI.php");
26 
36 {
37 
41  function __construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object)
42  {
43  global $ilCtrl, $lng, $ilAccess, $lng;
44 
45  $this->pc_media_object = $a_pc_media_object;
46  parent::__construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object->getMediaObject());
47  }
48 
52  function getItems()
53  {
54  $std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
55  $this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId());
56  $areas = $std_alias_item->getMapAreas();
57 
58  $this->setData($areas);
59  }
60 
65  protected function fillRow($a_set)
66  {
67  global $lng, $ilCtrl, $ilAccess;
68 
69  $i = $a_set["Nr"];
70  $this->tpl->setVariable("CHECKBOX",
71  ilUtil::formCheckBox("", "area[]", $i));
72  $this->tpl->setVariable("VAR_NAME", "name_".$i);
73  $this->tpl->setVariable("VAL_NAME", $a_set["Link"]["Title"]);
74  $this->tpl->setVariable("VAL_SHAPE", $a_set["Shape"]);
75  $this->tpl->setVariable("VAL_COORDS",
76  implode(explode(",", $a_set["Coords"]), ", "));
77  switch ($a_set["Link"]["LinkType"])
78  {
79  case "ExtLink":
80  $this->tpl->setVariable("VAL_LINK", $a_set["Link"]["Href"]);
81  break;
82 
83  case "IntLink":
84  $link_str = $this->parent_obj->getMapAreaLinkString($a_set["Link"]["Target"],
85  $a_set["Link"]["Type"], $a_set["Link"]["TargetFrame"]);
86  $this->tpl->setVariable("VAL_LINK", $link_str);
87  break;
88  }
89  }
90 
91 }
92 ?>