# You must use a tab-size of 4 spaces to edit this file.
---
zenario__library:
    panels:
        image_library:
            columns:
                usage_newsletters:
                    db_column: |
                        (
                            SELECT 1
                            FROM [[DB_PREFIX]]inline_images AS nii
                            WHERE nii.image_id = f.id
                              AND nii.foreign_key_to = 'newsletter'
                              AND nii.archived = 0
                            LIMIT 1
                        )
                    format: yes_or_no
                    hidden: true
                usage_newsletter_templates:
                    db_column: |
                        (
                            SELECT 1
                            FROM [[DB_PREFIX]]inline_images AS ntii
                            WHERE ntii.image_id = f.id
                              AND ntii.foreign_key_to = 'newsletter_template'
                            LIMIT 1
                        )
                    format: yes_or_no
                    hidden: true
            quick_filter_buttons:
                usage_newsletters:
                    parent: usage_dropdown
                    label: Attached to a newsletter
                    column: usage_newsletters
                    value: 1
                usage_newsletter_templates:
                    parent: usage_dropdown
                    label: Used by a newsletter template
                    column: usage_newsletter_templates
                    value: 1
            
            hidden_nav:
                newsletters_using_image:
                    link:
                        path: zenario__email_template_manager/panels/newsletters
                        refiner: newsletters_using_image
                newsletter_templates_using_image:
                    link:
                        path: zenario__email_template_manager/panels/newsletter_templates
                        refiner: newsletter_templates_using_image
            collection_buttons:
                add_to_newsletter:
                    class_name: zenario_common_features
                    priv: _PRIV_EDIT_NEWSLETTER
                    only_show_on_refiner: images_for_newsletter
                    css_class: add
                    label: Pick an image from the library
                    pick_items:
                        class_name: zenario_common_features
                        path: zenario__library/panels/image_library
                        target_path: zenario__library/panels/image_library
                        min_path: zenario__library/panels/image_library
                        disallow_refiners_looping_on_min_path: true
                        one_to_one_choose_phrase: Use
                        multiple_select: true
                        request:
                            add: 1
            item_buttons:
                remove_from_newsletter:
                    class_name: zenario_common_features
                    only_show_on_refiner: images_for_newsletter
                    priv: _PRIV_MANAGE_MEDIA
                    label: Detach from newsletter
                    multiple_select: true
                    hide_in_select_mode: true
                    disabled_if_for_any_selected_items: |
                        item.in_use_here
                    disabled_tooltip: |
                        You cannot detach an image that is in use.
                    ajax:
                        class_name: zenario_common_features
                        confirm:
                            message: |
                                Are you sure you wish to detach the image "[[filename]]" from this newsletter?
                            multiple_select_message: |
                                Are you sure you wish to detach these images from this newsletter?
                            button_message: Detach
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            remove: 1