From a01f0ec2151f4213d5a17b138909dd79a23ae4d2 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 24 Nov 2005 10:04:27 -0500
Subject: [PATCH] added return to infos for lists

---
 interface/lib/classes/plugin_listview.inc.php |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/interface/lib/classes/plugin_listview.inc.php b/interface/lib/classes/plugin_listview.inc.php
index 94d7a51..8cde0b7 100644
--- a/interface/lib/classes/plugin_listview.inc.php
+++ b/interface/lib/classes/plugin_listview.inc.php
@@ -16,6 +16,8 @@
 		$app->uses('listform');
 		$app->listform->loadListDef($this->options["listdef"]);
 		
+		//$app->listform->SQLExtWhere = "type = 'alias'";
+		
 		$listTpl = new tpl;
 		$listTpl->newTemplate('templates/'.$app->listform->listDef["name"].'_list.htm');
 		
@@ -31,6 +33,10 @@
 			} else {
 				$sql_where = $app->tform->getAuthSQL('r')." and";
 			}
+		}
+		
+		if($this->options["sqlextwhere"] != '') {
+			$sql_where .= " ".$this->options["sqlextwhere"]." and";
 		}
 
 		$sql_where = $app->listform->getSearchSQL($sql_where);
@@ -67,6 +73,13 @@
 		$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_".$app->listform->listDef['name']."_list.lng";
 		include($lng_file);
 		$listTpl->setVar($wb);
+		
+		// Setting Returnto information in the session
+		$list_name = $app->listform->listDef["name"];
+		$_SESSION["s"]["list"][$list_name]["parent_id"] = $app->tform_actions->id;
+		$_SESSION["s"]["list"][$list_name]["parent_tab"] = $_SESSION["s"]["form"]["tab"];
+		$_SESSION["s"]["list"][$list_name]["parent_script"] = $app->tform->formDef["action"];
+		$_SESSION["s"]["form"]["return_to"] = $list_name;
 
 		return $listTpl->grab();
 		

--
Gitblit v1.9.1