From 1e45da277b6e28ff65967d38c12b298872efb059 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 01 Aug 2008 17:37:59 -0400
Subject: [PATCH] Added translation functions for the tabs of forms.

---
 interface/lib/classes/ini_parser.inc.php |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/interface/lib/classes/ini_parser.inc.php b/interface/lib/classes/ini_parser.inc.php
index b302bd0..67e6542 100644
--- a/interface/lib/classes/ini_parser.inc.php
+++ b/interface/lib/classes/ini_parser.inc.php
@@ -39,7 +39,8 @@
 class ini_parser{
 
 	private $config;
-
+	
+	//* Converts a ini string to array
 	public function parse_ini_string($ini) {
 		$ini = str_replace("\r\n", "\n", $ini);
 		$lines = explode("\n", $ini);
@@ -56,22 +57,27 @@
 		}
 		return $this->config;
 	}
-
-
-
-	public function get_ini_string($file) {
+	
+	
+	//* Converts a config array to a string
+	public function get_ini_string($config_array = '') {
+		if($config_array == '') $config_array = $this->config;
 		$content = '';
-		foreach($this->config as $section => $data) {
+		foreach($config_array as $section => $data) {
 			$content .= "[$section]\n";
 			foreach($data as $item => $value) {
-				if($value != ''){
+				if($item != ''){
                     $content .= "$item=$value\n";
                 }
 			}
+			$content .= "\n";
 		}
 		return $content;
 	}
-
+	
+	
+	
+	
 }
 
 ?>
\ No newline at end of file

--
Gitblit v1.9.1