ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilShopRepositoryExplorer.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once './Services/Repository/classes/class.ilRepositoryExplorer.php';
5
11{
16 public $root_id;
20 public $output;
21
25 public $ctrl;
26
31 public function __construct($a_target, $a_top_node = 0)
32 {
33 parent::ilRepositoryExplorer($a_target, $a_top_node);
34 }
35
40 public function setForceOpenPath($a_path)
41 {
42 $this->force_open_path = $a_path;
43 }
44
50 public function buildLinkTarget($a_node_id, $a_type)
51 {
52 global $ilCtrl;
53
54 switch($a_type)
55 {
56 case "cat":
57 return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
58
59 case "catr":
60 return "ilias.php?cmd=redirect&baseClass=ilshopcontroller&ref_id=".$a_node_id;
61
62 case "grp":
63 return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
64
65 case "crs":
66 return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
67
68 case "crsr":
69 return "ilias.php?cmd=redirect&baseClass=ilshopcontroller&ref_id=".$a_node_id;
70
71 case 'rcrs':
72 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
73 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
74 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
75 return $link;
76
77 default:
78 include_once('./Services/Link/classes/class.ilLink.php');
79 return ilLink::_getStaticLink($a_node_id, $a_type, true);
80 }
81 }
82
88 public function formatHeader(&$tpl, $a_obj_id, $a_option)
89 {
90 global $lng, $tree;
91
92 // custom icons
93 $path = ilObject::_getIcon($a_obj_id, "tiny", "root");
94
95 $tpl->setCurrentBlock("icon");
96 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
97 $title = $nd["title"];
98
99 if ($title == "ILIAS")
100 {
101 $title = $lng->txt("repository");
102 }
103
104 $tpl->setVariable("ICON_IMAGE", $path);
105 $tpl->setVariable("TXT_ALT_IMG", $lng->txt("icon")." ".$title);
106 $tpl->parseCurrentBlock();
107
108 $tpl->setCurrentBlock("link");
109 $tpl->setVariable("TITLE", $title);
110
111 $tpl->setVariable("LINK_TARGET", "ilias.php?baseClass=ilshopcontroller&ref_id=1");
112 $tpl->parseCurrentBlock();
113
114 $tpl->setCurrentBlock("element");
115 $tpl->parseCurrentBlock();
116 }
117}
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
Class ilShopRepositoryExplorer.
setForceOpenPath($a_path)
set force open path
__construct($a_target, $a_top_node=0)
formatHeader(&$tpl, $a_obj_id, $a_option)
$nd
Definition: error.php:11
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22