Post by aboel3zz » Fri Nov 14, 2008 12:01 am

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
Last edited by aboel3zz on Fri Nov 14, 2008 12:05 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Nov 13, 2008 6:26 pm

Post by Qphoria » Fri Nov 14, 2008 12:06 am

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

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by aboel3zz » Fri Nov 14, 2008 12:19 am

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;
    }

Newbie

Posts

Joined
Thu Nov 13, 2008 6:26 pm
Who is online

Users browsing this forum: No registered users and 9 guests