{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}
{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}
{module_include 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=$form}
{form_field form=$form field='success_url'}
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
{/form_field}
{form_field form=$form field='parent'}
{/form_field}
{form_field form=$form field='title'}
{/form_field}
{module_include 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=$form}
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 form=$form}
{* Be sure to get the folder_id, even if the form could not be validated *}
{form_field form=$form field='success_url'}
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
{/form_field}
{form_field form=$form field='default_folder'}
{/form_field}
{form_field form=$form field='title'}