ILIAS  Release_4_1_x_branch Revision 61804
 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  foreach ($areas as $k => $a)
59  {
60  $areas[$k]["title"] = $a["Link"]["Title"];
61  }
62  $areas = ilUtil::sortArray($areas, "title", "asc", false, true);
63  $this->setData($areas);
64  }
65 
70  protected function fillRow($a_set)
71  {
72  global $lng, $ilCtrl, $ilAccess;
73 
74  $i = $a_set["Nr"];
75  $this->tpl->setVariable("CHECKBOX",
76  ilUtil::formCheckBox("", "area[]", $i));
77  $this->tpl->setVariable("VAR_NAME", "name_".$i);
78  $this->tpl->setVariable("VAL_NAME", $a_set["Link"]["Title"]);
79  $this->tpl->setVariable("VAL_SHAPE", $a_set["Shape"]);
80  $this->tpl->setVariable("VAL_COORDS",
81  implode(explode(",", $a_set["Coords"]), ", "));
82  switch ($a_set["Link"]["LinkType"])
83  {
84  case "ExtLink":
85  $this->tpl->setVariable("VAL_LINK", $a_set["Link"]["Href"]);
86  break;
87 
88  case "IntLink":
89  $link_str = $this->parent_obj->getMapAreaLinkString($a_set["Link"]["Target"],
90  $a_set["Link"]["Type"], $a_set["Link"]["TargetFrame"]);
91  $this->tpl->setVariable("VAL_LINK", $link_str);
92  break;
93  }
94  }
95 
96 }
97 ?>