diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2008-05-10 21:50:37 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2008-05-10 21:50:37 +0000 |
| commit | 932390d81190619626275dfef02d695b05bc0d1d (patch) | |
| tree | 96e247ba200a10af1bda3fe39c42dbf8f7f6ed51 /templates | |
| parent | 5156b3ded7fdb88d71d064f8ff36bebf298a8985 (diff) | |
| download | liberty-932390d81190619626275dfef02d695b05bc0d1d.tar.gz liberty-932390d81190619626275dfef02d695b05bc0d1d.tar.bz2 liberty-932390d81190619626275dfef02d695b05bc0d1d.zip | |
SCHEMA CHANGE: added liberty_attachment_prefs to store attachment preferences
introducing a new layer on top LibertyAttachments to deal with file uploads supporting mimetype based plugins - ported from treasury
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/admin_mime_flv.tpl | 113 | ||||
| -rw-r--r-- | templates/mime_default_inline_inc.tpl | 13 | ||||
| -rw-r--r-- | templates/mime_default_view_inc.tpl | 39 | ||||
| -rw-r--r-- | templates/mime_flv_inline_inc.tpl | 7 | ||||
| -rw-r--r-- | templates/mime_flv_player_inc.tpl | 22 | ||||
| -rw-r--r-- | templates/mime_flv_view_inc.tpl | 90 | ||||
| -rw-r--r-- | templates/mime_view.tpl | 30 | ||||
| -rw-r--r-- | templates/storage_thumbs.tpl | 34 |
8 files changed, 334 insertions, 14 deletions
diff --git a/templates/admin_mime_flv.tpl b/templates/admin_mime_flv.tpl new file mode 100644 index 0000000..0541daa --- /dev/null +++ b/templates/admin_mime_flv.tpl @@ -0,0 +1,113 @@ +{strip} +<div class="display ___"> + <div class="header"> + <h1>{tr}Flashvideo Plugin Settings{/tr}</h1> + </div> + + <div class="body"> + {form legend="Flashvideo specific settings"} + <p class="formhelp"> + You can find some information relating to this plugin on the <a class="external" href="http://www.bitweaver.org/wiki/TreasuryFlvPlugin">TreasuryFlvPlugin plugin page</a> at bitweaver.org. + </p> + + {if !$gLibertySystem->isPluginActive( 'mimeflv' )} + {formfeedback error="This plugins has not been enabled. All settings you change here will have no effect on uploaded videos unless you enable the plugin in the liberty plugins administration screen"} + {/if} + + {formfeedback hash=$feedback} + <div class="row"> + {formlabel label="Path to ffmpeg" for="mime_flv_ffmpeg_path"} + {forminput} + <input type='text' name="mime_flv_ffmpeg_path" id="mime_flv_ffmpeg_path" size="40" value="{$gBitSystem->getConfig('mime_flv_ffmpeg_path')|escape|default:$ffmpeg_path}" /> + {formhelp note="If this path is not correct, please set the correct path to ffmepg."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Video bitrate" for="mime_flv_video_bitrate"} + {forminput} + {html_options + options=$rates.video_bitrate + values=$rates.video_bitrate + name=mime_flv_video_bitrate + id=mime_flv_video_bitrate + selected=$gBitSystem->getConfig('mime_flv_video_bitrate')|default:200000} kbits/s + {formhelp note="Set the video bitrate. The higher the bitrate the higher the quality but also the larger the file."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Video width" for="mime_flv_width"} + {forminput} + {html_options + options=$rates.video_width + values=$rates.video_width + name=mime_flv_width + id=mime_flv_width + selected=$gBitSystem->getConfig('mime_flv_width')|default:320} pixel + {formhelp note="Set the video width. We recommend 320 pixels. Height of the video will be adjusted automagically."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Audio sample rate" for="mime_flv_audio_samplerate"} + {forminput} + {html_options + options=$rates.audio_samplerate + values=$rates.audio_samplerate + name=mime_flv_audio_samplerate + id=mime_flv_audio_samplerate + selected=$gBitSystem->getConfig('mime_flv_audio_samplerate')|default:22050} Hz + {formhelp note="Set the audio sample rate. The higher the bitrate the higher the quality but also the larger the file."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Audio bitrate" for="mime_flv_audio_bitrate"} + {forminput} + {html_options + options=$rates.audio_bitrate + values=$rates.audio_bitrate + name=mime_flv_audio_bitrate + id=mime_flv_audio_bitrate + selected=$gBitSystem->getConfig('mime_flv_audio_bitrate')|default:32000} kbits/s + {formhelp note="Set the audio bitrate. The higher the bitrate the higher the quality but also the larger the file."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Default displayed size" for="mime_flv_default_size"} + {forminput} + {html_options + options=$rates.display_size + values=$rates.display_size + name=mime_flv_default_size + id=mime_flv_default_size + selected=$gBitSystem->getConfig('mime_flv_default_size')} + {formhelp note="If you are encoding small versions of the videos you can display larger versions. This will reduce video quality but make the encoded video smaller."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Foreground Colour" for="mime_flv_frontcolor"} + {forminput} + <input type='text' name="mime_flv_frontcolor" id="mime_flv_frontcolor" size="10" value="{$gBitSystem->getConfig('mime_flv_frontcolor')|default:"FFFFFF"}" /> + {formhelp note="Foreground colour of the progress bar."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Background Colour" for="mime_flv_backcolor"} + {forminput} + <input type='text' name="mime_flv_backcolor" id="mime_flv_backcolor" size="10" value="{$gBitSystem->getConfig('mime_flv_backcolor')|default:"000000"}" /> + {formhelp note="Background colour of the progress bar."} + {/forminput} + </div> + + <div class="row submit"> + <input type="submit" name="plugin_settings" value="{tr}Save Plugin Settings{/tr}" /> + </div> + {/form} + </div><!-- end .body --> +</div><!-- end .___ --> +{/strip} diff --git a/templates/mime_default_inline_inc.tpl b/templates/mime_default_inline_inc.tpl new file mode 100644 index 0000000..1142a09 --- /dev/null +++ b/templates/mime_default_inline_inc.tpl @@ -0,0 +1,13 @@ +{strip} +<div class="item"> + {if $attachment.thumbnail_url.$thumbsize} + {if !$attachment.is_primary or ( $attachment.is_primary and !$hideprimary )} + <a href="{$attachment.display_url}"> + <img class="thumb" src="{$attachment.thumbnail_url.$thumbsize}" alt="{$attachment.filename}" title="{$attachment.filename}"/> + </a> + {/if} + {else} + {tr}No thumbnail for{/tr} {$attachment.source_url} + {/if} +</div> +{/strip} diff --git a/templates/mime_default_view_inc.tpl b/templates/mime_default_view_inc.tpl new file mode 100644 index 0000000..a514ce2 --- /dev/null +++ b/templates/mime_default_view_inc.tpl @@ -0,0 +1,39 @@ +{strip} +<div class="row" style="text-align:center;"> + {assign var=size value=$smarty.request.size|default:medium} + <img title="" alt="" src="{$attachment.thumbnail_url.$size}" /> +</div> + +<div class="pagination"> + {tr}View other sizes{/tr}<br /> + {foreach name=size key=size from=$attachment.thumbnail_url item=url} + <a href="{$attachment.display_url|escape}&size={$size}">{tr}{$size}{/tr}</a> + {if !$smarty.foreach.size.last} • {/if} + {/foreach} +</div> + +<div class="row"> + {formlabel label="Uploaded by" for=""} + {forminput} + {displayname user_id=$attachment.user_id} + {/forminput} +</div> + +{if $attachment.download_url} + <div class="row"> + {formlabel label="Download" for=""} + {forminput} + <a href="{$attachment.download_url}">{$attachment.filename}</a> <small>({$attachment.file_size|display_bytes})</small> + {/forminput} + </div> +{/if} + +<div class="row"> + {formlabel label="Last Modified" for=""} + {forminput} + {$attachment.last_modified|bit_long_datetime} + {/forminput} +</div> + +{attachhelp legend=1 hash=$attachment} +{/strip} diff --git a/templates/mime_flv_inline_inc.tpl b/templates/mime_flv_inline_inc.tpl new file mode 100644 index 0000000..ef63bf5 --- /dev/null +++ b/templates/mime_flv_inline_inc.tpl @@ -0,0 +1,7 @@ +{strip} +{if $attachment.flv_url} + <div class="row" style="text-align:center;"> + {include file="bitpackage:liberty/mime_flv_player_inc.tpl"} + </div> +{/if} +{/strip} diff --git a/templates/mime_flv_player_inc.tpl b/templates/mime_flv_player_inc.tpl new file mode 100644 index 0000000..4790c4b --- /dev/null +++ b/templates/mime_flv_player_inc.tpl @@ -0,0 +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 $area eq "storage_thumbs"} + {assign var=width value=160} + {math width=$width scrollbar=20 original_width=$preferences.flv_width original_height=$preferences.flv_height equation="original_height / original_width * width + scrollbar" assign=height} + var so = new SWFObject('{$smarty.const.UTIL_PKG_URL}javascript/flv_player/flvplayer.swf','player','{$width}','{$height}','7'); + {else} + var so = new SWFObject('{$smarty.const.UTIL_PKG_URL}javascript/flv_player/flvplayer.swf','player','{$preferences.flv_width}','{$preferences.flv_height+20}','7'); + {/if} + so.addVariable("file","{$attachment.flv_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}">Original version</a> +{/if} +{/strip} diff --git a/templates/mime_flv_view_inc.tpl b/templates/mime_flv_view_inc.tpl new file mode 100644 index 0000000..d3d58bf --- /dev/null +++ b/templates/mime_flv_view_inc.tpl @@ -0,0 +1,90 @@ +{strip} +{if $attachment.flv_url} + <div class="row" style="text-align:center;"> + {include file="bitpackage:liberty/mime_flv_player_inc.tpl"} + </div> + + <div class="pagination"> + {tr}View other sizes{/tr}<br /> + • + <a href="{$attachment.display_url}&size=small">{tr}Small{/tr}</a> • + <a href="{$attachment.display_url}&size=medium">{tr}Medium{/tr}</a> • + <a href="{$attachment.display_url}&size=large">{tr}Large{/tr}</a> • + <a href="{$attachment.display_url}&size=huge">{tr}Huge{/tr}</a> • + <a href="{$attachment.display_url}&size=original">{tr}Original{/tr}</a> • + </div> +{elseif $attachment.status.processing} + <div class="row" style="text-align:center;"> + <a href="{$attachment.download_url}"> + {assign var=size value=$gBitSystem->getConfig('treasury_item_view_thumb')} + <img src="{$attachment.thumbnail_url.$size}{$refresh}" alt="{$gContent->getTitle()}" title="{$gContent->getTitle()}" /> + <br />{$gContent->getTitle()|escape} + </a> + </div> + {formfeedback warning="{tr}The video is being processed. please try to reload in a couple of minutes.{/tr}"} +{elseif $attachment.status.error} + <div class="row" style="text-align:center;"> + <a href="{$attachment.download_url}"> + {assign var=size value=$gBitSystem->getConfig('treasury_item_view_thumb')} + <img src="{$attachment.thumbnail_url.$size}{$refresh}" alt="{$gContent->getTitle()}" title="{$gContent->getTitle()}" /> + <br />{$gContent->getTitle()|escape} + </a> + </div> + {formfeedback error="{tr}The Video could not be processed. You can upload a different version of the film or simply leave as is.{/tr}"} +{/if} + +{if $attachment.preferences.duration} + <div class="row"> + {formlabel label="Duration" for=""} + {forminput} + {$attachment.preferences.duration|display_duration} + {/forminput} + </div> +{/if} + +{if $attachment.download_url} + <div class="row"> + {formlabel label="Filename" for=""} + {forminput} + <a href="{$attachment.download_url}">{$attachment.filename|escape}</a> + <small>({$attachment.mime_type})</small> + {* TODO: get this to work if $gContent->hasEditPermission() && $attachment.flv_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> + + <div class="row"> + {formlabel label="Filesize" for=""} + {forminput} + {$attachment.file_size|display_bytes} + {/forminput} + </div> +{/if} + +{* TODO: get this to work if $gContent->hasEditPermission() && $attachment.flv_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/mime_view.tpl b/templates/mime_view.tpl new file mode 100644 index 0000000..0edaf38 --- /dev/null +++ b/templates/mime_view.tpl @@ -0,0 +1,30 @@ +{strip} +<div class="display attachment"> + <div class="header"> + <h1>{tr}View Attachment{/tr}</h1> + </div> + + <div class="body"> + {legend legend="File Details"} + {include file=$view_template preferences=$attachment.preferences} + {/legend} + + {legend legend="Content this attachment belongs to"} + <div class="row"> + {formlabel label="Title"} + {forminput} + <a href="{$gContent->getDisplayUrl()}">{$gContent->getTitle()}</a> + {/forminput} + </div> + + <div class="row"> + {formlabel label="Content Type"} + {forminput} + {$gContent->mType.content_description} + {/forminput} + </div> + {/legend} + + </div><!-- end .body --> +</div><!-- end .attachment --> +{/strip} diff --git a/templates/storage_thumbs.tpl b/templates/storage_thumbs.tpl index 79aba90..f704f8c 100644 --- a/templates/storage_thumbs.tpl +++ b/templates/storage_thumbs.tpl @@ -9,21 +9,27 @@ {if !$thumbsize} {assign var=thumbsize value=small} {/if} - {foreach from=$gContent->mStorage item=attachment } - {capture name="size"}{$attachment.file_size|display_bytes}{/capture} - {capture name="popup"}{include file="bitpackage:kernel/popup_box.tpl" content="`$attachment.filename`<br />{tr}Size{/tr}: `$smarty.capture.size`" noclose=true}{/capture} - <div class="item"> - {if $attachment.thumbnail_url.$thumbsize} - {* by setting hideprimary, you can hide the primary thumbnail *} - {if !$attachment.is_primary or ( $attachment.is_primary and !$hideprimary )} - {if $attachment.source_url}<a href="{$attachment.source_url}">{/if} - <img class="thumb" src="{$attachment.thumbnail_url.$thumbsize}" alt="{$attachment.filename}" title="{$attachment.filename}" {popup fullhtml=1 center=1 text=$smarty.capture.popup|escape:"javascript"|escape:"html"}/> - {if $attachment.source_url}</a>{/if} + {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=$gContent->getMimeTemplate('inline',$attachment.attachment_plugin_guid) area=storage_thumbs preferences=$gContent->mStoragePrefs.$id} + {else} + {* TODO: get rid of old plugin system *} + {capture name="size"}{$attachment.file_size|display_bytes}{/capture} + {capture name="popup"}{include file="bitpackage:kernel/popup_box.tpl" content="`$attachment.filename`<br />{tr}Size{/tr}: `$smarty.capture.size`" noclose=true}{/capture} + <div class="item"> + {if $attachment.thumbnail_url.$thumbsize} + {* by setting hideprimary, you can hide the primary thumbnail *} + {if !$attachment.is_primary or ( $attachment.is_primary and !$hideprimary )} + {if $attachment.source_url}<a href="{$attachment.source_url}">{/if} + <img class="thumb" src="{$attachment.thumbnail_url.$thumbsize}" alt="{$attachment.filename}" title="{$attachment.filename}" {popup fullhtml=1 center=1 text=$smarty.capture.popup|escape:"javascript"|escape:"html"}/> + {if $attachment.source_url}</a>{/if} + {/if} + {else} + {tr}No thumbnail for{/tr} {$attachment.source_url} {/if} - {else} - {tr}No thumbnail for{/tr} {$attachment.source_url} - {/if} - </div> + </div> + {/if} {/foreach} </div> {/if} |
