ILIAS  release_4-4 Revision
class.ilForumMoveTopicsExplorer.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php';
5 
11 {
15  protected $current_frm_ref_id = 0;
16 
20  public function __construct($a_parent_obj, $a_parent_cmd, $a_selection_gui = null, $a_selection_cmd = "selectObject",
21  $a_selection_par = "sel_ref_id")
22  {
23  parent::__construct($a_parent_obj, $a_parent_cmd, $a_selection_gui, $a_selection_cmd, $a_selection_par);
24  $this->setTypeWhiteList(array('root', 'cat', 'fold', 'crs', 'grp', 'frm'));
25  $this->setSelectMode('frm_ref_id');
26  }
27 
31  public function getCurrentFrmRefId()
32  {
34  }
35 
40  {
41  $this->current_frm_ref_id = $current_frm_ref_id;
42  }
43 
47  function isNodeVisible($a_node)
48  {
49  return parent::isNodeVisible($a_node);
50  }
51 
55  function renderNode($a_node, $tpl)
56  {
57  $this->select_postvar = $this->isNodeClickable($a_node) ? 'frm_ref_id' : '';
58  parent::renderNode($a_node, $tpl);
59  }
60 
64  function isNodeClickable($a_node)
65  {
69  global $ilAccess;
70 
71  if($a_node['type'] == 'frm')
72  {
73  if($this->getCurrentFrmRefId() && $this->getCurrentFrmRefId() == $a_node['child'])
74  {
75  return false;
76  }
77 
78  if(!$ilAccess->checkAccess('read', '', $a_node['child']))
79  {
80  return false;
81  }
82 
83  $is_valid_type = true;
84  if(is_array($this->getClickableTypes()) && count($this->getClickableTypes()) > 0)
85  {
86  $is_valid_type = in_array($a_node['type'], $this->getClickableTypes());
87  }
88 
89  return $ilAccess->checkAccess('moderate_frm', '', $a_node['child']) && $is_valid_type;
90  }
91 
92  return false;
93  }
94 }
Explorer for selecting repository items.
setSelectMode($a_postvar, $a_multi=false)
Set select mode (to deactivate, pass an empty string as postvar)
setTypeWhiteList($a_val)
Set type white list.
__construct($a_parent_obj, $a_parent_cmd, $a_selection_gui=null, $a_selection_cmd="selectObject", $a_selection_par="sel_ref_id")
{}
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
getClickableTypes()
get whitelist for clickable items