summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2008-07-03 07:43:23 +0000
committerMax Kremmel <xing@synapse.plus.com>2008-07-03 07:43:23 +0000
commit17172d49b8744c96510521d873dc0f135756e92c (patch)
tree4f7bec427e2a5fcdbf91bf712945c3966e14fe37 /templates
parent9a40c7f97e93bf184eed76498bdac29bb1835864 (diff)
downloadliberty-17172d49b8744c96510521d873dc0f135756e92c.tar.gz
liberty-17172d49b8744c96510521d873dc0f135756e92c.tar.bz2
liberty-17172d49b8744c96510521d873dc0f135756e92c.zip
a lot of fixes and updates. rename $area to $display_type and reduce these to storage_thumbs instead of 3 different ones. use media_url instead of audio_url and video_url. get {attachment} display options working with audio and flv plugins.
Diffstat (limited to 'templates')
-rw-r--r--templates/edit_storage_list.tpl3
-rw-r--r--templates/mime_audio_inline_inc.tpl28
-rw-r--r--templates/mime_audio_player_inc.tpl21
-rw-r--r--templates/mime_audio_view_inc.tpl2
-rw-r--r--templates/mime_default_inline_inc.tpl2
-rw-r--r--templates/mime_flv_inline_inc.tpl27
-rw-r--r--templates/mime_flv_player_inc.tpl38
-rw-r--r--templates/mime_flv_view_inc.tpl29
-rw-r--r--templates/storage_thumbs.tpl2
9 files changed, 83 insertions, 69 deletions
diff --git a/templates/edit_storage_list.tpl b/templates/edit_storage_list.tpl
index d65b85c..55240a6 100644
--- a/templates/edit_storage_list.tpl
+++ b/templates/edit_storage_list.tpl
@@ -22,7 +22,6 @@
<input type="radio" name="liberty_attachments[primary]" value="none" {if empty($gContent->mInfo[primary])}checked="checked"{/if} />
</label>
</td>
- {assign var=area value=upload_tab}
{/if}
</tr>
@@ -30,7 +29,7 @@
<tr class="{cycle values="odd,even"}">
<td style="text-align:center;">
{if $storage.is_mime}
- {include file=$gLibertySystem->getMimeTemplate('inline',$storage.attachment_plugin_guid) area=$area thumbsize=small preferences=$gContent->mStoragePrefs.$attachmentId attachment=$storage}
+ {include file=$gLibertySystem->getMimeTemplate('inline',$storage.attachment_plugin_guid) display_type=storage_thumbs thumbsize=small preferences=$gContent->mStoragePrefs.$attachmentId attachment=$storage}
{else}
{jspopup href=$storage.source_url title=$storage.title|default:$storage.filename notra=1 img=$storage.thumbnail_url.avatar}
<br />{$storage.filename} <span class="date">{$storage.file_size|display_bytes}</span>
diff --git a/templates/mime_audio_inline_inc.tpl b/templates/mime_audio_inline_inc.tpl
index dbd003e..078eaa9 100644
--- a/templates/mime_audio_inline_inc.tpl
+++ b/templates/mime_audio_inline_inc.tpl
@@ -1,7 +1,29 @@
{strip}
-{if $attachment.audio_url}
- <div class="row" style="text-align:center;">
- {include file="bitpackage:liberty/mime_audio_player_inc.tpl"}
+{if $display_type == "storage_thumbs"}
+ <div class="item">
+ {if $attachment.media_url}
+ {include file="bitpackage:liberty/mime_audio_player_inc.tpl"}
+ {/if}
+
+ {if $display_type eq "storage_thumbs"}
+ {if $attachment.meta.title}{$attachment.meta.title}<br />{/if}
+ <a href="{$attachment.display_url}">{tr}Full Details{/tr}</a>
+ {/if}
</div>
+{else}
+ {if $wrapper.output == 'desc' || $wrapper.output == 'description'}
+ {if $attachment.display_url}<a {$wrapper.href_class} href="{$wrapper.display_url|default:$attachment.display_url}">{/if}
+ {$wrapper.description|escape|default:$attachment.filename}
+ {if $attachment.display_url}</a>{/if}
+ {else}
+ <{$wrapper.wrapper|default:'div'} class="mimeaudio {$wrapper.class|default:'att-plugin'}"{if $wrapper.style} style="{$wrapper.style}{/if}">
+ {if $attachment.media_url}
+ {include file="bitpackage:liberty/mime_audio_player_inc.tpl"}
+ {/if}
+ {if $wrapper.display_url}<a {$wrapper.href_class} href="{$wrapper.display_url}">{/if}
+ {$wrapper.description|escape|default:$attachment.meta.title|default:"{tr}Full Details{/tr}"}
+ {if $wrapper.display_url}</a>{/if}
+ </{$wrapper.wrapper|default:'div'}>
+ {/if}
{/if}
{/strip}
diff --git a/templates/mime_audio_player_inc.tpl b/templates/mime_audio_player_inc.tpl
index c12a821..7f4234c 100644
--- a/templates/mime_audio_player_inc.tpl
+++ b/templates/mime_audio_player_inc.tpl
@@ -1,13 +1,17 @@
{strip}
-{if $attachment.audio_url}
+{if $attachment.media_url}
+ {assign var=id value="audio_`$display_type``$attachment.attachment_id`"}
+ {if $uploadTab}{assign var=id value="`$id`_tab"}{/if}
+
+ {* album covers are usually square - scrollbar is 20px high *}
{if $thumbsize eq "small"}
{assign var=width value=160}
- {assign var=height value=140}
+ {assign var=height value=180}
{else}
{assign var=width value=400}
- {assign var=height value=320}
+ {assign var=height value=420}
{/if}
- <div id="audio_player_{$area}{$attachment.attachment_id}"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.</div>
+ <div id="{$id}"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.</div>
<script type="text/javascript">/* <![CDATA[ */
{if !$attachment.thumbnail_is_mime && $attachment.thumbnail_url.medium}
var so = new SWFObject('{$smarty.const.UTIL_PKG_URL}javascript/flv_player/mediaplayer.swf','mpl','{$width}','{$height}','7');
@@ -15,15 +19,10 @@
{else}
var so = new SWFObject('{$smarty.const.UTIL_PKG_URL}javascript/flv_player/mediaplayer.swf','mpl','{$width}','20','7');
{/if}
- so.addVariable("file","{$attachment.audio_url}");
+ so.addVariable("file","{$attachment.media_url}");
so.addVariable("frontcolor","0x{$gBitSystem->getConfig('mime_audio_frontcolor','FFFFFF')}");
so.addVariable("backcolor","0x{$gBitSystem->getConfig('mime_audio_backcolor','000000')}");
- so.write('audio_player_{$area}{$attachment.attachment_id}');
+ so.write('{$id}');
/* ]]> */</script>
{/if}
-
-{if $area eq "storage_thumbs"}
- {if $attachment.meta.title}{$attachment.meta.title}<br />{/if}
- <a href="{$attachment.display_url}">{tr}Full Details{/tr}</a>
-{/if}
{/strip}
diff --git a/templates/mime_audio_view_inc.tpl b/templates/mime_audio_view_inc.tpl
index c4af125..f01c5de 100644
--- a/templates/mime_audio_view_inc.tpl
+++ b/templates/mime_audio_view_inc.tpl
@@ -1,5 +1,5 @@
{strip}
-{if $attachment.audio_url}
+{if $attachment.media_url}
<div class="row" style="text-align:center;">
{include file="bitpackage:liberty/mime_audio_player_inc.tpl"}
</div>
diff --git a/templates/mime_default_inline_inc.tpl b/templates/mime_default_inline_inc.tpl
index 2f2c877..37be63f 100644
--- a/templates/mime_default_inline_inc.tpl
+++ b/templates/mime_default_inline_inc.tpl
@@ -1,5 +1,5 @@
{strip}
-{if $area == "storage_thumbs"}
+{if $display_type == "storage_thumbs"}
<div class="item">
{if $attachment.thumbnail_url.$thumbsize}
{if !$attachment.is_primary or ( $attachment.is_primary and !$hideprimary )}
diff --git a/templates/mime_flv_inline_inc.tpl b/templates/mime_flv_inline_inc.tpl
index 12bfc41..25d0451 100644
--- a/templates/mime_flv_inline_inc.tpl
+++ b/templates/mime_flv_inline_inc.tpl
@@ -1,7 +1,28 @@
{strip}
-{if $attachment.video_url}
- <div class="row" style="text-align:center;">
- {include file="bitpackage:liberty/mime_flv_player_inc.tpl"}
+{if $display_type == "storage_thumbs"}
+ <div class="item">
+ {if $attachment.media_url}
+ {include file="bitpackage:liberty/mime_flv_player_inc.tpl"}
+ {/if}
+
+ {if $display_type eq "storage_thumbs"}
+ <a href="{$attachment.display_url}">{tr}Full Details{/tr}</a>
+ {/if}
</div>
+{else}
+ {if $wrapper.output == 'desc' || $wrapper.output == 'description'}
+ {if $attachment.display_url}<a {$wrapper.href_class} href="{$wrapper.display_url|default:$attachment.display_url}">{/if}
+ {$wrapper.description|escape|default:$attachment.filename}
+ {if $attachment.display_url}</a>{/if}
+ {else}
+ <{$wrapper.wrapper|default:'div'} class="mimeflv {$wrapper.class|default:'att-plugin'}"{if $wrapper.style} style="{$wrapper.style}{/if}">
+ {if $attachment.media_url}
+ {include file="bitpackage:liberty/mime_flv_player_inc.tpl"}
+ {/if}
+ {if $wrapper.display_url}<a {$wrapper.href_class} href="{$wrapper.display_url}">{/if}
+ {$wrapper.description|escape|default:"{tr}Full Details{/tr}"}
+ {if $wrapper.display_url}</a>{/if}
+ </{$wrapper.wrapper|default:'div'}>
+ {/if}
{/if}
{/strip}
diff --git a/templates/mime_flv_player_inc.tpl b/templates/mime_flv_player_inc.tpl
index 7a1d826..b50c3cb 100644
--- a/templates/mime_flv_player_inc.tpl
+++ b/templates/mime_flv_player_inc.tpl
@@ -1,22 +1,22 @@
{strip}
-<div id="flv_player_{$area}{$attachment.attachment_id}"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.</div>
-<script type="text/javascript">/* <![CDATA[ */
- {if $thumbsize eq "small"}
- {assign var=width value=160}
- {math width=$width scrollbar=20 original_width=$attachment.meta.width original_height=$attachment.meta.height equation="original_height / original_width * width + scrollbar" assign=height}
- var so = new SWFObject('{$smarty.const.UTIL_PKG_URL}javascript/flv_player/mediaplayer.swf','player','{$width}','{$height}','7');
- {else}
- var so = new SWFObject('{$smarty.const.UTIL_PKG_URL}javascript/flv_player/mediaplayer.swf','player','{$attachment.meta.width}','{$attachment.meta.height+20}','7');
- {/if}
- so.addVariable("file","{$attachment.video_url|default:$attachment.source_url}");
- so.addVariable("image","{$attachment.thumbnail_url.medium}");
- so.addVariable("overstretch","fit");
- so.addVariable("frontcolor","0x{$gBitSystem->getConfig('mime_flv_frontcolor','FFFFFF')}");
- so.addVariable("backcolor","0x{$gBitSystem->getConfig('mime_flv_backcolor','000000')}");
- so.write('flv_player_{$area}{$attachment.attachment_id}');
-/* ]]> */</script>
-
-{if $area eq "storage_thumbs"}
- <a href="{$attachment.display_url}">{tr}Original version{/tr}</a>
+{if $attachment.media_url}
+ {assign var=id value="video_`$display_type``$attachment.attachment_id`"}
+ {if $uploadTab}{assign var=id value="`$id`_tab"}{/if}
+ <div id="{$id}"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.</div>
+ <script type="text/javascript">/* <![CDATA[ */
+ {if $thumbsize eq "small"}
+ {assign var=width value=160}
+ {math width=$width scrollbar=20 original_width=$attachment.meta.width original_height=$attachment.meta.height equation="original_height / original_width * width + scrollbar" assign=height}
+ var so = new SWFObject('{$smarty.const.UTIL_PKG_URL}javascript/flv_player/mediaplayer.swf','player','{$width}','{$height}','7');
+ {else}
+ var so = new SWFObject('{$smarty.const.UTIL_PKG_URL}javascript/flv_player/mediaplayer.swf','player','{$attachment.meta.width}','{$attachment.meta.height+20}','7');
+ {/if}
+ so.addVariable("file","{$attachment.media_url}");
+ so.addVariable("image","{$attachment.thumbnail_url.medium}");
+ so.addVariable("overstretch","fit");
+ so.addVariable("frontcolor","0x{$gBitSystem->getConfig('mime_flv_frontcolor','FFFFFF')}");
+ so.addVariable("backcolor","0x{$gBitSystem->getConfig('mime_flv_backcolor','000000')}");
+ so.write('{$id}');
+ /* ]]> */</script>
{/if}
{/strip}
diff --git a/templates/mime_flv_view_inc.tpl b/templates/mime_flv_view_inc.tpl
index c3281b8..5990457 100644
--- a/templates/mime_flv_view_inc.tpl
+++ b/templates/mime_flv_view_inc.tpl
@@ -1,5 +1,5 @@
{strip}
-{if $attachment.video_url}
+{if $attachment.media_url}
<div class="row" style="text-align:center;">
{include file="bitpackage:liberty/mime_flv_player_inc.tpl"}
</div>
@@ -48,13 +48,6 @@
{forminput}
<a href="{$attachment.download_url}">{$attachment.filename|escape}</a>
&nbsp; <small>({$attachment.mime_type})</small>
- {* TODO: get this to work if $gContent->hasEditPermission() && $attachment.video_url}
- {form ipackage=treasury ifile="plugins/form.flv.php"}
- <input type="hidden" name="content_id" value="{$gContent->mContentId}" />
- <input type="submit" name="remove_original" value="{tr}Remove Original{/tr}" />
- {formhelp note="This will remove the original file from the server. The falsh video will remain and you can still view the video but you cannot download the original anymore."}
- {/form}
- {/if*}
{/forminput}
</div>
@@ -66,25 +59,5 @@
</div>
{/if}
-{* TODO: get this to work if $gContent->hasEditPermission() && $attachment.video_url}
- <div class="row">
- {formlabel label="New Aspect Ratio" for="aspect"}
- {forminput}
- {form ipackage=treasury ifile="plugins/form.flv.php"}
- <input type="hidden" name="content_id" value="{$gContent->mContentId}" />
- <select name="aspect" id="aspect">
- <option value="">{tr}No Change{/tr}</option>
- <option value="{math equation="x/y" x=4 y=3 }">4:3 ({tr}TV{/tr})</option>
- <option value="{math equation="x/y" x=14 y=9 }">14:9 ({tr}Anamorphic{/tr})</option>
- <option value="{math equation="x/y" x=16 y=9 }">16:9 ({tr}Widescreen{/tr})</option>
- <option value="{math equation="x/y" x=16 y=10}">16:10 ({tr}Computer Widescreen{/tr})</option>
- </select>
- <input type="submit" name="aspect_ratio" value="{tr}Set Aspect{/tr}" />
- {formhelp note="Here you can override the initially set aspect ratio. Please note that the displayed aspect aspect ratio might not correspond to the set value."}
- {/form}
- {/forminput}
- </div>
-{/if*}
-
{attachhelp legend=1 hash=$attachment}
{/strip}
diff --git a/templates/storage_thumbs.tpl b/templates/storage_thumbs.tpl
index 815a382..1d7c22c 100644
--- a/templates/storage_thumbs.tpl
+++ b/templates/storage_thumbs.tpl
@@ -12,7 +12,7 @@
{foreach from=$gContent->mStorage item=attachment key=id}
{* TODO: this should not be necessary anymore as soon as we've faded out old attachment plugins *}
{if $attachment.is_mime}
- {include file=$gLibertySystem->getMimeTemplate('inline',$attachment.attachment_plugin_guid) area=storage_thumbs preferences=$gContent->mStoragePrefs.$id}
+ {include file=$gLibertySystem->getMimeTemplate('inline',$attachment.attachment_plugin_guid) display_type=storage_thumbs preferences=$gContent->mStoragePrefs.$id}
{else}
{* TODO: get rid of old plugin system *}
{capture name="size"}{$attachment.file_size|display_bytes}{/capture}