Skip to content

Commit

Permalink
Fixed issue: javascript broken in import template if php-zip is disabled
Browse files Browse the repository at this point in the history
Dev: remove some button onclick, replace by link
  • Loading branch information
Shnoulle committed Jul 30, 2013
1 parent c10ef46 commit bd728f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
18 changes: 5 additions & 13 deletions application/views/admin/templates/importform_view.php
Expand Up @@ -10,19 +10,11 @@
</li>
<li>
<label>&nbsp;</label>
<input type='button' value='<?php $clang->eT("Import template ZIP archive") ?>'
<?php
if (!function_exists("zip_open"))
{?>
onclick='alert("<?php $clang->eT("zip library not supported by PHP, Import ZIP Disabled", "js") ?>");'
<?php
}
else
{?>
onclick='if (validatefilename(this.form,"<?php $clang->eT('Please select a file to import!', 'js') ?>")) { this.form.submit();}'
<?php
}?>
/>
<?php if (!function_exists("zip_open")) {?>
<?php $clang->eT("zip library not supported by PHP, Import ZIP Disabled", "js") ?>
<?php } else {?>
<input type='button' value='<?php $clang->eT("Import template ZIP archive") ?>' onclick='if (validatefilename(this.form,"<?php $clang->eT('Please select a file to import!', 'js') ?>")) { this.form.submit();}' />
<?php }?>
</li>
</ul>
</form>
8 changes: 6 additions & 2 deletions application/views/admin/templates/templateeditorbar_view.php
Expand Up @@ -65,9 +65,13 @@ function copyprompt(text, defvalue, copydirectory, action)
} ?>
<?php if(is_writable($tempdir) && is_writable($usertemplaterootdir))
{?>
<a href='#' onclick='javascript:window.open("<?php echo $this->createUrl('admin/templates/sa/upload'); ?>", "_top")'>
<?php if (function_exists("zip_open")) {?>
<a href='<?php echo $this->createUrl('admin/templates/sa/upload'); ?>'>
<img src='<?php echo $sImageURL; ?>import.png' alt='<?php $clang->eT("Import template"); ?>' title='' /></a>
<a href='#' onclick='javascript:window.open("<?php echo $this->createUrl('admin/templates/sa/templatezip/templatename/' . $templatename) ?>", "_top")'>
<?php }else{ ?>
<img src='<?php echo $sImageURL; ?>import_disabled.png' alt='<?php $clang->eT("zip library not supported by PHP, Import ZIP Disabled"); ?>' /></a>
<?php } ?>
<a href='<?php echo $this->createUrl('admin/templates/sa/templatezip/templatename/' . $templatename) ?>'>
<img src='<?php echo $sImageURL; ?>export.png' alt='<?php $clang->eT("Export Template"); ?>' /></a>
<img src='<?php echo $sImageURL; ?>separator.gif' class='separator' alt='' />
<a href='#' onclick="javascript: copyprompt('<?php $clang->eT("Please enter the name for the copied template:"); ?>', '<?php echo $clang->gT("copy_of_")."$templatename"; ?>', '<?php echo $templatename; ?>', 'copy')">
Expand Down

0 comments on commit bd728f2

Please sign in to comment.