Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 require_once("classes/class.ilExplorer.php");
00034 require_once './payment/classes/class.ilPaymentObject.php';
00035
00036
00037 class ilPaymentObjectSelector extends ilExplorer
00038 {
00039
00045 var $root_id;
00046 var $output;
00047 var $ctrl;
00048
00049 var $selectable_type;
00050 var $ref_id;
00051
00052 var $classname;
00059 function ilPaymentObjectSelector($a_target, $a_classname)
00060 {
00061 global $tree,$ilCtrl;
00062
00063 $this->ctrl = $ilCtrl;
00064
00065 parent::ilExplorer($a_target);
00066 $this->tree = $tree;
00067 $this->root_id = $this->tree->readRootId();
00068 $this->order_column = "title";
00069
00070 $this->setSessionExpandVariable("paya_link_expand");
00071
00072 $this->addFilter("adm");
00073 $this->addFilter("rolf");
00074 $this->addFilter("chat");
00075 #$this->addFilter('fold');
00076
00077 $this->setFilterMode(IL_FM_NEGATIVE);
00078 $this->setFiltered(true);
00079
00080 $this->classname = $a_classname;
00081 }
00082
00083 function buildLinkTarget($a_node_id, $a_type)
00084 {
00085 $this->ctrl->setParameterByClass($this->classname,'sell_id',$a_node_id);
00086
00087 if ($this->classname == 'ilpaymentstatisticgui')
00088 {
00089 return $this->ctrl->getLinkTargetByClass($this->classname,'searchUser');
00090 }
00091 if ($this->classname == 'ilobjpaymentsettingsgui')
00092 {
00093 return $this->ctrl->getLinkTargetByClass($this->classname,'searchUserSP');
00094 }
00095 else
00096 {
00097 return $this->ctrl->getLinkTargetByClass($this->classname,'showSelectedObject');
00098 }
00099
00100 }
00101
00102 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00103 {
00104 return '';
00105 }
00106
00107 function isClickable($a_type, $a_ref_id)
00108 {
00109 global $ilUser;
00110
00111 switch($a_type)
00112 {
00113 case 'lm':
00114 case 'crs':
00115 case 'tst':
00116 case 'sahs':
00117 case 'file':
00118
00119 ;
00120 break;
00121 default:
00122 return false;
00123 }
00124
00125
00126 if ($this->classname == 'ilpaymentstatisticgui')
00127 {
00128 if (!ilPaymentObject::_isPurchasable($a_ref_id, $ilUser->getId()))
00129 {
00130 return true;
00131 }
00132 }
00133 else if ($this->classname == 'ilobjpaymentsettingsgui')
00134 {
00135 if (!ilPaymentObject::_isPurchasable($a_ref_id))
00136 {
00137 return true;
00138 }
00139 }
00140 else
00141 {
00142 if (ilPaymentObject::_isPurchasable($a_ref_id))
00143 {
00144 return true;
00145 }
00146 }
00147 return false;
00148
00149 }
00150
00151 function setAlwaysClickable($a_value)
00152 {
00153 $this->always_clickable = $a_value;
00154 }
00155
00156 function showChilds($a_ref_id)
00157 {
00158 global $rbacsystem;
00159
00160 return true;
00161
00162 if ($a_ref_id == 0)
00163 {
00164 return true;
00165 }
00166
00167 if ($this->classname == 'ilpaymentstatisticgui')
00168 {
00169 if (!ilPaymentObject::_isPurchasable($a_ref_id, $ilUser->getId()))
00170 {
00171 return false;
00172 }
00173 }
00174 else if ($this->classname == 'ilobjpaymentsettingsgui')
00175 {
00176 if (!ilPaymentObject::_isPurchasable($a_ref_id))
00177 {
00178 return false;
00179 }
00180 }
00181 else
00182 {
00183 if (!ilPaymentObject::_isPurchasable($a_ref_id))
00184 {
00185 return false;
00186 }
00187 }
00188
00189 if($rbacsystem->checkAccess("visible", $a_ref_id))
00190 {
00191 return true;
00192 }
00193 else
00194 {
00195 return false;
00196 }
00197 }
00198
00199
00207 function formatHeader($a_obj_id,$a_option)
00208 {
00209 global $lng, $ilias;
00210
00211 $tpl = new ilTemplate("tpl.tree.html", true, true);
00212
00213 $tpl->setCurrentBlock("text");
00214 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
00215 $tpl->parseCurrentBlock();
00216
00217 $tpl->setCurrentBlock("row");
00218 $tpl->parseCurrentBlock();
00219
00220 $this->output[] = $tpl->get();
00221 }
00222
00223 }
00224 ?>