X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_plugin.inc;h=f2d01c51bd79a09346dc5c0193146dad032ae7da;hb=6c6148c73fa05be5904cb13385ed133bc615fdca;hp=b957567d12a77cab1a76cacc81634f114a3fc025;hpb=ceaeec5d3e75b737ac6df7b2403c8a6a63c14c6a;p=gosa.git diff --git a/include/class_plugin.inc b/include/class_plugin.inc index b957567d1..f2d01c51b 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -118,6 +118,14 @@ class plugin /* This can be set to render the tabulators in another stylesheet */ var $pl_notify= FALSE; + + /* This variable indicates that this class can handle multiple dns at once. */ + var $multiple_support = FALSE; + + /* This aviable indicates, that we are currently in multiple edit handle */ + var $multiple_support_active = FALSE; + var $selected_edit_values = array(); + /*! \brief plugin constructor If 'dn' is set, the node loads the given 'dn' from LDAP @@ -272,6 +280,16 @@ class plugin /* Save data to object */ function save_object() { + if($this->multiple_support_active){ + foreach($this->attributes as $attr){ + if(isset($_POST["use_".$attr])){ + $this->selected_edit_values[$attr] = TRUE; + }else{ + $this->selected_edit_values[$attr] = FALSE; + } + } + } + /* Save values to object */ foreach ($this->attributes as $val){ if ($this->acl_is_writeable($val) && isset ($_POST["$val"])){ @@ -598,10 +616,7 @@ class plugin function postmodify($add_attrs= array()) { /* Find postcreate entries for this class */ - $command= $this->config->search(get_class($this), "POSTMODIFY",array('menu')); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= $this->config->search(get_class($this), "POSTMODIFY",array('tabs')); - } + $command= $this->config->search(get_class($this), "POSTMODIFY",array('menu','tabs')); if ($command != ""){ @@ -633,11 +648,7 @@ class plugin function postremove($add_attrs= array()) { /* Find postremove entries for this class */ - $command= $this->config->search(get_class($this), "POSTREMOVE",array('menu')); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= $this->config->search(get_class($this), "POSTREMOVE",array('tabs')); - } - + $command= $this->config->search(get_class($this), "POSTREMOVE",array('menu','tabs')); if ($command != ""){ /* Additional attributes */ @@ -1267,7 +1278,7 @@ class plugin $snapldapbase = $cfg['SNAPSHOT_BASE']; $ldap_to = new LDAP($user,$password, $server); $ldap_to->cd ($snapldapbase); - show_ldap_error($ldap->get_error(), sprintf(_("Method get deleted snapshots with dn '%s' failed."),$this->dn)); + show_ldap_error($ldap_to->get_error(), sprintf(_("Method get deleted snapshots with dn '%s' failed."),$this->dn)); }else{ $ldap_to = $ldap; } @@ -1372,7 +1383,8 @@ class plugin } /* Restore one of the already deleted objects */ - if(preg_match("/^RestoreDeletedSnapShot_/",$name) && $once){ + if(((isset($_POST['menu_action']) && $_POST['menu_action'] == "RestoreDeletedSnapShot") + || preg_match("/^RestoreDeletedSnapShot_/",$name)) && $once){ $once = false; $this->snapDialog = new SnapShotDialog($this->config,"",$this); $this->snapDialog->set_snapshot_bases($baseSuffixe); @@ -1394,7 +1406,7 @@ class plugin /* Create a new snapshot requested, check the given attributes and create the snapshot*/ - if(isset($_POST['CreateSnapshot'])){ + if(isset($_POST['CreateSnapshot']) && is_object($this->snapDialog)){ $this->snapDialog->save_object(); $msgs = $this->snapDialog->check(); if(count($msgs)){ @@ -1628,6 +1640,25 @@ class plugin } } } + + + function get_multi_edit_values() + { + $ret = array(); + foreach($this->selected_edit_values as $attr => $active){ + if($active){ + $ret[$attr] = $this->$attr; + } + } + return($ret); + } + + function set_multi_edit_value() + { + + } + } + // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>