<?php
//@*--

    $_adminHelper = Mage::helper('adminhtml');
    $_project = Theme_Designer_Model_Export_Project::open($this->getTheme());
?>
<!DOCTYPE html>
<html>
<head>
    <title>Designer</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <script type="text/javascript">
        window.themeDesigner = {
            settings: {
                cmsVersion: '<?php echo json_encode(array('magento' => Mage::getVersion())) ?>'
            },
            url: {
                admin: '<?php echo $_adminHelper->getUrl('designer/adminhtml_list/index') ?>',
                preview: '<?php echo $this->getPreviewUrl('cms/index/index') ?>',
                download: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/download') ?>',
                designer: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/index', array('forceLogout' => 1)) ?>'
            },
            ajaxUrl: {
                clear: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/clear', array('ajax' => 1)) ?>',
                rename: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/rename', array('ajax' => 1)) ?>',
                publish: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/publish', array('ajax' => 1)) ?>',
                session: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/session', array('ajax' => 1)) ?>',
                download: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/download', array('ajax' => 1)) ?>',
                cmsExport: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/export', array('ajax' => 1)) ?>',
                updatePreview: '<?php echo $this->getDesignerUrl('designer/adminhtml_theme/updatePreview', array('ajax' => 1)) ?>',
                key: '<?php echo Mage::getSingleton('core/session')->getFormKey() ?>'
            },
            templates: {
                'home': '<?php echo $this->getPreviewUrl('cms/index/index') ?>',
                'default': '<?php echo $this->getPreviewUrl('catalog/seo_sitemap/category') ?>',
                'pageTemplate': '<?php echo $this->getPreviewUrl('cms/page/view', array('page_id' => 3)) ?>',
                'products': '<?php echo $this->getPreviewUrl() ?>',
                'productOverview': '<?php echo $this->getPreviewUrl('catalog/product/view', array("id" => "44")) ?>',
                'shoppingCartTemplate': '<?php echo $this->getPreviewUrl('checkout/cart/index') ?>',
                'template404' : '<?php echo $this->getPreviewUrl('no/route/path') ?>'
            },
            theme: {
                projectData: <?php echo $_project->serializeData() ?>,
                version: '<?php echo '1.0.0.0' ?>',
                cache: <?php echo Mage::helper('designer/export')->getCache($this->getTheme()) ?>,
                hashes: <?php echo Mage::helper('designer/export')->getHashes($this->getTheme()) ?>,
                active: <?php echo Mage::helper('designer')->isActive($this->getTheme()) ? 'true' : 'false' ?>,
                name: '<?php echo $this->getTheme() ?>'
            }
        };
    </script>
    <?php $_version = time(); ?>
	<script type="text/javascript" src="<?php echo $this->getSkinUrl('designer/js/DataProvider.js') ?>?version=<?php echo $_version ?>"></script>
    <script type="text/javascript" src="<?php echo $_project->getDomain() . (substr($_project->getDomain(), -1) !== '/' ? '/' : '') ?>loader/start.js?version=<?php echo $_version ?>"></script>
</head>
<body>
	<div id="theme_editor"></div>
</body>
</html>

<?php //--*@