<?php
//@*--


require_once('Mage/Core/Model/Url.php');

class Theme_Designer_Model_Url extends Mage_Core_Model_Url {

    public function getUrl($routePath = null, $routeParams = null) {
        $tpl = $this->getRequest()->getParam('template');
        $preview = $this->getRequest()->getParam('preview');
        if ($tpl) {
            $routeParams['_query']['template'] = $tpl;
        }
        if ($preview) {
            $routeParams['_query']['preview'] = $preview;
        }
        return parent::getUrl($routePath, $routeParams);
    }

}

//--*@