blob: 738f464dd354511991b023263443cd1b6b898da4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
{strip}
{* in some ajax cases we need to uniquely identify portions of a form so we get an id if we dont already have one *}
{if !$form_id}
{capture name=form_id}
{form_id}
{/capture}
{assign var=form_id value=$smarty.capture.form_id}
{/if}
{* we will use the LibertyMime method if available *}
{if $gLibertySystem->isPluginActive( $smarty.const.LIBERTY_DEFAULT_MIME_HANDLER )}
{foreach from=$gLibertySystem->getAllMimeTemplates('upload') item=tpl}
{include file=$tpl}
{/foreach}
{include file="bitpackage:liberty/edit_storage_list.tpl" uploadTab=TRUE}
{else}
{* this condition is a temporary hack to disable ajax uploads on new content to avoid bogus entires in liberty_attachments.
* we all want to see this working asap and are thinking of the best way to fix this - xing - Wednesday Nov 14, 2007 18:38:18 CET *}
{if $gBitSystem->getConfig('liberty_attachment_style') != 'ajax' || $gContent->isValid()}
{if $gBitUser->hasPermission('p_liberty_attach_attachments') }
{php} include (LIBERTY_PKG_PATH."edit_storage_inc.php"); {/php}
{foreach from=$gLibertySystem->mPlugins item=plugin key=guid}
{* $no_plugins is set by the including template *}
{if $plugin.is_active eq 'y' and $plugin.edit_field and $plugin.plugin_type eq 'storage' and !$no_plugins}
<div class="row">
{formlabel label=`$plugin.edit_label`}
{forminput}
{eval var=$plugin.edit_field}
{formhelp note=`$plugin.edit_help`}
{/forminput}
</div>
{/if}
{/foreach}
{/if}
{include file="bitpackage:liberty/edit_storage_list.tpl" uploadTab=TRUE}
{else}
{if $gBitUser->hasPermission('p_liberty_attach_attachments') }
{php} include (LIBERTY_PKG_PATH."edit_storage_inc.php"); {/php}
{foreach from=$gLibertySystem->mPlugins item=plugin key=guid}
{* $no_plugins is set by the including template *}
{if $plugin.is_active eq 'y' and $plugin.edit_field and $plugin.plugin_type eq 'storage' and !$no_plugins}
<div class="row">
{formlabel label=`$plugin.edit_label`}
{forminput}
{eval var=$plugin.edit_field_new}
{formhelp note=`$plugin.edit_help_new`}
{/forminput}
</div>
{/if}
{/foreach}
{/if}
{/if}
{* end of annoying ajax upload prevention hack *}
{* The new attachment browser is supposd to only provide an easy means of
viewing existing content that can be inserted into the contnet using
{attachment} or {content} or similar. there is no means to attach and detach
content anymore *}
{*if $gBitUser->hasPermission('p_liberty_attach_attachments') }
<h2 class="clear"><a href="javascript:void(0);" onclick="BitAjax.updater( 'attbrowser', '{$smarty.const.LIBERTY_PKG_URL}ajax_attachment_browser.php', 'ajax=true&content_id={$gContent->mContentId}' );">{tr}Attachment Browser{/tr}</a></h2>
<noscript><div class="warning">{tr}The attachment browser only works with javascript enabled.{/tr}</div></noscript>
<div id="attbrowser" class="attbrowser"><p>{tr}Please click on the Attachement Browser link above to view available attachments.{/tr}</p></div>
{else}
<p>{tr}Sorry - you do not have permission to attach files to this content.{/tr}</p>
{/if*}
{/if}
{/strip}
|