# You must use a tab-size of 4 spaces to edit this file.
---
zenario__content:
    panels:
        chained:
            refiner_required: true
            key:
                cType: ""
                language: ""
                layoutId: ''
                equivId: ""
            enable_close_up_view: true
            hide_filter_warning: true
            db_items:
                table: >
                    [[DB_PREFIX]]content_items AS lec
                    CROSS JOIN [[DB_PREFIX]]languages AS l
                    LEFT JOIN [[DB_PREFIX]]translation_chains AS tc
                       ON lec.equiv_id = tc.equiv_id
                      AND lec.type = tc.type
                    LEFT JOIN [[DB_PREFIX]]content_items AS c
                       ON lec.equiv_id = c.equiv_id
                      AND lec.type = c.type
                      AND l.id = c.language_id
                    LEFT JOIN [[DB_PREFIX]]content_item_versions AS v
                       ON c.id = v.id
                      AND c.type = v.type
                      AND c.admin_version = v.version
                    LEFT JOIN [[DB_PREFIX]]menu_nodes AS mi
                       ON mi.target_loc = 'int'
                      AND mi.equiv_id = c.equiv_id
                      AND mi.content_type = c.type
                      AND mi.redundancy = 'primary'
                    LEFT JOIN [[DB_PREFIX]]menu_text AS mt
                       ON mt.menu_id = mi.id
                      AND mt.language_id = c.language_id
                    LEFT JOIN [[DB_PREFIX]]files AS f
                       ON f.id = v.file_id
                id_column: IFNULL(c.tag_id, l.id)
            refiners:
                zenario_trans__chained_in_link:
                    sql: >
                        lec.tag_id = [[REFINER__ZENARIO_TRANS__CHAINED_IN_LINK]]
                zenario_trans__chained_in_link__from_menu_node:
                    sql: >
                        lec.tag_id = (
                            SELECT CONCAT(`content_type`, '_', equiv_id)
                            FROM [[DB_PREFIX]]menu_nodes
                            WHERE id = [[REFINER__ZENARIO_TRANS__CHAINED_IN_LINK__FROM_MENU_NODE]]
                        )
            item:
                name: Content Item
                names: Content Items
                css_class: content_chained_double
            columns:
                tag:
                    title: ID/alias
                    width: large
                    searchable: true
                    db_column: c.tag_id
                    always_show: true
                    disallow_filtering: true
                equiv_id:
                    db_column: c.equiv_id
                id:
                    db_column: c.id
                type:
                    title: Content Type
                    db_column: c.type
                    format: enum
                language_id:
                    title: Language
                    show_by_default: true
                    db_column: l.id
                    format: language_english_name_with_id
                alias:
                    title: Alias
                    searchable: true
                    db_column: c.alias
                    hidden: true
                title:
                    title: Title
                    db_column: v.title
                    searchable: true
                description:
                    title: Description
                    db_column: v.description
                    searchable: true
                keywords:
                    title: Keywords
                    db_column: v.keywords
                    searchable: true
                file_id:
                    db_column: f.id
                checksum:
                    db_column: f.checksum
                mime_type:
                    db_column: f.mime_type
                filename:
                    title: Filename
                    db_column: v.filename
                    searchable: true
                    visible_if: zenarioO.tuix.key && (zenarioO.tuix.key.cType == 'document' || zenarioO.tuix.key.cType == 'audio')
                file_path:
                    db_column: f.path
                version:
                    title: Version
                    db_column: v.version
                    width: xsmall
                status:
                    title: Status
                    db_column: c.status
                    format: enum
                    values:
                        first_draft: First Draft
                        published_with_draft: Published with Draft
                        unlisted_with_draft: Published unlisted with Draft
                        hidden_with_draft: Hidden with Draft
                        trashed_with_draft: Trashed with Draft
                        published: Published
                        unlisted: Published unlisted
                        hidden: Hidden
                        trashed: Trashed
                admin_version_status:
                    db_column: c.status
                    format: enum
                    values:
                        first_draft: Draft
                        published_with_draft: Draft
                        unlisted_with_draft: Draft
                        hidden_with_draft: Draft
                        trashed_with_draft: Draft
                        published: Published
                        unlisted: Published unlisted
                        hidden: Hidden
                        trashed: Trashed
                visitor_version_status:
                    db_column: c.status
                    format: enum
                    values:
                        first_draft: '[Not published]'
                        published_with_draft: ""
                        unlisted_with_draft: '[Unlisted]'
                        hidden_with_draft: '[Hidden]'
                        trashed_with_draft: '[Trashed]'
                        published: ""
                        unlisted: '[Unlisted]'
                        hidden: '[Hidden]'
                        trashed: '[Trashed]'
                privacy:
                    db_column: tc.privacy
                    format: enum
                    values:
                        public:
                            label: 'Permissions: Public, visible to everyone'
                        logged_out:
                            label: 'Permissions: Public, only show to visitors who are NOT logged in'
                        logged_in:
                            label: 'Permissions: Private, only show to extranet users'
                        group_members:
                            label: 'Permissions: Private, only show to extranet users in group...'
                        in_smart_group:
                            label: 'Permissions: Private, only show to extranet users in smart group...'
                        logged_in_not_in_smart_group:
                            label: 'Permissions: Private, only show to extranet users NOT in smart group...'
                        with_role:
                            label: 'Permissions: Private, only show to extranet users with role...'
                        call_static_method:
                            label: "Permissions: Call a module's static method to decide"
                        send_signal:
                            label: 'Permissions: Send a signal to decide'
                at_location:
                    db_column: tc.at_location
                first_created_datetime:
                    title: Date/Time First Created
                    db_column: c.first_created_datetime
                    format: datetime
                created_datetime:
                    title: Latest Version Created
                    db_column: v.created_datetime
                    width: large
                    show_by_default: Yes
                creating_author_id:
                    db_column: v.creating_author_id
                last_modified_datetime:
                    title: Last Edited
                    db_column: v.last_modified_datetime
                    width: large
                    show_by_default: Yes
                last_author_id:
                    db_column: v.last_author_id
                published_datetime:
                    title: Date/Time Published
                    db_column: v.published_datetime
                    format: datetime
                publisher_id:
                    db_column: v.publisher_id
                release_date:
                    title: Release Date
                    db_column: v.release_date
                    format: date
                lock_owner_id:
                    db_column: c.lock_owner_id
                archives_exist:
                    width: medium
                    hidden: true
                    title: 'Archives exist?'
                    db_column: |
                        c.status != 'first_draft' AND (
                            SELECT 1
                            FROM [[DB_PREFIX]]content_item_versions AS pv
                            WHERE pv.id = c.id
                              AND pv.type = c.type
                              AND pv.version NOT IN (c.visitor_version, c.admin_version)
                            LIMIT 1
                        )
                    format: yes_or_no
                archived_versions_count:
                    hidden: true
                    db_column: |
                        (
                            SELECT COUNT(*)
                            FROM [[DB_PREFIX]]content_item_versions AS pv
                            WHERE pv.id = c.id
                              AND pv.type = c.type
                              AND pv.version NOT IN (c.visitor_version, c.admin_version)
                              AND c.status != 'first_draft'
                        )
                layout:
                    title: Layout
                    db_column: "CONCAT('L', IF (v.layout_id < 10, LPAD(CAST(v.layout_id AS CHAR), 2, '0'), CAST(v.layout_id AS CHAR)))"
                    show_by_default: true
                    searchable: true
                menu:
                    title: Menu Node
                    db_column: mt.name
                    show_by_default: true
                    item_link: menu_item
                menu_id:
                    db_column: mi.id
                scheduled_publish_datetime:
                    title: 'Scheduled publish date/time'
                    db_column: v.scheduled_publish_datetime
                    format: datetime
            default_sort_column: tag
            label_format_for_grid_view: |
                [[tag]]
                                Version [[version]]
            label_format_for_picked_items: '[[tag]] [[visitor_version_status]]'
            label_format_for_popouts: '[[tag]] Version [[version]] [[[admin_version_status]]]'
            default_sort_column: language_id
            collection_buttons:
                categories:
                    hidden: true
                    priv: _PRIV_EDIT_DRAFT
                    label: Change categories...
                    admin_box:
                        path: zenario_content_categories
            inline_buttons:
                view_frontend:
                    css_class: view_frontend
                    tooltip: View in Front-end window
                    frontend_link: true
                    visible_if: >
                        zenario.engToBoolean(item.frontend_link)
                inspect:
                    css_class: inspect
                    tooltip: View in floating box
                    popout:
                        iframe: true
                    visible_if: >
                        zenario.engToBoolean(item.frontend_link)
            item_buttons:
                settings:
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    label: Edit content item
                    admin_box:
                        path: zenario_content
                    without_columns_set:
                        ghost: true
                action_dropdown:
                    label: Actions
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                view_dropdown:
                    label: View
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                view_image:
                    parent: view_dropdown
                    label: View picture
                    popout:
                        href: 'zenario/file.php?usage=content&popout=1'
                        options:
                            type: image
                    with_columns_set:
                        has_picture: true
                    without_columns_set:
                        ghost: true
                download:
                    parent: view_dropdown
                    label: Download
                    hide_in_select_mode: true
                    ajax:
                        confirm:
                            message: 'Download the file "[[filename]]"?'
                            button_message: Download
                            cancel_button_message: Cancel
                            message_type: question
                            download: true
                        request:
                            download: 1
                    with_columns_set:
                        has_file: true
                    without_columns_set:
                        ghost: true
                s3_download:
                    parent: view_dropdown
                    hidden: true
                layout:
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    parent: action_dropdown
                    label: Change layout
                    multiple_select: true
                    admin_box:
                        path: zenario_content_layout
                    without_columns_set:
                        ghost: true
                alias:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    label: Edit alias
                    admin_box:
                        path: zenario_alias
                    without_columns_set:
                        ghost: true
                create_translation:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    label: |
                        Create a translation in [[lang_name]]
                    admin_box:
                        path: zenario_content
                        key:
                            translate: 1
                    with_columns_set:
                        zenario_trans__can_link: true
                        ghost: true
                add_existing_translation_to_chain:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    with_columns_set:
                        zenario_trans__can_link: true
                        ghost: true
                    label: Add an existing content item in [[lang_name]] to this chain
                    combine_items:
                        path: zenario__content/panels/content/refiners/add_translation_to_chain////
                        min_path: zenario__content/panels/content
                        max_path: zenario__content/panels/content
                        target_path: zenario__content/panels/content
                        disallow_refiners_looping_on_min_path: true
                        one_to_one_choose_phrase: Add to chain
                        disabled_if_for_all_selected_items: |
                            item.is_collision
                        ajax:
                            confirm:
                                message: |
                                    Add this content item to the translation chain?
                                button_message: Add
                                cancel_button_message: Cancel
                                message_type: warning
                            request:
                                add_existing_translation_to_chain: 1
                remove_translation_from_chain__identical_alias:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    with_columns_set:
                        has_identical_alias_to_other_items: true
                    without_columns_set:
                        ghost: true
                    label: Remove from translation chain
                    ajax:
                        confirm:
                            message: |
                                Are you sure you wish to remove this content item from this translation chain?
                                
                                It shares its alias with other content items, and the alias needs to be unique. So this action will also remove its alias.

                                Warning: after this action, you will see the translation chain of the content item in [[default_lang]], which will appear to be empty.
                            button_message: Remove
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            remove_translation_from_chain: 1
                remove_translation_from_chain__non_identical_alias:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    without_columns_set:
                        ghost: true
                        has_identical_alias_to_other_items: true
                    label: Remove from translation chain
                    ajax:
                        confirm:
                            message: |
                                Are you sure you wish to remove this content item from this translation chain?

                                Warning: after this action, you will see the translation chain of the content item in [[default_lang]], which will appear to be empty.
                            button_message: Remove
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            remove_translation_from_chain: 1
                hide:
                    parent: action_dropdown
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    hide_in_select_mode: true
                    label: Hide
                    multiple_select: true
                    with_columns_set:
                        hideable: true
                    without_columns_set:
                        ghost: true
                    ajax:
                        confirm:
                            message: |
                                This action will hide the item "[[tag]]".
                                
                                It will become invisible to visitors and any menu nodes linking to it will also be hidden. (You can show an item again by creating a draft and then re-publishing.)
                                
                                Are you sure you wish to proceed?
                            multiple_select_message: |
                                This action will hide the selected content items.
                                
                                They will become invisible to visitors and any menu nodes linking to them will also be hidden. (You can show an item again by creating a draft and then re-publishing.)
                                
                                Are you sure you wish to proceed?
                            button_message: Hide
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            hide: 1
                publish:
                    parent: action_dropdown
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    hide_in_select_mode: true
                    label: Publish
                    multiple_select: true
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id) &&
                        item.not_locked &&
                        (item.draft || item.status == 'hidden')
                    without_columns_set:
                        ghost: true
                    admin_box:
                        path: zenario_publish
                delete:
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                        && item.id != item.equiv_id
                    hide_in_select_mode: true
                    label: Delete draft
                    multiple_select: true
                    multiple_select_label: Delete drafts
                    with_columns_set:
                        draft: true
                        deletable: true
                        not_locked: true
                    without_columns_set:
                        ghost: true
                    admin_box:
                        path: zenario_delete_draft
                trash:
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                        && item.id != item.equiv_id
                    hide_in_select_mode: true
                    label: Trash
                    multiple_select: true
                    with_columns_set:
                        trashable: true
                    without_columns_set:
                        ghost: true
                    admin_box:
                        path: zenario_trash
                delete_archives:
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    visible_if_for_any_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                        && item.archives_exist
                    without_columns_set:
                        ghost: true
                    parent: action_dropdown
                    hide_in_select_mode: true
                    label: Delete archived versions
                    multiple_select: true
                    ajax:
                        confirm:
                            message: |
                                Are you sure you wish to delete [[archived_versions_count]] archived version(s) of "[[tag]]"?
                                
                                This will not affect any published versions or drafts, such as version [[version]] ([[admin_version_status]]).
                                
                                This cannot be undone.
                            multiple_select_message: |
                                Are you sure you wish to delete any archived versions of [[item_count]] content items?
                                
                                This will not affect any published versions or drafts.
                                
                                This cannot be undone.
                            button_message: Delete archived versions
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete_archives: 1
