FusionDirectory
 All Data Structures Files Functions Variables
class_simpleSelectManagement.inc
1 <?php
2 /*
3  This code is part of FusionDirectory (http://www.fusiondirectory.org/)
4  Copyright (C) 2013-2016 FusionDirectory
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20 
22 {
23  protected $skipFooter = TRUE;
24  protected $skipHeader = TRUE;
25 
26  protected $skipCpHandler = TRUE;
27  protected $skipSnapHandler = TRUE;
28  protected $autoActions = FALSE;
29 
30  protected $departmentRootVisible = FALSE;
31 
32  function __construct()
33  {
34  if ($this->listXMLPath === NULL) {
35  $this->listXMLPath = get_template_path('simple-select-list.xml', TRUE, dirname(__FILE__));
36  }
37 
38  parent::__construct();
39  }
40 
41  /* Build the action menu, fill the object definition, etc, based on objectTypes info */
42  function configureHeadpage ()
43  {
44  parent::configureHeadpage();
45  $this->headpage->registerElementFilter("selectLink", "simpleSelectManagement::filterSelectLink");
46  }
47 
48  function configureFilter ()
49  {
50  parent::configureFilter();
51  if ($this->autoFilter) {
52  $this->filter->query['0']['backend'] = 'LDAPBlacklist';
53  }
54  }
55 
56  function configureHeadline ()
57  {
58  }
59 
60  function configureFilterCategory ()
61  {
62  $infos = objects::infos($this->objectTypes[0]);
63  $this->filter->category = $infos['aclCategory'];
64  }
65 
66  static function filterSelectLink()
67  {
68  if (func_num_args() < 4) {
69  return '&nbsp';
70  }
71  $pid = func_get_arg(0);
72  $row = func_get_arg(1);
73  $dn = func_get_arg(2);
74  $trans = func_get_arg(3);
75  if (is_array($trans)) {
76  $trans = $trans[0];
77  }
78  if ($trans != '') {
79  return '<a href="?plug='.$_GET['plug'].'&amp;PID='.$pid.'&amp;act=listing_select_'.$row.'&amp;add_finish=1" title="'.htmlentities($dn, ENT_COMPAT, 'UTF-8').'">'.htmlentities($trans, ENT_COMPAT, 'UTF-8').'</a>';
80  }
81 
82  return '';
83  }
84 }
85 ?>
This class contains all the function needed to manage filter.
get_template_path($filename= '', $plugin=FALSE, $path= '')
Return themed path for specified base file.
Definition: functions.inc:296
query()
Query.