ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjectSelector.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 /*
5 * Repository Explorer
6 *
7 * @author Stefan Meyer <meyer@leifos.com>
8 * @version $Id: class.ilObjectSelector.php 4880 2004-09-06 10:55:33Z smeyer $
9 *
10 * @package core
11 */
12 
13 require_once("./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
14 
16 {
17 
23  public $root_id;
24  public $output;
25  public $ctrl;
26 
28  public $ref_id;
29 
33  function ilObjectSelector($a_target)
34  {
35  global $tree, $ilCtrl;
36 
37  $this->ctrl = $ilCtrl;
38 
39  parent::ilExplorer($a_target);
40  $this->tree = $tree;
41  $this->root_id = $this->tree->readRootId();
42  $this->order_column = "title";
43 
44  $this->setSessionExpandVariable("paya_link_expand");
45 
46  // add here all container objects
47  #$this->addFilter("root");
48  #$this->addFilter("cat");
49 
50  #$this->setFilterMode(IL_FM_NEGATIVE);
51  $this->setFiltered(false);
52  }
53 
54  function buildLinkTarget($a_node_id, $a_type)
55  {
56  if($a_type == $this->selectable_type)
57  {
58  $this->ctrl->setParameterByClass('ilpaymentobjectgui','source_id',$a_node_id);
59  return $this->ctrl->getLinkTargetByClass('ilpaymentobjectgui','linkChilds');
60  }
61  else
62  {
63  $this->ctrl->setParameterByClass('ilrepositorygui',"ref_id",$this->ref_id);
64  return $this->ctrl->getLinkTargetByClass('ilrepositorygui','linkSelector');
65  }
66  }
67 
68  function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
69  {
70  return '';
71  }
72 
73  function isClickable($a_type, $a_ref_id)
74  {
75  return $a_type == $this->selectable_type and $a_ref_id != $this->ref_id;
76  }
77 
78  function showChilds($a_ref_id)
79  {
80  global $rbacsystem;
81 
82  if ($a_ref_id == 0)
83  {
84  return true;
85  }
86 
87  if ($rbacsystem->checkAccess("read", $a_ref_id))
88  {
89  return true;
90  }
91  else
92  {
93  return false;
94  }
95  }
96 
97 
105  function formatHeader($a_obj_id, $a_option)
106  {
107  global $lng;
108 
109  $tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
110 
111  $tpl->setCurrentBlock("text");
112  $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
113  $tpl->parseCurrentBlock();
114 
115  $tpl->setCurrentBlock("row");
116  $tpl->parseCurrentBlock();
117 
118  $this->output[] = $tpl->get();
119  }
120 
121 } // END class ilObjectSelector
122 ?>