index 6a4675e50651be9edbe13e081c4f40d0815524d3..6f8babb4222eac399cefc5fb5f850025d6dac5e3 100644 (file)
* This code is part of GOsa (http://www.gosa-project.org)
* Copyright (C) 2003-2008 GONICUS GmbH
*
- * ID: $$Id: class_plugin.inc 14584 2009-10-12 14:04:22Z hickert $$
+ * ID: $$Id$$
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
protected $snapHandler = null;
// The listing handlers
- protected $headpage = null;
- protected $filter = null;
+ private $headpage = null;
+ private $filter = null;
// A list of configured actions/events
protected $actions = array();
foreach($this->storagePoints as $sp){
$bases[] = $sp.$this->headpage->getBase();
}
+
+ // No bases specified? Try base
+ if(!count($bases)) $bases[] = $this->headpage->getBase();
+
$this->snapHandler->setSnapshotBases($bases);
}
-
+
+ // Display list
+ return($this->renderList());
+ }
+
+ function renderList()
+ {
$this->headpage->update();
$display = $this->headpage->render();
return($this->getHeader().$display);
}
+ function getHeadpage()
+ {
+ return($this->headpage);
+ }
+ function getFilter()
+ {
+ return($this->filter);
+ }
/*! \brief Generates the plugin header which is displayed whenever a tab object is
* opened.
// Delete the object
$this->dn = $dn;
- $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory);
+ $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory, true, true);
$this->tabObject->set_acl_base($this->dn);
$this->tabObject->delete ();
$this->tabObject->parent = &$this;
*/
function detectPostActions()
{
+ if(!is_object($this->headpage)){
+ trigger_error("No valid headpage given....!");
+ return(array());
+ }
$action= $this->headpage->getAction();
if(isset($_POST['edit_apply'])) $action['action'] = "apply";
if(isset($_POST['edit_finish'])) $action['action'] = "save";
}
}
+ // No bases specified? Try base
+ if(!count($bases)) $bases[] = $this->headpage->getBase();
+
// No target, open the restore removed object dialog.
if(!count($target)){
$entry = $this->headpage->getBase();
* }
* }
* }
- **/
+ **/
+
+ // Do not create a new tabObject while there is already one opened,
+ // the user may have just pressed F5 to reload the page.
+ if(is_object($this->tabObject)){
+ return;
+ }
+
$tabType = $this->tabType;
$tabClass = $this->tabClass;
$aclCategory = $this->aclCategory;
$this->remove_lock();
$this->closeDialogs();
}
+ }elseif($this->dialogObject instanceOf plugin){
+ $this->dialogObject->save_object();
+ $msgs = $this->dialogObject->check();
+ if(count($msgs)){
+ msg_dialog::displayChecks($msgs);
+ return("");
+ }else{
+ $this->dialogObject->save();
+ @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dns,"Entry saved!");
+ $this->remove_lock();
+ $this->closeDialogs();
+ }
}
}
$this->cpHandler->cleanup_queue();
foreach($target as $dn){
if($action == "copy" && $this->ui->is_copyable($dn,$aclCategory,$aclPlugin)){
- $this->cpHandler->add_to_queue($dn,"copy",$tabClass,$tabType,$aclCategory);
+ $this->cpHandler->add_to_queue($dn,"copy",$tabClass,$tabType,$aclCategory,$this);
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$dn,"Entry copied!");
}
if($action == "cut" && $this->ui->is_cutable($dn,$aclCategory,$aclPlugin)){
- $this->cpHandler->add_to_queue($dn,"cut",$tabClass,$tabType,$aclCategory);
+ $this->cpHandler->add_to_queue($dn,"cut",$tabClass,$tabType,$aclCategory,$this);
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$dn,"Entry cutted!");
}
}