index 681d8381b17bf8002a3240eccdc1768ddaa17573..c03e860e55c7dd92337ca4897299733ab65ffc06 100644 (file)
$this->registerAction("saveSnapshot","saveSnapshot");
$this->registerAction("restoreSnapshot","restoreSnapshot");
$this->registerAction("cancelSnapshot","closeDialogs");
+
+ $this->registerAction("config-filter","editFilter");
+ $this->registerAction("saveFilter","saveFilter");
+
+ // To temporay disable the filter caching UNcomment this line.
+ #session::global_un_set(get_class($this)."_filter");
}
/*! \brief Execute this plugin
$vars = array('/^act$/','/^listing/','/^PID$/','/^FILTER_PID$/');
session::set('LOCK_VARS_TO_USE',$vars);
+ pathNavigator::registerPlugin($this);
+
/* Display the copy & paste dialog, if it is currently open */
$ret = $this->copyPasteHandler("",array());
if($ret){
$this->snapHandler->setSnapshotBases($bases);
}
- // Add a dummy filter editing button.
- if(userFilter::userFilteringAvailable()){
- $dummy = "<button type='submit' name='editFilter'>!!</button>";
- $this->registerAction("editFilter", "editFilter");
-
- print_a(userFilter::getFilter());
- }
-
// Display list
- return($dummy.$this->renderList());
+ return($this->renderList());
}
function editFilter()
{
- $headpage = $this->getHeadpage();
- $this->dialogObject = new userFilter($this->config,$headpage->categories);
+ $this->dialogObject = new userFilter($this->config,$this->getHeadpage());
}
function renderList()
// In case an of locked entry, we may have opened a read-only tab.
$str = "";
if(isset($this->tabObject->read_only) && $this->tabObject->read_only == TRUE){
- $str.= "<p style=\"text-align:right\">
- <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">
+ $str.= "
+ <p style=\"text-align:right\">
+ <button type=submit name=\"edit_cancel\">".msgPool::cancelButton()."</button>
</p>";
return($str);
}else{
// Display ok, (apply) and cancel buttons
$str.= "<p style=\"text-align:right\">\n";
- $str.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
+ $str.= "<button type=\"submit\" name=\"edit_finish\" style=\"width:80px\">".msgPool::okButton()."</button>\n";
$str.= " \n";
if($this->displayApplyBtn){
- $str.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
+ $str.= "<button type=\"submit\" name=\"edit_apply\">".msgPool::applyButton()."</button>\n";
$str.= " \n";
}
- $str.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
+ $str.= "<button type=\"submit\" name=\"edit_cancel\">".msgPool::cancelButton()."</button>\n";
$str.= "</p>";
}
return($str);
*/
protected function removeEntryRequested($action="",$target=array(),$all=array())
{
+ // Close dialogs and remove locks for currently handled dns
+ $this->cancelEdit();
+
$disallowed = array();
$this->dns = array();
// Add locks
$dns_names = array();
+ $types = array();
+ $h = $this->getHeadpage();
+
+ // Build list of object -labels
+ foreach($h->objectTypes as $type){
+ $map[$type['objectClass']]= $type['label'];
+ }
+
foreach($this->dns as $dn){
- $dns_names[] =LDAP::fix($dn);
+ $tmp = $h->getType($dn);
+ if(isset($map[$tmp])){
+ $dns_names[LDAP::fix($dn)] = _($map[$tmp]);
+ }else{
+ $dns_names[] =LDAP::fix($dn);
+ }
}
add_lock ($this->dns, $this->ui->dn);
// Display confirmation dialog.
$smarty = get_smarty();
- $smarty->assign("info", msgPool::deleteInfo($dns_names,_($this->objectName)));
+ $smarty->assign("info", msgPool::deleteInfo($dns_names));
$smarty->assign("multiple", true);
- return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+ return($smarty->fetch(get_template_path('removeEntries.tpl')));
}
}
* @param Array 'all' A combination of both 'action' and 'target'.
*/
function removeEntryConfirmed($action="",$target=array(),$all=array(),
- $altTabClass="",$altTabType="",$altAclCategory="")
+ $altTabClass="",$altTabType="", $altAclCategory="",$altAclPlugin="")
{
$tabType = $this->tabType;
$tabClass = $this->tabClass;
$aclCategory = $this->aclCategory;
+ $aclPlugin = $this->aclPlugin;
if(!empty($altTabClass)) $tabClass = $altTabClass;
if(!empty($altTabType)) $tabType = $altTabType;
if(!empty($altAclCategory)) $aclCategory = $altAclCategory;
+ if(!empty($altAclPlugin)) $aclPlugin = $altAclPlugin;
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel confirmed!");
foreach($this->dns as $key => $dn){
// Check permissions, are we allowed to remove this object?
- $acl = $this->ui->get_permissions($dn, $this->aclCategory."/".$this->aclPlugin);
+ $acl = $this->ui->get_permissions($dn, $aclCategory."/".$aclPlugin);
if(preg_match("/d/",$acl)){
// Delete the object
$this->dn = $dn;
- $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory, true, true);
+ $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->parent = &$this;
$this->tabObject->delete ();
if(isset($_POST['edit_cancel'])) $action['action'] = "cancel";
if(isset($_POST['delete_confirmed'])) $action['action'] = "removeConfirmed";
if(isset($_POST['delete_cancel'])) $action['action'] = "cancelDelete";
- if(isset($_POST['editFilter'])) $action['action'] = "editFilter";
- if(isset($_POST['saveFilter'])) $action['action'] = "save";
+ if(isset($_POST['saveFilter'])) $action['action'] = "saveFilter";
if(isset($_POST['cancelFilter'])) $action['action'] = "cancel";
// Detect Snapshot actions
}
+ /*! \brief Save filter modifcations.
+ */
+ protected function saveFilter()
+ {
+ if($this->dialogObject instanceOf userFilter){
+ $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();
+
+ // Ask filter to reload information
+ $this->filter->reloadFilters();
+ }
+ }
+ }
+
+
/*! \brief Save object modifications and closes dialogs (returns to object listing).
* - Calls '::check' to validate the given input.
* - Calls '::save' to save back object modifications (e.g. to ldap).