1 <?php
2 /*
3 * This code is part of GOsa (http://www.gosa-project.org)
4 * Copyright (C) 2003-2008 GONICUS GmbH
5 *
6 * ID: $$Id$$
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
23 class acltab extends tabs
24 {
26 function acltab($config, $data, $dn)
27 {
28 $data = array(array("CLASS" => "acl" , "NAME" => _("ACL")));
30 /* Save dn */
31 $this->dn= $dn;
32 $this->config= $config;
34 $baseobject= NULL;
36 foreach ($data as $tab){
37 $this->by_name[$tab['CLASS']]= $tab['NAME'];
40 if ($baseobject === NULL){
41 if($tab['CLASS'] == "acl"){
42 $baseobject= new $tab['CLASS']($this->config, $this, $this->dn);
43 }else{
44 $baseobject= new $tab['CLASS']($this->config,$this->dn);
45 }
46 $this->by_object[$tab['CLASS']]= $baseobject;
47 } else {
48 if($tab['CLASS'] == "acl"){
49 $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config,$this,$this->dn, $baseobject);
50 }else{
51 $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $baseobject);
52 }
53 }
55 $this->by_object[$tab['CLASS']]->parent= &$this;
56 $this->by_object[$tab['CLASS']]->set_acl_category("acl");
57 $this->read_only |= $this->by_object[$tab['CLASS']]->read_only;
59 /* Initialize current */
60 if ($this->current == ""){
61 $this->current= $tab['CLASS'];
62 }
63 }
64 }
66 function save($ignore_account= FALSE)
67 {
68 $ret= tabs::save();
69 return $ret;
70 }
72 function save_object($ignore_account= FALSE)
73 {
74 tabs::save_object();
75 }
77 function execute()
78 {
79 $display= tabs::execute();
80 if($this->read_only){
81 $display.= "<div class='plugin-actions'>";
82 $display.= " <button type=submit name=\"edit_cancel\">".msgPool::cancelButton()."</button>\n";
83 $display.= "</div>";
84 }elseif(!$this->by_object['acl']->dialog){
85 $display.= "<p style=\"text-align:right\">\n";
86 $display.= " <button type=submit name=\"edit_finish\">".msgPool::okButton()."</button>\n";
87 $display.= " <button type=submit name=\"edit_cancel\">".msgPool::cancelButton()."</button>\n";
88 $display.= "</p>";
89 }
90 return($display);
91 }
92 }
93 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
94 ?>