# You must use a tab-size of 4 spaces to edit this file.
---
plugin_settings:
    module_class_name: zenario_document_container
    tabs:
        first_tab:
            fields:
                container_mode:
                    plugin_setting:
                        name: container_mode
                    label: 'Scope:'
                    type: radios
                    value: documents
                    values: 
                        documents: 
                            ord: 1
                            label: "Show a specific document, or select a folder to show documents inside"
                        user_documents: 
                            ord: 2
                            label: "Automatically show confidential documents for the logged-in user"
                    format_onchange: true
                document_source:
                    visible_if: zenarioAB.value('container_mode') == 'documents'
                    plugin_setting:
                        name: document_source
                    label: 'Select document or folder:'
                    side_note: 'Select either a specific document, or a folder containing one or more documents.'
                    pick_items:
                        path: zenario__library/panels/documents
                        min_path: zenario__library/panels/documents
                        max_path: zenario__library/panels/documents
                        target_path: zenario__library/panels/documents
                        select_phrase: Select...
                    format_onchange: true
                    indent: 1
                privacy_warning:
                    plugin_setting:
                        name: privacy_warning
                    #note_below: Controlled in module_code.php
                    indent: 1
                    same_row: true
                    visible_if: zenarioAB.value('container_mode') == 'documents'
                show_files_in_folders:
                    plugin_setting:
                        name: show_files_in_folders
                    label: "Show documents:"
                    type: radios
                    value: folder
                    values:
                        folder:
                            label: 'Only in selected folder'
                        sub-folders:
                            label: 'Descend one level of sub-folder'
                        all:
                            label: 'Descend all levels of sub-folder'
                    format_onchange: true
                    indent: 1
                show_folders_in_results:
                    plugin_setting:
                        name: show_folders_in_results
                    label: "Show sub-folder names in results"
                    type: checkbox
                    indent: 2
                
                order_by:
                    visible_if: zenarioAB.value('show_files_in_folders') == 'folder'
                    plugin_setting:
                        name: order_by
                    label: 'Order by:'
                    type: select
                    values:
                        manual_order:
                            label: Manual order
                        filename:
                            label: Filename
                        title:
                            label: Title
                        filename_title:
                            label: Title / filename
                        created_date:
                            label: Created date
                    value: manual_order
                    indent: 2
                    redraw_onchange: true
                
                order_by_sort:
                    hide_with_previous_field: true
                    visible_if: zenarioAB.value('order_by') != 'manual_order'
                    plugin_setting:
                        name: order_by_sort
                    same_row: true
                    indent: 2
                    type: select
                    values:
                        ascending:
                            label: Ascending
                        descending:
                            label: Descending
                
                show_a_heading:
                    plugin_setting:
                        name: show_a_heading
                    label: "Show a heading"
                    type: checkbox
                    redraw_onchange: true
                    indent: 1
                title_tags:
                    hide_with_previous_field: true
                    visible_if: zenarioAB.value('show_a_heading')
                    plugin_setting:
                        name: title_tags
                    label: 'Title heading tags'
                    type: select
                    values:
                        h1: Heading 1
                        h2: Heading 2
                        h3: Heading 3
                        h4: Heading 4
                        h5: Heading 5
                        h6: Heading 6
                        p: Paragraph
                    value: h1
                    side_note: |
                        Choose which HTML tags the title will be displayed in.
                    indent: 2
                show_folder_name_as_title:
                    plugin_setting:
                        name: show_folder_name_as_title
                    label: "Show selected folder name as title"
                    type: checkbox
                    redraw_onchange: true
                    indent: 2
                    visible_if: zenarioAB.value('show_a_heading')
                heading:
                    plugin_setting:
                        name: heading
                    label: "Heading:"
                    type: text
                    indent: 2
                    value: "Heading"
                    visible_if: (zenarioAB.value('show_a_heading') && !zenarioAB.value('show_folder_name_as_title'))
                    validation:
                        required_if_not_hidden: Enter a heading.
                    
                filter:
                    plugin_setting:
                        name: filter
                    label: 'Filter by a dataset value:'
                    type: select
                    values: {}
                    empty_value: -- Don't filter --
                    side_note: Choose a dataset field to filter the results by.
                    format_onchange: true
                    indent: 1
                filter_values:
                    hide_with_previous_field: true
                    visible_if: zenarioAB.value('filter')
                    plugin_setting:
                        name: filter_values
                    type: checkboxes
                    values: {}
                    indent: 2
                    validation:
                        required_if_not_hidden: Choose at least one filter value.
                
                date_filter:
                    plugin_setting:
                        name: date_filter
                    label: 'Filter by a dataset date:'
                    type: select
                    values: {}
                    empty_value: -- Don't filter --
                    side_note: Choose a dataset field to filter the results by.
                    redraw_onchange: true
                    indent: 1
                date_filter_type:
                    hide_with_previous_field: true
                    visible_if: zenarioAB.value('date_filter')
                    plugin_setting:
                        name: date_filter_type
                    type: select
                    values:
                        date_range:
                            label: Date range...
                        relative_date_range:
                            label: Relative date range...
                        prior_to_date:
                            label: Prior to...
                        on_date:
                            label: On...
                        after_date:
                            label: Later than...
                    value: date_range
                    redraw_onchange: true
                    indent: 2
                date_range_start:
                    hide_with_previous_outdented_field: true
                    visible_if: zenarioAB.value('date_filter_type') == 'date_range'
                    plugin_setting:
                        name: date_range_start
                    label: "Date range start:"
                    type: date
                    change_month_and_year: true
                    indent: 3
                    validation:
                        required_if_not_hidden: Please choose a date.
                date_range_end:
                    hide_with_previous_outdented_field: true
                    visible_if: zenarioAB.value('date_filter_type') == 'date_range'
                    plugin_setting:
                        name: date_range_end
                    label: "Date range end:"
                    type: date
                    change_month_and_year: true
                    indent: 3
                    validation:
                        required_if_not_hidden: Please choose a date.
                relative_date_range_operator:
                    hide_with_previous_outdented_field: true
                    visible_if: zenarioAB.value('date_filter_type') == 'relative_date_range'
                    plugin_setting:
                        name: relative_date_range_operator
                    label: 'Relative date range:'
                    type: select
                    values:
                        newer: 
                            label: Not older than
                        older: 
                            label: Older than
                    value: newer
                    validation:
                        required_if_not_hidden: Please specify a relative date range.
                    indent: 3
                relative_date_range_value:
                    hide_with_previous_outdented_field: true
                    visible_if: zenarioAB.value('date_filter_type') == 'relative_date_range'
                    plugin_setting:
                        name: relative_date_range_value
                    type: text
                    same_row: true
                    style: width:50px;
                    pre_field_html: '&nbsp;'
                    post_field_html: '&nbsp;'
                    validation:
                        required_if_not_hidden: Please specify a relative date range.
                relative_date_range_units:
                    hide_with_previous_outdented_field: true
                    visible_if: zenarioAB.value('date_filter_type') == 'relative_date_range'
                    plugin_setting:
                        name: relative_date_range_units
                    type: select
                    values:
                        days: 
                            label: day(s)
                        months: 
                            label: month(s)
                        years: 
                            label: year(s)
                    same_row: true
                    validation:
                        required_if_not_hidden: Please specify a relative date range.
                prior_to_date:
                    hide_with_previous_outdented_field: true
                    visible_if: zenarioAB.value('date_filter_type') == 'prior_to_date'
                    plugin_setting:
                        name: prior_to_date
                    label: "Prior to the date:"
                    type: date
                    change_month_and_year: true
                    indent: 3
                    validation:
                        required_if_not_hidden: Please choose a date.
                on_date:
                    hide_with_previous_outdented_field: true
                    visible_if: zenarioAB.value('date_filter_type') == 'on_date'
                    plugin_setting:
                        name: on_date
                    label: "On the date:"
                    type: date
                    change_month_and_year: true
                    indent: 3
                    validation:
                        required_if_not_hidden: Please choose a date.
                after_date:
                    hide_with_previous_outdented_field: true
                    visible_if: zenarioAB.value('date_filter_type') == 'after_date'
                    plugin_setting:
                        name: after_date
                    label: "Later than the date:"
                    type: date
                    change_month_and_year: true
                    indent: 3
                    validation:
                        required_if_not_hidden: Please choose a date.
                
                show_filename:
                    plugin_setting:
                        name: show_filename
                    label: 'Show document filename'
                    type: checkbox
                    value: 1
                show_title:
                    plugin_setting:
                        name: show_title
                    label: "Show document title"
                    type: checkbox
                    redraw_onchange: true
                show_filename_if_no_title:
                    visible_if: zenarioAB.value('show_title');
                    indent: 1
                    plugin_setting:
                        name: show_filename_if_no_title
                    label: "Show document filename if no title exists"
                    type: checkbox
                show_file_size:
                    plugin_setting:
                        name: show_file_size
                    label: "Show document file size"
                    type: checkbox
                show_upload_date:
                    plugin_setting:
                        name: show_upload_date
                    label: "Show document upload date"
                    type: checkbox
                show_thumbnails:
                    plugin_setting:
                        name: show_thumbnails
                    label: "Show document thumbnails (if available)"
                    type: checkbox
                    format_onchange: true
                lazy_load_images:
                    plugin_setting:
                        name: lazy_load_images
                    label: "Lazy load thumbnails"
                    type: checkbox
                    indent: 1
                    visible_if: zenarioAB.value('show_thumbnails');
                canvas:
                    plugin_setting:
                        name: canvas
                    label: 'Image canvas:'
                    type: select
                    value: unlimited
                    values:
                        unlimited:
                            ord: "1"
                            label: Unlimited size
                        fixed_width:
                            ord: "2"
                            label: Constrain by width
                        fixed_height:
                            ord: "3"
                            label: Constrain by height
                        fixed_width_and_height:
                            ord: "4"
                            label: Constrain by width and height
                        resize_and_crop:
                            ord: "5"
                            label: Resize and crop
                    format_onchange: true
                    indent: 1
                width:
                    plugin_setting:
                        name: width
                    label: 'Width:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a width.
                        numeric: The width must be a number.
                    value: ""
                    maxlength: "5"
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                    indent: 2
                height:
                    plugin_setting:
                        name: height
                    label: 'Height:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a height.
                        numeric: The height must be a number.
                    value: ""
                    maxlength: "5"
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                    indent: 2
                show_view_button:
                    plugin_setting:
                        name: show_view_button
                    label: 'Show a View button'
                    type: checkbox
                    value: 0
                    redraw_onchange: true
                show_download_link:
                    plugin_setting:
                        name: show_download_link
                    label: 'Show a Download button'
                    type: checkbox
                    value: 0
                    redraw_onchange: true
                download_link_phrase:
                    indent: 1
                    plugin_setting:
                        name: download_link_phrase
                    label: 'Download link phrase:'
                    type: text
                    format_onchange: Yes
                    visible_if:
                        lib.value: show_download_link
                    validation:
                        required_if_not_hidden: Please enter a phrase
                offer_download_as_zip:
                    plugin_setting:
                        name: offer_download_as_zip
                    label: 'Offer download as ZIP file'
                    type: checkbox
                    redraw_onchange: true
                zip_file_name:
                    visible_if: zenarioAB.value('offer_download_as_zip')
                    plugin_setting:
                        name: zip_file_name
                    label: 'ZIP archive name'
                    type: text
                    side_note: >
                        You can specify the name of the ZIP archive. If you
                        leave this field empty, the folder name will be used.
                    post_field_html: '.zip'
                    indent: 1
                document_tags:
                    plugin_setting:
                        name: document_tags
                    label: 'Only show documents with one of the tags:'
                    type: checkboxes
                    load_values_from_organizer_path: zenario__library/panels/document_tags
