summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorNick Palmer <nick@sluggardy.net>2007-04-16 14:03:15 +0000
committerNick Palmer <nick@sluggardy.net>2007-04-16 14:03:15 +0000
commit58c2d0a1c6ef96864cdc224a4be7b3e566d84cf2 (patch)
tree95ef8cc51b5dc6153db012658c869a7b0b2ac13f /templates
parent838c97945792884f228975c0955c3b78a2eb4345 (diff)
downloadliberty-58c2d0a1c6ef96864cdc224a4be7b3e566d84cf2.tar.gz
liberty-58c2d0a1c6ef96864cdc224a4be7b3e566d84cf2.tar.bz2
liberty-58c2d0a1c6ef96864cdc224a4be7b3e566d84cf2.zip
AJAX attachment uploader. This stuff ROCKS!
Diffstat (limited to 'templates')
-rw-r--r--templates/admin_liberty.tpl14
-rw-r--r--templates/attachment_uploader.tpl23
-rw-r--r--templates/attachment_uploader_inc.tpl24
-rw-r--r--templates/edit_storage.tpl2
-rw-r--r--templates/edit_storage_list.tpl6
5 files changed, 66 insertions, 3 deletions
diff --git a/templates/admin_liberty.tpl b/templates/admin_liberty.tpl
index 8ce5785..cf054d8 100644
--- a/templates/admin_liberty.tpl
+++ b/templates/admin_liberty.tpl
@@ -11,6 +11,20 @@
</div>
{/foreach}
+ {foreach from=$formLibertyAttachmentStyle key=item item=output}
+ <div class="row">
+ {formlabel label=`$output.label` for=$item}
+ {forminput}
+ Current: {$gBitSystem->getConfig('liberty_attachment_style', 'standard')}
+ Item: {$item}
+ <input type="radio" name="liberty_attachment_style" value="{$item}" {if $gBitSystem->getConfig('liberty_attachment_style', 'standard') == $item}CHECKED{/if} />
+ {formhelp note=`$output.note` page=`$output.page`}
+ {/forminput}
+ </div>
+ {/foreach}
+
+
+
<div class="row">
{formlabel label="Auto-Display Attachment Thumbnails" for="liberty_auto_display_attachment_thumbs"}
{forminput}
diff --git a/templates/attachment_uploader.tpl b/templates/attachment_uploader.tpl
new file mode 100644
index 0000000..f0fb07e
--- /dev/null
+++ b/templates/attachment_uploader.tpl
@@ -0,0 +1,23 @@
+{strip}
+<html>
+<head>
+{include file="bitpackage:kernel/header_inc.tpl"}
+</head>
+<body>
+{if !empty($errors)}
+ <script type="text/javascript">
+ function display_upload_errors() {ldelim}
+ alert("Error with upload: {$errors}");
+ {rdelim}
+ addLoadHook(display_upload_errors);
+ </script>
+{/if}
+{include file="bitpackage:liberty/edit_storage_list.tpl"}
+{if empty($gContent->mContentId)}
+ {foreach from=$gContent->mStorage item=storage key=attachmentId}
+ <input type="hidden" name="existing_attachment_id[]" value="{$attachmentId}" />
+ {/foreach}
+{/if}
+</body>
+</html>
+{/strip}
diff --git a/templates/attachment_uploader_inc.tpl b/templates/attachment_uploader_inc.tpl
new file mode 100644
index 0000000..81befd8
--- /dev/null
+++ b/templates/attachment_uploader_inc.tpl
@@ -0,0 +1,24 @@
+{strip}
+<noscript>
+ {* the tr blocks are intentionally split so the second part only has to be translated once since it is duplicated in the iFrame. *}
+ <div class="warning">
+ {tr}JavaScript is required for AJAX uploads.{/tr}&nbsp;
+ {tr}You must save the content to upload an attachment.{/tr}
+ </div>
+</noscript>
+
+{* Ensure content_id is sent with the form if possible. *}
+<input type="hidden" name="content_id" value="{$gContent->mContentId}" />
+
+{* Give an input to stick the old action in*}
+<input type="hidden" name="liberty_upload_action" value="" id="liberty_upload_action" />
+
+{* Note! iFrame MUST not be display: none or Safari pops a window instead. *}
+{* I am not dynamically creating the iFrame to give a warning for browsers with no iframe support. *}
+<iframe src="about:blank" id="liberty_upload_frame" name="liberty_upload_frame" onload="javascript:liberty_uploader_complete('liberty_upload_frame', 'edit_storage_list_div', 'upload');" style="position: absolute; left: -10000px;">
+ <div class="warning">
+ {tr}iFrame support is required for AJAX uploads.{/tr}&nbsp;
+ {tr}You must save the content to upload an attachment.{/tr}
+ </div>
+</iframe>
+{/strip}
diff --git a/templates/edit_storage.tpl b/templates/edit_storage.tpl
index cc63ad8..c4e25d5 100644
--- a/templates/edit_storage.tpl
+++ b/templates/edit_storage.tpl
@@ -14,7 +14,9 @@
{/if}
{/foreach}
+<div id="edit_storage_list_div">
{include file="bitpackage:liberty/edit_storage_list.tpl"}
+</div>
<h2 class="clear"><a href="javascript:ajax_updater( 'attbrowser', '{$smarty.const.LIBERTY_PKG_URL}ajax_attachment_browser.php', 'ajax=true' );">{tr}Attachment Browser{/tr}</a></h2>
<noscript><div class="warning">{tr}The attachment browser only works with javascript enabled.{/tr}</div></noscript>
diff --git a/templates/edit_storage_list.tpl b/templates/edit_storage_list.tpl
index 6713c01..1055a13 100644
--- a/templates/edit_storage_list.tpl
+++ b/templates/edit_storage_list.tpl
@@ -3,7 +3,7 @@
{if $gContent->mStorage}
<div class="row">
<table class="data" summary="List of attached files">
- <caption>{tr}Items Attached Directly to this Content{/tr}</caption>
+ <caption>{tr}Items {if $libertyUploader && empty($gContent->mContentId)}That Will Be{/if} Attached Directly to this Content{/tr}</caption>
<tr>
<th scope="col" title="{tr}Thumbnail{/tr}">{tr}Thumbnail{/tr}</th>
<th scope="col" title="{tr}File Properties{/tr}">{tr}File Properties{/tr}</th>
@@ -20,9 +20,9 @@
Actions:
{if $gBitUser->isAdmin() || $gBitUser->hasPermission( 'p_liberty_detach_attachment' ) || $storage.user_id == $gBitUser->mUserId}
{if isset($gContent) }
- <a href="{$attachmentActionBaseURL}&amp;content_id={$gContent->mContentId}&amp;detachAttachment={$attachmentId}">{biticon ipackage=liberty iname="detach" iexplain="detach"}</a>
+ <a href="{$attachmentActionBaseURL}&amp;content_id={$gContent->mContentId}&amp;detachAttachment={$attachmentId}">{biticon ipackage=icons iname="edit-cut" iexplain="detach"}</a>
{else}
- <a href="{$attachmentActionBaseURL}&amp;detachAttachment={$attachmentId}">{biticon ipackage=liberty iname="detach" iexplain="detach"}</a>
+ <a href="{$attachmentActionBaseURL}&amp;detachAttachment={$attachmentId}">{biticon ipackage=icons iname="edit-cut" iexplain="detach"}</a>
{/if}
{/if}
{if $gBitUser->isAdmin() || $storage.user_id == $gBitUser->mUserId}