Page 1 of 1

1.0 beta version CSS fixed

Posted: Fri Nov 14, 2008 12:01 am
by aboel3zz
Hello

I starting working on version 1.0 beta for now I fix the style sheet problem to load dynamically depend on TPL file name ,
I don't know what is the best way to send u the changes

Re: Version 1.0 beta some fixed

Posted: Fri Nov 14, 2008 12:06 am
by Qphoria
Best would be to post them on the forums. But 1.0 is really very young... should probably be titled Alpha at this point. So until something a bit more ready gets released, it is likely that many things are still changing and fixes today might be changed tomorrow.

But as long as you understand that, then I would say feel free to offer your fixes in a zip file on the forums or just post the text.

I am going to move this thread to the 1.x development forum

Re: 1.0 beta version CSS fixed

Posted: Fri Nov 14, 2008 12:19 am
by aboel3zz
ok,

in the library/system/controller.php this is the changes

Code: Select all

   protected function fetch ($filename)
    {
        $file = DIR_VIEW . 'template/' . $filename;
        if (file_exists($file)) {
            extract($this->data);
            ob_start();
            require ($file);
            $content = ob_get_contents();
            ob_end_clean();
            $content = $this->appendCSS($filename) . $content;
            return $content;
        } else {
            exit('Error: Could not load template ' . $file . '!');
        }
    }
    /**
     * Handle dynamic CSS files 
     * @author : Muhammed Abu El Ezz <aboel3zz at maktoob dot com>
     * @param string $filename
     * @return string
     */
    protected function appendCSS ($filename)
    {
        $cssName = str_replace(array(
        '/' , 
        '.tpl'), array(
        '_' , 
        ''), $filename) . '.css';
        $file = DIR_VIEW . 'stylesheet/' . $cssName;
        $cssTag = '';
        if (file_exists($file)) {
            $cssTag = "<link rel=\"stylesheet\" type=\"text/css\" href=\"catalog/view/stylesheet/$cssName\">";
        }
        return $cssTag;
    }