{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'folder'} {/block} {block name="page-title"}{intl l='Folders'}{/block} {block name="check-resource"}admin.folder{/block} {block name="check-access"}view{/block} {block name="main-content"}
{include file="includes/folder-breadcrumb.html" folder_id=$parent } {hook name="folders.top" location="folders_top" }

{* display parent folder name, and get current folder ID *} {loop name="folder_title" type="folder" visible="*" id=$parent} {intl l="Folders in %fold" fold={$TITLE}} {$fold_id = $ID} {/loop} {elseloop rel="folder_title"} {intl l="Top level folders"} {/elseloop} {hook name="folders.caption" location="folder_list_caption" } {loop type="auth" name="can_create" role="ADMIN" resource="admin.folder" access="CREATE"} {/loop}
{ifloop rel="folder_list"}
{admin_sortable_header current_order=$folder_order order='id' reverse_order='id_reverse' path={url path='/admin/folders' parent=$parent} request_parameter_name='folder_order' label="{intl l='ID'}" } |  | {admin_sortable_header current_order=$folder_order order='alpha' reverse_order='alpha_reverse' path={url path='/admin/folders' parent=$parent} request_parameter_name='folder_order' label="{intl l='Folder title'}" } {hook name="folders.header" location="folder_list_header" } | {admin_sortable_header current_order=$folder_order order='visible' reverse_order='visible_reverse' path={url path='/admin/folders' parent=$parent} request_parameter_name='folder_order' label="{intl l='Online'}" } | {admin_sortable_header current_order=$folder_order order='manual' reverse_order='manual_reverse' path={url path='/admin/folders' parent=$parent} request_parameter_name='folder_order' label="{intl l='Position'}" } | {intl l='Actions'}
--- | --- | --- | --- | --- | ---
{loop name="folder_list" type="folder" visible="*" parent=$parent order=$folder_order backend_context="1" lang=$lang_id return_url=false}
{$ID} | {loop type="image" name="folder_image" source="folder" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"} {/loop} | {$TITLE} {hook name="folders.row" location="folder_list_row" folder_id={$ID} } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.folder" access="UPDATE"} {/loop} {elseloop rel="can_change"} {/elseloop} | {admin_position_block resource="admin.folder" access="UPDATE" path={url path='admin/folders/update-position' folder_id=$ID} url_parameter="folder_id" in_place_edit_class="folderPositionChange" position=$POSITION id=$ID } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.folder" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.folder" access="DELETE"} {/loop}
{/loop}
{/ifloop} {elseloop rel="folder_list"}
{loop type="auth" name="can_create" role="ADMIN" resource="admin.folder" access="CREATE"} {intl l="This folder has no sub-folders. To create a new one, click the + button above."} {/loop} {elseloop rel="can_create"} {intl l="This folder has no sub-folders."} {/elseloop}
{/elseloop}

{* -- CONTENT MANAGEMENT ---------------------------------------------------- *} {* No content outsie a folder *} {if $parent > 0}

