<?php  $webSiteUrl = $this->config->website->website->url; ?>
<?php if(isset($this->templates) && is_array($this->templates)): ?>
<div id="seotoaster" class="admintemplatelist">
<div id="admineditwhat">{%Templates list%}</div>
<div class="close_window" onclick="parent.tb_remove();"></div>
<div id="admintemplatecontent">
<div onclick="parent.tb_remove();" id="close_template_window"/>
<?php foreach($this->templates as $template): ?>
<div class="one_template" align="center">
<?php $src = $webSiteUrl . 'system/images/no_preview.png';
if (!empty($template['preview_path']) && !empty($template['theme_name'])):
    if(file_exists(unserialize(Zend_Registry::get('config'))->website->website->path . 'public/themes/' . $template['theme_name'] . '/images/templatepreview/' . $template['preview_path'])):
        $src = $webSiteUrl . 'themes/' . $template['theme_name'] . '/images/templatepreview/' . $template['preview_path'];
    endif;
else:
    $src = $webSiteUrl . 'system/images/no_preview.png';
endif; ?>
<a href="<?php echo $webSiteUrl; ?>sys/backend_template/edit/id/<?php echo $template['id']?>/"><img src="<?php echo $src; ?>"/></a>
<p class="text">
<?php  echo $template['name'];
    if(isset($template['name']) && strtolower($template['name'])!='index' && strtolower($template['name'])!='category' && strtolower($template['name'])!='default' && strtolower($template['name'])!='news' && $template['name']!=$this->currentTemplateName): ?>
        <a style="vertical-align:middle;"  href="javascript:;" onclick=" if(confirm('Do you really want to delete this template?')){deleteTemplate(<?php echo $template['id'];?>); } " title="Delete this template"><img src="<?php echo $webSiteUrl;?>system/images/ico_delete.gif" alt="Delete this template" /></a>
    <?php endif; ?>
</p>
<p style="clear:both;"></p>
</div>
<?php endforeach; ?>
</div>

</div>
<?php endif;?>
<input type="hidden" id="hid-main-wsurl" name="hid-main-wsurl" value="<?php echo $this->websiteUrl; ?>" />
