<?php
/**
 * Open Source - Content Managment System
 * Next Generation v2
 * @Coder:  Mutzii
 * @copyright  Copyright (c) 2012-2013 by Mutzii
 * File: CSSParser.modul.php
 */


class CSSParser extends Modul
{

   public function onEnable()
   {
      $instance = $this->getInstance();

      $instance->setContent('/templates/parser/',$instance->getTempError());
      $login_css = $instance->getContent();
	  
	  $instance->setContent('/templates/parser/',$instance->getTempError());
      $style_css = $instance->getContent();
	  
	  $tempdir  = $instance->getTempDir();
	  $temp     = str_replace(ROOT,"",$tempdir);
	  $temp     = str_replace('templates/',"",$temp);
	  $temp     = str_replace('/',"",$temp);
	  
	  
	   $Array = array(
			"{action}" => "?overlay=",
			"{css}"    =>  '../css/',
			"{images}" =>  '../images/',
			"{js}"     =>  '../js/',
			"{swf}"    =>  '../swf/',
			"{xml}"    =>  '../xml/'
	      ); 
	  
	  if($temp == 'default'){
	  
	        $login_css->ReadFile("login_css.html");		
			$login_css->replace($Array);			
			$login_css = $login_css->ContentToString(); 		 
			//$login = fopen(ROOT.'/'.$tempdir.'css/login.css',"r+");
			//fwrite($login,$login_css);		  
			//fclose($login);
	  
	   }
	   
	   if($temp == 'Admin')
	   {
	        $style_css->ReadFile("style_css.html");
			$style_css->replace($Array);
			$style_css = $style_css->ContentToString();
			//$style = fopen(ROOT.'/'.$tempdir.'css/style.css',"r+");
			//fwrite($style,$style_css);
			//fclose($style);	
	   }
	   
	   
		 
   }
   
   public function onDisable()
   {
   
   
   
   }

}





?>