From 836f8329426122adbfc30d67144f7709d7eea961 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 05 Mar 2010 09:18:23 -0500
Subject: [PATCH] Fixed tpl generation classes and added missing language file createion code again.

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

diff --git a/interface/lib/classes/listform_tpl_generator.inc.php b/interface/lib/classes/listform_tpl_generator.inc.php
index 1d14775..7d5f72d 100644
--- a/interface/lib/classes/listform_tpl_generator.inc.php
+++ b/interface/lib/classes/listform_tpl_generator.inc.php
@@ -132,7 +132,48 @@
 		}
 		fclose($handle);
 		
+		/*$lang["page_txt"] = 'Page';
+		$lang["page_of_txt"] = 'of';
+		$lang["page_next_txt"] = 'Next';
+		$lang["page_back_txt"] = 'Back';
+		$lang["delete_txt"] = 'Delete';
+		$lang["filter_txt"] = 'Filter';
+		$lang["add_new_record_txt"] = 'Add new record';
+		*/
+		
+		// save language file
+		$this->lng_add($lang,$listDef,$module);
     }
+	
+	function lng_add($lang,$listDef,$module = '') {
+		global $go_api, $go_info,$conf;
+		
+		if($module == '') {
+			$lng_file = "lib/lang/".$conf["language"]."_".$listDef['name']."_list.lng";
+		} else {
+			$lng_file = '../'.$module."/lib/lang/en_".$listDef['name']."_list.lng";
+		}
+		
+		if(is_file($lng_file)) {
+			include_once($lng_file);
+		} else {
+			$wb = array();
+		}
+		
+		$wb_out = array_merge($lang,$wb);
+		
+		if(is_array($wb_out)) {
+			$fp = fopen ($lng_file, "w");
+			fwrite($fp,"<?php\r\n");
+			foreach($wb_out as $key => $val) {
+				$new_line = '$wb["'.$key.'"] = '."'$val';\r\n";
+				fwrite($fp,$new_line);
+				
+			}
+			fwrite($fp,"?>");
+			fclose($fp);
+		}
+	}
 
 }
 

--
Gitblit v1.9.1