{* display parent folder name *} {loop name="folder_title" type="folder" visible="*" id=$parent} {intl l="Contents in %fold" fold={$TITLE}} {/loop} {elseloop rel="folder_title"} {intl l="Top level Contents"} {/elseloop} {hook name="contents.caption" location="content_list_caption" }
{ifloop rel="content_list"}
{admin_sortable_header current_order=$content_order order='id' reverse_order='id_reverse' request_parameter_name='content_order' path={url path='/admin/folders' parent=$parent target='contents'} label="{intl l='ID'}" } |  | {admin_sortable_header current_order=$content_order order='alpha' reverse_order='alpha_reverse' request_parameter_name='content_order' path={url path='/admin/folders' parent=$parent target='contents'} label="{intl l='Content title'}" } {hook name="contents.header" location="content_list_header" } | {admin_sortable_header current_order=$content_order order='visible' reverse_order='visible_reverse' request_parameter_name='content_order' path={url path='/admin/folders' parent=$parent target='contents'} label="{intl l='Online'}" } | {admin_sortable_header current_order=$content_order order='manual' reverse_order='manual_reverse' request_parameter_name='content_order' path={url path='/admin/folders' parent=$parent target='contents'} label="{intl l='Position'}" } |
--- | --- | --- | --- | --- | ---
{loop name="content_list" type="content" visible="*" folder=$parent order=$content_order return_url=false}
{$ID} | {loop type="image" name="folder_image" source="content" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"} {/loop} | {$TITLE} {hook name="contents.row" location="content_list_row" } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.content" access="UPDATE"} {/loop} {elseloop rel="can_change"} {/elseloop} | {admin_position_block resource="admin.content" access="UPDATE" path={url path='/admin/content/update-position' content_id=$ID folder_id=$parent} url_parameter="content_id" in_place_edit_class="contentPositionChange" position=$POSITION id=$ID } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.content" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.content" access="DELETE"} {/loop}
{/loop}
{/ifloop} {elseloop rel="content_list"}
{intl l="This folder doesn't contains any contents. To add a new content, click the + button above."}
{/elseloop}

{else}
{intl l="To create a new content, select an existing folder, or create a new one."}
{/if} {hook name="folders.bottom" location="folders_bottom" }
{* -- Adding a new folder ------------------------------------------------- *} {form name="thelia.admin.folder.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "folder_creation_dialog"} {form_hidden_fields} {form_field field='success_url'} {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} {/form_field} {form_field field='parent'} {/form_field} {form_field field='title'}
{$label} : {loop type="lang" name="default-lang" default_only="1"}
{intl l='Enter here the folder name in the default language (%title)' title="{$TITLE}"}
{* Switch edition to the current locale *} {form_field field='locale'} {/form_field} {/loop}
{/form_field} {form_field field='visible'}
{$label}
{/form_field} {hook name="folder.create-form" location="folder_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "folder_creation_dialog" dialog_title = {intl l="Create a new folder"} dialog_body = {$smarty.capture.folder_creation_dialog nofilter} dialog_ok_label = {intl l="Create this folder"} form_action = {url path='/admin/folders/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* -- Adding a new content -------------------------------------------------- *} {form name="thelia.admin.content.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "content_creation_dialog"} {form_hidden_fields} {* Be sure to get the folder_id, even if the form could not be validated *} {form_field field='success_url'} {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} {/form_field} {form_field field='default_folder'} {/form_field} {form_field field='title'}
{$label} : {loop type="lang" name="default-lang" default_only="1"}
{intl l='Enter here the content name in the default language (%title)' title={$TITLE}}
{* Switch edition to the current locale *} {form_field field='locale'} {/form_field} {/loop}
{/form_field} {form_field field='visible'}
{$label}
{/form_field} {hook name="content.create-form" location="content_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "content_creation_dialog" dialog_title = {intl l="Create a new content"} dialog_body = {$smarty.capture.content_creation_dialog nofilter} dialog_ok_label = {intl l="Create this content"} form_action = {url path='/admin/content/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* -- Delete folder confirmation dialog ----------------------------------- *} {capture "folder_delete_dialog"} {hook name="folder.delete-form" location="folder_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "folder_delete_dialog" dialog_title = {intl l="Delete folder"} dialog_message = {intl l="Do you really want to delete this folder and all its content ?"} form_action = {token_url path='/admin/folders/delete'} form_content = {$smarty.capture.folder_delete_dialog nofilter} } {* -- Delete content confirmation dialog ------------------------------------ *} {capture "content_delete_dialog"} {hook name="content.delete-form" location="content_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "content_delete_dialog" dialog_title = {intl l="Delete content"} dialog_message = {intl l="Do you really want to delete this content ?"} form_action = {token_url path='/admin/content/delete'} form_content = {$smarty.capture.content_delete_dialog nofilter} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
{/javascripts} {javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
{/javascripts}
{/block} {block name="javascript-last-call"} {hook name="folders.js" location="folders-js" } {/block}