Index: trunk/src/inc/FileHandler.class.php
===================================================================
--- trunk/src/inc/FileHandler.class.php	(revision 7780)
+++ trunk/src/inc/FileHandler.class.php	(revision 7781)
@@ -9,8 +9,8 @@
 	private $filename;
 	private $handle;
-	
+
 	/*
 	 * Function: __construct (constructor)
-	 * Description: Handling with a node file 
+	 * Description: Handling with a node file
 	 * Parameters: string $filename, string $mode
 	 * Returns: true is we've succesfully opened the file, otherwise false
@@ -50,50 +50,21 @@
 	}
 
-	
-	
-
-	
-	
-	
 	/*
 	 * Function: write
-	 * Description: Try to write to the file we've opened in the constructor 
+	 * Description: Try to write to the file we've opened in the constructor
 	 * Parameters: string $data
 	 * Returns: true if we can write to the file, otherwise false
 	 */
 	public function write($data) {
-		
-		$filename = date( "m_d_y.kml" );
-		
-			
-			try{
-				trigger_log(SYSLOG_DEBUG, 'Opening the file "' . $filename . '"', __FILE__, __LINE__);
-				$file = new FileHandler($filename, 'w');
-			} catch (Exception $err) {
-				trigger_log(SYSLOG_ERR, 'Opening the file "' . $filename . '"', __FILE__, __LINE__);
-				return false;
-			}
-	
-			try{
-			trigger_log(SYSLOG_DEBUG, 'Writing file "' . $filename . '"', __FILE__, __LINE__);
+		trigger_log(SYSLOG_DEBUG, 'Writing file "' . $this->filename . '"', __FILE__, __LINE__);
+
+		try {
 			$file->write($file,$this->$data);
-			} catch (Exception $err) {
-				trigger_log(SYSLOG_ERR, 'Writing the file "' . $filename . '"', __FILE__, __LINE__);
-				return false;
-			}
-	
-			
-			try{
-			trigger_log(SYSLOG_DEBUG, 'Closing file "' . $filename . '"', __FILE__, __LINE__);
-			fclose($file);
-			} catch (Exception $err) {
-				trigger_log(SYSLOG_ERR, 'Closing the file "' . $filename . '"', __FILE__, __LINE__);
-				return false;
-			}
-			
-			return true;
-			
+		} catch (Exception $err) {
+			trigger_log(SYSLOG_ERR, 'Couldn\'t write to file "' . $this->filename . '"', __FILE__, __LINE__);
+			return false;
+		}
 
-		
+		return true;
 	}
 
