X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_listing.inc;h=ab6d5944354bdf8f56ebf12bbe5a68886a6d80a5;hb=37a863af6c001e5760070adb1d74dc77e4df61f9;hp=f93313b53d6a0bbb2403cf310fbf8a25b1167888;hpb=3c8e015bdd37915f5bfef7005bd5ede0ddbd005c;p=gosa.git
diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc
index f93313b53..ab6d59443 100644
--- a/gosa-core/include/class_listing.inc
+++ b/gosa-core/include/class_listing.inc
@@ -52,6 +52,7 @@ class listing {
var $exportColumns= array();
var $useSpan= false;
var $height= 0;
+ var $scrollPosition= 0;
function listing($filename)
@@ -267,12 +268,13 @@ class listing {
// Some browsers don't have the ability do do scrollable table bodies, filter them
// here.
$switch= false;
- if (preg_match('/(Opera|Konqueror|Safari)/i', $_SERVER['HTTP_USER_AGENT'])){
+ if (preg_match('/(Opera|Konqueror|Safari|msie)/i', $_SERVER['HTTP_USER_AGENT'])){
$switch= true;
}
// Initialize list
$result= "\n";
+ $result.= "\n";
$height= 450;
if ($this->height != 0) {
$result.= "\n";
@@ -425,6 +427,12 @@ class listing {
$result.= "";
$result.= $switch?"":"";
+ // Add scroll positioner
+ $result.= '';
+
$smarty= get_smarty();
$smarty->assign("usePrototype", "true");
$smarty->assign("FILTER", $this->filter->render());
@@ -447,7 +455,15 @@ class listing {
// Assign summary
$smarty->assign("HEADLINE", $this->headline);
- return ($smarty->fetch(get_template_path($this->xmlData['definition']['template'], true)));
+ // Try to load template from plugin the folder first...
+ $file = get_template_path($this->xmlData['definition']['template'], true);
+
+ // ... if this fails, try to load the file from the theme folder.
+ if(!file_exists($file)){
+ $file = get_template_path($this->xmlData['definition']['template']);
+ }
+
+ return ($smarty->fetch($file));
}
@@ -465,6 +481,11 @@ class listing {
return;
}
+ // Save position if set
+ if (isset($_POST['position_'.$this->pid]) && is_numeric($_POST['position_'.$this->pid])) {
+ $this->scrollPosition= $_POST['position_'.$this->pid];
+ }
+
// Save base
if (isset($_POST['BASE']) && $this->baseMode) {
$base= get_post('BASE');
@@ -704,21 +725,31 @@ class listing {
// Row is replaced by the row number
if ($param == "row") {
$params[]= $row;
+ continue;
}
// pid is replaced by the current PID
if ($param == "pid") {
$params[]= $this->pid;
+ continue;
}
// base is replaced by the current base
if ($param == "base") {
$params[]= $this->getBase();
+ continue;
}
// Fixie with "" is passed directly
if (preg_match('/^".*"$/', $param)){
$params[]= preg_replace('/"/', '', $param);
+ continue;
+ }
+
+ // Move dn if needed
+ if ($param == "dn") {
+ $params[]= LDAP::fix($config["dn"]);
+ continue;
}
// LDAP variables get replaced by their objects
@@ -729,13 +760,9 @@ class listing {
unset($values['count']);
}
$params[]= $values;
+ break;
}
}
-
- // Move dn if needed
- if ($param == "dn") {
- $params[]= LDAP::fix($config["dn"]);
- }
}
// Replace information
@@ -848,11 +875,16 @@ class listing {
$result.= "
";
continue;
}
- } else {
+ } elseif (is_string($objectclass)) {
if(!in_array($objectclass, $classes)) {
$result.= "
";
continue;
}
+ } elseif (is_array($objectclass)) {
+ if(count(array_intersect($objectclass, $classes)) != count($objectclass)){
+ $result.= "
";
+ continue;
+ }
}
}
@@ -875,7 +907,9 @@ class listing {
}
if ($action['type'] == "copypaste") {
- $result.= $this->renderCopyPasteActions($row, $this->entries[$row]['dn'], $category, $class);
+ $copy = !isset($action['copy']) || $action['copy'] == "true";
+ $cut = !isset($action['cut']) || $action['cut'] == "true";
+ $result.= $this->renderCopyPasteActions($row, $this->entries[$row]['dn'], $category, $class,$copy,$cut);
} else {
$result.= $this->renderSnapshotActions($row, $this->entries[$row]['dn'], $category, $class);
}
@@ -990,6 +1024,11 @@ class listing {
return;
}
+ // Save position if set
+ if (isset($_POST['position_'.$this->pid]) && is_numeric($_POST['position_'.$this->pid])) {
+ $this->scrollPosition= $_POST['position_'.$this->pid];
+ }
+
$result= array("targets" => array(), "action" => "");
// Filter GET with "act" attributes
@@ -1138,7 +1177,9 @@ class listing {
// Check for special types
switch ($action['type']) {
case 'copypaste':
- $result.= $this->renderCopyPasteMenu($separator);
+ $cut = !isset($action['cut']) || $action['cut'] != "false";
+ $copy = !isset($action['copy']) || $action['copy'] != "false";
+ $result.= $this->renderCopyPasteMenu($separator, $copy , $cut);
break;
case 'snapshot':
@@ -1497,6 +1538,17 @@ class listing {
}
+ function getEntry($dn)
+ {
+ foreach ($this->entries as $entry) {
+ if (isset($entry['dn']) && strcasecmp($dn, $entry['dn']) == 0){
+ return $entry;
+ }
+ }
+ return null;
+ }
+
+
function getType($dn)
{
if (isset($this->objectDnMapping[$dn])) {