index 31a1b3dc19fe5156945b12f672ca85dbff13fdd5..ab6d5944354bdf8f56ebf12bbe5a68886a6d80a5 100644 (file)
var $exportColumns= array();
var $useSpan= false;
var $height= 0;
+ var $scrollPosition= 0;
function listing($filename)
// Initialize list
$result= "<input type='hidden' value='$this->pid' name='PID'>\n";
+ $result.= "<input type='hidden' name='position_".$this->pid."' id='position_".$this->pid."'>\n";
$height= 450;
if ($this->height != 0) {
$result.= "<input type='hidden' value='$this->height' id='d_height'>\n";
$result.= "</table>";
$result.= $switch?"<input type='hidden' id='list_workaround'>":"";
+ // Add scroll positioner
+ $result.= '<script type="text/javascript" language="javascript">';
+ $result.= '$("t_nscrollbody").scrollTop= '.$this->scrollPosition.';';
+ $result.= 'var box = $("t_nscrollbody").onscroll= function() {$("position_'.$this->pid.'").value= this.scrollTop;}';
+ $result.= '</script>';
+
$smarty= get_smarty();
$smarty->assign("usePrototype", "true");
$smarty->assign("FILTER", $this->filter->render());
// 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));
}
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');
// 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
for ($i= 0; $i<$config['count']; $i++) {
- if ($config[$i] == 'dn') {
- continue;
- }
if ($param == $config[$i]) {
$values= $config[$config[$i]];
if (is_array($values)){
unset($values['count']);
}
$params[]= $values;
+ break;
}
}
-
- // Move dn if needed
- if ($param == "dn") {
- $params[]= LDAP::fix($config["dn"]);
- }
}
// Replace information
$result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
continue;
}
- } else {
+ } elseif (is_string($objectclass)) {
if(!in_array($objectclass, $classes)) {
$result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
continue;
}
+ } elseif (is_array($objectclass)) {
+ if(count(array_intersect($objectclass, $classes)) != count($objectclass)){
+ $result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
+ continue;
+ }
}
}
}
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);
}
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
// 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':
function getEntry($dn)
{
foreach ($this->entries as $entry) {
- if (isset($entry['dn']) && strcasecmp($dn, $entry['dn'])){
+ if (isset($entry['dn']) && strcasecmp($dn, $entry['dn']) == 0){
return $entry;
}
}