ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilPaymentObjectSelector.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4/*
5* ilPaymentObjectSelector
6*
7* @author Nadia Ahmad <nahmad@databay.de>
8* @version $Id: class.ilPaymentObjectSelector.php 20462 2009-07-07 15:33:41Z mjansen $
9* @ilCtrl_isCalledBy ilPaymentObjectSelector: ilPaymentStatisticGUI, ilObjPaymentSettingsGUI
10* @package core
11*/
12
13include_once("./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
14require_once './Services/Payment/classes/class.ilPaymentObject.php';
15
16
18{
22 public $ctrl;
23
24 private $classname;
25
30 public function __construct($parent_obj, $parent_cmd)
31 {
36 global $tree, $ilCtrl;
37
38 $this->ctrl = $ilCtrl;
39
40 parent::__construct("pobject_exp", $this, 'showObjectSelector', $tree);
41
42 $this->setTypeBlackList(array('adm', 'rolf', 'chat', 'frm'));
43 $this->classname = $this->ctrl->getCmdClass();
44 }
45
51 function isNodeClickable($node)
52 {
53 global $ilUser;
54
55 switch($node['type'])
56 {
57 case 'lm':
58 case 'crs':
59 case 'tst':
60 case 'sahs':
61 case 'file':
62 case 'htlm':
63 case 'exc':
64 case 'glo':
65 break;
66 default:
67 return false;
68 }
69
70 if ($this->classname == 'ilpaymentstatisticgui')
71 {
72 if (ilPaymentObject::_isPurchasable($node['ref_id'], $ilUser->getId(), true))
73 {
74 return true;
75 }
76 }
77 else if ($this->classname == 'ilobjpaymentsettingsgui')
78 {
79 if (ilPaymentObject::_isPurchasable($node['ref_id']))
80 {
81 return true;
82 }
83 }
84 else if($this->classname == 'ilpaymentobjectgui')
85 {
86 // object doesn't exist in payment_object
87 if(ilPaymentObject::_isNewObject($node['ref_id']))
88 {
89 return true;
90 }
91 }
92 else
93 {
94 if (ilPaymentObject::_isPurchasable($node['ref_id']))
95 {
96 return true;
97 }
98 }
99 return false;
100 }
101
109 function getNodeContent($a_node)
110 {
111 global $lng;
112
113 $title = $a_node["title"];
114 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
115 {
116 if ($title == "ILIAS")
117 {
118 $title = $lng->txt("repository");
119 }
120 }
121 return $title;
122 }
123
129 function getNodeHref($node)
130 {
131 $this->ctrl->setParameterByClass($this->classname,'sell_id',$node['ref_id']);
132
133 if ($this->classname == 'ilpaymentstatisticgui')
134 {
135 return $this->ctrl->getLinkTargetByClass($this->classname,'searchUser');
136 }
137 if ($this->classname == 'ilobjpaymentsettingsgui')
138 {
139 return $this->ctrl->getLinkTargetByClass($this->classname,'searchUserSP');
140 }
141 else
142 {
143 return $this->ctrl->getLinkTargetByClass($this->classname,'showSelectedObject');
144 }
145 }
146
147} // END class ilObjectSelector
getNodeContent($a_node)
overwritten method from baseclass Get node content
getNodeHref($node)
overwritten method from baseclass
isNodeClickable($node)
overwritten method from baseclass
static _isNewObject($a_ref_id)
static _isPurchasable($a_ref_id, $a_vendor_id=0, $a_check_trustee=false, $a_check_status=false)
Explorer class that works on tree objects (Services/Tree)
__construct($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree)
Constructor.
getNodeId($a_node)
Get id for node.
setTypeBlackList($a_val)
Set type black list.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15