# You must use a tab-size of 4 spaces to edit this file.
---
zenario__content:
    panels:
        content:
            key:
                cType: ''
                cId: ''
                language: ''
                layoutId: ''
            title: All content items, flat view

            notice:
                show: false
                type: information
                message: 'If only 1 content item appears, this means that another content item uses a duplicate in the visitor version, but not in the latest draft.'
            
            #panel_type: list_with_subheadings
            #subheading_column: release_date
            
            slidedown_view_microtemplate: zenario_slidedown_view_content_item
            no_items_message: No content items have been created.
            db_items:
                table: >
                    [[DB_PREFIX]]content_items AS c
                    INNER JOIN [[DB_PREFIX]]translation_chains AS tc
                       ON c.equiv_id = tc.equiv_id
                      AND c.type = tc.type
                    INNER 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
                    LEFT JOIN [[DB_PREFIX]]content_cache AS cc
                       ON v.id = cc.content_id
                      AND v.type = cc.content_type
                      AND v.version = cc.content_version
                id_column: c.tag_id
                custom_where_statement__not_trashed: |
                    WHERE c.status NOT IN ('trashed','deleted')
                
            quick_filter_buttons:
                language:
                    label: 'All languages'
                all_languages:
                    parent: language
                    label: 'All languages'
                    column: language_id
                    value: ''
                    remove_filter: true
                content_type:
                    label: 'All content types'
                all_content_types:
                    parent: content_type
                    ord: 1
                    label: 'All content types'
                    column: type
                    value: ''
                    remove_filter: true
                status:
                    label: 'Any status'
                any_status:
                    parent: status
                    label: 'Any status'
                    column: status
                    value: ''
                    remove_filter: true
                first_draft:
                    parent: status
                    label: "Drafts"
                    column: status
                    value: first_draft
                published_with_draft:
                    parent: status
                    label: "Published with draft"
                    column: status
                    value: published_with_draft
                unlisted_with_draft:
                    parent: status
                    label: "Published unlisted with draft"
                    column: status
                    value: unlisted_with_draft
                published:
                    parent: status
                    label: "Published"
                    column: status
                    value: published
                unlisted:
                    parent: status
                    label: "Published unlisted"
                    column: status
                    value: unlisted
                hidden:
                    parent: status
                    label: "Hidden"
                    column: status
                    value: hidden
                #All enabled content types will appear below.
                #The list of values is populated in the PHP class.
                    
                
            refiners:
                following_item_link:
                    exists: true
                filter_by_lang:
                    exists: true
                filter_exclude_documents:
                    sql: 'c.type != "document"'
                    exists: true
                content_type:
                    sql: 'c.type = [[REFINER__CONTENT_TYPE]]'
                language:
                    sql: 'c.language_id = [[REFINER__LANGUAGE]]'
                template:
                    sql: 'v.layout_id = [[REFINER__TEMPLATE]]'
                uses_access_code:
                    sql: 'v.access_code = [[REFINER__USES_ACCESS_CODE]]'
                add_translation_to_chain:
                    sql: ''
                    add_translation_to_chain: ''
                filter_by_language_and_content_type:
                    exists: true
                
                category:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]category_item_link AS cal
                           ON cal.category_id = [[REFINER__CATEGORY]]
                          AND cal.equiv_id = c.equiv_id
                          AND cal.content_type = v.type
                menu_children:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]menu_hierarchy AS mh
                           ON mh.ancestor_id = [[REFINER__MENU_CHILDREN]]
                          AND mh.child_id = mi.id
                          AND ([[REFINER__SHOW_LANGUAGE_CHOICE]] IS NULL OR c.language_id = [[REFINER__LANGUAGE]])
                special_pages:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]special_pages AS sp
                           ON sp.equiv_id = c.id
                          AND sp.content_type = c.type
                find_duplicates:
                    sql: |
                        (select count(*) FROM [[DB_PREFIX]]content_item_versions as vfcd INNER JOIN [[DB_PREFIX]]content_items AS cfcd 
                            ON cfcd.id = vfcd.id AND cfcd.type = vfcd.type
                            WHERE vfcd.file_id = f.id AND vfcd.version IN (cfcd.admin_version, cfcd.visitor_version)) > 1
                work_in_progress:
                    sql: |
                        c.status IN ('first_draft','published_with_draft','hidden_with_draft','trashed_with_draft','unlisted_with_draft')
                module_usage:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]layouts AS l
                           ON l.layout_id = v.layout_id
                        INNER JOIN [[DB_PREFIX]]layout_slot_link AS lsl
                           ON lsl.layout_id = l.layout_id
                        LEFT JOIN [[DB_PREFIX]]plugin_item_link AS piil
                           ON piil.content_id = v.id
                          AND piil.content_type = v.type
                          AND piil.content_version = v.version
                          AND piil.slot_name = lsl.slot_name
                    sql: 'piil.module_id = [[REFINER__MODULE_USAGE]]'
                module_effective_usage:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]layouts AS l
                           ON l.layout_id = v.layout_id
                        INNER JOIN [[DB_PREFIX]]layout_slot_link AS lsl
                           ON lsl.layout_id = l.layout_id
                        LEFT JOIN [[DB_PREFIX]]plugin_item_link AS piil
                           ON piil.content_id = v.id
                          AND piil.content_type = v.type
                          AND piil.content_version = v.version
                          AND piil.slot_name = lsl.slot_name
                        LEFT JOIN [[DB_PREFIX]]plugin_layout_link AS pitl
                           ON pitl.layout_id = l.layout_id
                          AND pitl.slot_name = lsl.slot_name
                    sql: 'IFNULL(piil.module_id, pitl.module_id) = [[REFINER__MODULE_EFFECTIVE_USAGE]]'
                plugin_instance_usage:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]layouts AS l
                           ON l.layout_id = v.layout_id
                        INNER JOIN [[DB_PREFIX]]layout_slot_link AS lsl
                           ON lsl.layout_id = l.layout_id
                        LEFT JOIN [[DB_PREFIX]]plugin_item_link AS piil
                           ON piil.content_id = v.id
                          AND piil.content_type = v.type
                          AND (piil.content_version = c.admin_version OR piil.content_version = c.visitor_version)
                          AND piil.slot_name = lsl.slot_name
                    sql: 'piil.instance_id = [[REFINER__PLUGIN_INSTANCE_USAGE]]'
                plugin_instance_effective_usage:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]layouts AS l
                           ON l.layout_id = v.layout_id
                        INNER JOIN [[DB_PREFIX]]layout_slot_link AS lsl
                           ON lsl.layout_id = l.layout_id
                        LEFT JOIN [[DB_PREFIX]]plugin_item_link AS piil
                           ON piil.content_id = v.id
                          AND piil.content_type = v.type
                          AND (piil.content_version = c.admin_version OR piil.content_version = c.visitor_version)
                          AND piil.slot_name = lsl.slot_name
                        LEFT JOIN [[DB_PREFIX]]plugin_layout_link AS pitl
                           ON pitl.layout_id = l.layout_id
                          AND pitl.slot_name = lsl.slot_name
                    sql: 'IFNULL(piil.instance_id, pitl.instance_id) = [[REFINER__PLUGIN_INSTANCE_EFFECTIVE_USAGE]]'
                content_items_using_form:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]plugin_settings AS ps
                           ON ps.foreign_key_to = 'user_form'
                          AND ps.foreign_key_id = [[REFINER_ID]]
                        INNER JOIN [[DB_PREFIX]]layouts AS l
                           ON l.layout_id = v.layout_id
                        INNER JOIN [[DB_PREFIX]]layout_slot_link AS lsl
                           ON lsl.layout_id = l.layout_id
                        LEFT JOIN [[DB_PREFIX]]plugin_item_link AS piil
                           ON piil.content_id = v.id
                          AND piil.content_type = v.type
                          AND (piil.content_version = c.admin_version OR piil.content_version = c.visitor_version)
                          AND piil.slot_name = lsl.slot_name
                        LEFT JOIN [[DB_PREFIX]]plugin_layout_link AS pitl
                           ON pitl.layout_id = l.layout_id
                          AND pitl.slot_name = lsl.slot_name
                    sql: 'IFNULL(piil.instance_id, pitl.instance_id) = ps.instance_id'
                trash:
                    sql: |
                        c.status = 'trashed'
                content_items_using_image:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]inline_images AS cii
                           ON cii.foreign_key_to = 'content'
                          AND cii.foreign_key_id = c.id
                          AND cii.foreign_key_char = v.type
                          AND cii.image_id = [[REFINER_ID]]
            item:
                name: Content item
                names: Content items
                css_class: content_published
            columns:
                tag:
                    ord: 1
                    title: ID/alias
                    width: large
                    searchable: true
                    ascii_only: true
                    db_column: c.tag_id
                    sort_column: c.type, c.id
                    sort_column_desc: c.type DESC, c.id DESC
                    always_show: true
                    disallow_filtering: true
                equiv_id:
                    db_column: c.equiv_id
                id:
                    ord: 2
                    db_column: c.id
                    align_right: true
                    width: xsmall
                type:
                    ord: 3
                    title: Content Type
                    db_column: c.type
                    format: enum
                    width: xsmall
                language_id:
                    ord: 4
                    title: Language
                    db_column: c.language_id
                    format: language_english_name_with_id
                alias:
                    ord: 5
                    title: Alias
                    searchable: true
                    db_column: c.alias
                    width: small
                    hidden: true
                title:
                    ord: 6
                    title: Title
                    db_column: v.title
                    searchable: true
                    width: large
                    show_by_default: true

                release_date:
                    ord: 7
                    title: Release date
                    db_column: v.release_date
                    format: date

                number_of_categories:
                    ord: 8
                    title: Number of categories
                   # show_by_default: false
                    #hidden: true
                menunodecounter:
                    ord: 9
                    title: menunodecounter
                    hidden: true
                description:
                    ord: 10
                    title: Description
                    db_column: v.description
                    searchable: true
                    length_limit: 250
                keywords:
                    ord: 11
                    title: Keywords
                    db_column: v.keywords
                    searchable: true
                    length_limit: 250
                
                file_id:
                    ord: 12
                    title: File ID
                    db_column: f.id
                    searchable: No
                    width: xsmall
                    align_right: true
                    #On "Find duplicates" panel, this column will always be shown.
                    #The logic is in the class file.
                    visible_if: zenarioO.tuix.key && (zenarioO.tuix.key.cType == 'document' || zenarioO.tuix.key.cType == 'audio')
                checksum:
                    ord: 12.1
                    title: Checksum (short)
                    db_column: f.short_checksum
                    #On "Find duplicates" panel, this column will always be shown.
                    #The logic is in the class file.
                    visible_if: zenarioO.tuix.key && (zenarioO.tuix.key.cType == 'document' || zenarioO.tuix.key.cType == 'audio')
                filename:
                    ord: 12.2
                    title: Filename
                    db_column: v.filename
                    searchable: true
                    width: large
                    always_show: true
                    visible_if: zenarioO.tuix.key && (zenarioO.tuix.key.cType == 'document' || zenarioO.tuix.key.cType == 'audio')
                file_size:
                    ord: 12.3
                    title: File size
                    db_column: f.size
                    format: filesize
                    searchable: No
                    visible_if: zenarioO.tuix.key && (zenarioO.tuix.key.cType == 'document' || zenarioO.tuix.key.cType == 'audio')
                file_path:
                    db_column: f.path
                s3_filename:
                    ord: 12.4
                    title: S3 filename
                    db_column: v.s3_filename
                    searchable: No
                    width: large
                    visible_if: zenarioO.tuix.key && (zenarioO.tuix.key.cType == 'document' || zenarioO.tuix.key.cType == 'audio')
                s3_file_id:
                    ord: 12.5
                    title: S3 File ID
                    db_column: v.s3_file_id
                    searchable: No
                    hidden: true
                mime_type:
                    db_column: f.mime_type

                version:
                    ord: 13
                    title: Version
                    db_column: v.version
                    width: xsmall
                status:
                    ord: 14
                    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:
                    ord: 15
                    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
                        hidden: Hidden
                        trashed: Trashed
                visitor_version_status:
                    ord: 16
                    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
                layout_status:
                    db_column: lay.status
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]layouts AS lay
                           ON lay.layout_id = v.layout_id
                    hidden: true
                first_created_datetime:
                    ord: 18
                    title: First draft created
                    db_column: c.first_created_datetime
                    format: datetime
                created_datetime:
                    ord: 19
                    title: Latest draft created
                    db_column: v.created_datetime
                    show_by_default: No
                    width: large
                concealed_datetime:
                    ord: 20
                    title: Trashed
                    db_column: v.concealed_datetime
                    format: datetime
                    show_by_default: No
                creating_author_id:
                    db_column: v.creating_author_id
                last_modified_datetime:
                    ord: 21
                    title: Last edited
                    db_column: v.last_modified_datetime
                    show_by_default: Yes
                    width: large
                last_modified_by_admin:
                    ord: 22
                    title: Last edited by
                    width: large
                    show_by_default: Yes
                last_author_id:
                    db_column: v.last_author_id
                published_datetime:
                    ord: 23
                    title: Published
                    db_column: v.published_datetime
                    format: datetime
                publisher_id:
                    db_column: v.publisher_id
                word_count:
                    ord: 25
                    title: Page word count
                    sortable: true
                    db_column: >
                        IFNULL(cc.text_wordcount, 0)
                    align_right: true
                    width: xsmall
                    show_by_default: true
                    tooltip: "Word count of version controlled plugins on the content item."
                attachment_word_count:
                    ord: 26
                    title: Attachment word count
                    sortable: true
                    db_column: >
                        IFNULL(cc.extract_wordcount, 0)
                    align_right: true
                    width: xsmall
                    show_by_default: true
                    tooltip: "Word count of the attachment on the content item."
                accesses:
                    ord: 27
                    title: User accesses
                    sortable: true
                    table_join: |
                        LEFT JOIN [[DB_PREFIX]]user_content_accesslog AS uca
                            ON v.id = uca.content_id
                           AND v.type = uca.content_type
                           AND v.version = uca.content_version
                    db_column: >
                        IF(COUNT(uca.user_id) > 0, COUNT(uca.user_id), 0)
                    align_right: true
                    width: xsmall
                    show_by_default: false
                lock_owner_id:
                    db_column: c.lock_owner_id
                lock_owner_name:
                writer_name:
                    ord: 28
                    title: Writer name
                    table_join: |
                        LEFT JOIN [[DB_PREFIX]]writer_profiles AS wp
                            ON wp.id = v.writer_id
                    db_column: CONCAT(wp.first_name, " ", wp.last_name)
                    searchable: true
                archives_exist:
                    ord: 29
                    hidden: true
                    width: medium
                    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
                zenario_trans__links:
                    ord: 30
                    title: Translations
                    align_right: true
                    show_by_default: true
                sync_assist:
                    db_column: |
                        (
                            SELECT COUNT(DISTINCT ci_sa.language_id)
                            FROM [[DB_PREFIX]]content_items AS ci_sa
                            WHERE ci_sa.equiv_id = c.equiv_id
                              AND ci_sa.type = c.type
                              AND ci_sa.language_id IN ([[ZENARIO_SYNC_ASSIST_LANGS]])
                        )
                layout:
                    ord: 31
                    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
                    width: xsmall
                    hidden: true
                layout_id:
                    ord: 32
                    db_column: v.layout_id
                    filter_format: enum
                    values:
                        - L01
                        - L02
                        #...
                menu:
                    ord: 33
                    title: Menu node
                    db_column: mt.name
                    show_by_default: true
                    item_link: menu_item
                    disallow_sorting: true
                menu_id:
                    db_column: mi.id
                scheduled_publish_datetime:
                    ord: 35
                    title: 'Scheduled publish date/time'
                    db_column: v.scheduled_publish_datetime
                    format: datetime
                pinned:
                    ord: 36
                    db_column: v.pinned
                    hidden: true
                
                head_html:
                    db_column: v.head_html
                    hidden: true
                foot_html:
                    db_column: v.foot_html
                    hidden: true
                
                    
            default_sort_column: tag
            default_sort_desc: true
            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: first_created_datetime
            collection_buttons:
                new_dropdown:
                    hide_when_children_are_not_visible: true
                    css_class: zenario_create_a_new
                    label: New
                create:
                    priv: _PRIV_EDIT_DRAFT
                    hide_in_select_mode: true
                    hide_on_filter: true
                    css_class: zenario_create_a_new
                    admin_box:
                        path: zenario_content
                        key:
                            create_from_content_panel: 1
                    ord: 1
                    #This button will be hidden on many refiners.
                    #Controlled in the PHP code.
                delete_trashed_items:
                    priv: _PRIV_DELETE_TRASHED_CONTENT_ITEMS
                    hide_in_select_mode: true
                    hide_when_no_search_results: true
                    only_show_on_refiner: trash
                    label: Empty trash
                    ajax:
                        confirm:
                            message: >
                                Empty the trash?
                                
                                This will permanently delete all content items in the trash. This cannot be undone.
                            button_message: Delete
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete_trashed_items: 1
                diagnostics_dropdown:
                    label: Diagnostics
                    hide_when_children_are_not_visible: true
    
                content_find_duplicates:
                    parent: diagnostics_dropdown
                    hide_in_select_mode: true
                    hide_when_no_search_results: true
                    hide_on_filter: true
                    visible_if: |
                        zenarioO.tuix.key &&
                        zenarioO.tuix.key.cType == 'document'
                    label: Find items with duplicate file attachments
                    link:
                        branch: true
                        path: zenario__content/panels/content
                        refiner: find_duplicates
                export:
                    hide_when_no_search_results: true
                    hide_in_select_mode: true
                    visible_if: |
                        !zenarioO.filteredView
                    label: Export
                    admin_box:
                        path: zenario_export_content_items
                        key:
                            type: ''
                        pass_matched_ids: true
                export_filtered_list:
                    hide_when_no_search_results: true
                    hide_in_select_mode: true
                    visible_if: |
                        zenarioO.filteredView
                    label: Export filtered list
                    admin_box:
                        path: zenario_export_content_items
                        key:
                            type: ''
                            wasFiltered: true
                        pass_matched_ids: true
                
                settings_dropdown:
                    css_class: organizer_settings_dropdown
                    hide_when_children_are_not_visible: true
                    label: ⚙
                
                settings_ctype:
                    priv: _PRIV_EDIT_CONTENT_TYPE
                    parent: settings_dropdown
                    hide_in_select_mode: true
                    hidden: true
                    hide_on_refiner: find_duplicates
                    label: ''
                    admin_box:
                        path: zenario_content_type_details
                        key:
                            id: ''
                            openedFromCollectionButton: 1
                            
                settings_ctype_list:
                    priv: _PRIV_RUN_MODULE
                    parent: settings_dropdown
                    hide_in_select_mode: true
                    hide_on_refiner: &hide_settings_on_these_refiners
                        following_item_link: true
                        filter_by_lang: true
                        #content_type: true
                        #language: true
                        #template: true
                        category: true
                        menu_children: true
                        #special_pages: true
                        find_duplicates: true
                        #work_in_progress: true
                        module_usage: true
                        module_effective_usage: true
                        plugin_instance_usage: true
                        plugin_instance_effective_usage: true
                        content_items_using_form: true
                        trash: true
                        content_items_using_image: true
                        zenario__locations__create_content: true
                        group_members: true
                        form_id: true
                    label: Enable more content types
                    link:
                        path: zenario__modules/panels/modules~-zenario_ctype
                
                help:
                    label: Help
                    hide_on_refiner: true
                    help:
                        message: >
                            Every page of your website is stored as a "content item".
                            This panel shows all of the content items of your site in a
                            list view.
                help_trash:
                    label: Help
                    only_show_on_refiner: trash
                    help:
                        message: >
                            This panel shows all of the content items that have been trashed.
                            To restore a content item, you need to re-draft and then publish it.
                    
                    
            inline_buttons:
                no_menu_linked:
                    css_class: zenario_not_at_menu
                    tooltip: "This content item is not in the menu"
                    visible_if: >
                        item.menunodecounter == 0
                menu_text_missing:
                    css_class: zenario_not_at_menu
                    tooltip: "This content item is in the menu, but the menu text is missing"
                    visible_if: >
                        item.menunodecounter == 'menu_node_text_missing'
                one_menu_linked:
                    css_class: zenario_at_menu_unique
                    tooltip: "This content item is in the menu"
                    visible_if: >
                        item.menunodecounter == 1
                one_or_more_menu_linked:
                    css_class: zenario_at_menu_primary
                    tooltip: "This content item has more than one menu node linking to it"
                    visible_if: >
                        item.menunodecounter != 'menu_node_text_missing' && item.menunodecounter > 1
                        
                layout:
                    css_class: zenario_layout_inline_button
                    label: |
                        [[layout]]
                    admin_box:
                        priv: _PRIV_EDIT_DRAFT
                        path: zenario_content_layout
                    visible_if: |
                        zenarioA.checkSpecificPerms(id)                        
                cant_change_layout:
                    css_class: zenario_layout_inline_button
                    label: |
                        [[layout]]
                    visible_if: |
                        !zenarioA.checkSpecificPerms(id)
                privacy:
                    css_class: privacy_inline_button
                    tooltip: "[[privacy]]"
                    admin_box:
                        path: zenario_content_privacy
                pinned:
                    ord: privacy.1
                    css_class: pinned
                    tooltip: "This content item is pinned"
                    admin_box:
                        path: zenario_content
                    visible_if: item.pinned == 1
                not_pinned:
                    ord: privacy.1
                    css_class: not_pinned
                    tooltip: "This content item is not pinned"
                    admin_box:
                        path: zenario_content
                    visible_if: item.pinned == 0
                no_categories:
                    ord: privacy.2
                    css_class: no_categories
                    tooltip: "Content item is not in any categories"
                    admin_box:
                        path: zenario_content_categories
                    visible_if: >
                        item.number_of_categories == 0
                one_category:
                    ord: privacy.2
                    css_class: one_or_more_categories
                    tooltip: "Content item is in one category"
                    admin_box:
                        path: zenario_content_categories
                    visible_if: >
                        item.number_of_categories == 1
                multiple_categories:
                    ord: privacy.2
                    css_class: one_or_more_categories
                    tooltip: "Content item is in [[number_of_categories]] categories"
                    admin_box:
                        path: zenario_content_categories
                    visible_if: >
                        item.number_of_categories > 1
                view_frontend:
                    css_class: view_frontend
                    tooltip: Go to content item in front-end window
                    frontend_link: true
                    visible_if: >
                        zenario.engToBoolean(item.frontend_link)
                inspect:
                    css_class: inspect
                    tooltip: Quick-view in floating box
                    popout:
                        iframe: true
                    visible_if: >
                        zenario.engToBoolean(item.frontend_link)
            
            item_buttons:
                settings:
                    priv: _PRIV_EDIT_DRAFT
                    multiple_select: true
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    label: Edit content item
                    multiple_select_label: Edit content items
                    admin_box:
                        path: zenario_content
                    without_columns_set:
                        ghost: true

                property_dropdown:
                    label: More properties
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                
                alias:
                    parent: property_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
                        
                head__populated:
                    parent: property_dropdown
                    priv: _PRIV_MANAGE_ITEM_SLOT
                    label: HTML in head of page
                    tooltip: 'Populated'
                    admin_box:
                        path: zenario_head_foot_slot
                        key:
                            mode: head
                            level: item
                    visible_if: item.head_html
                head__empty:
                    parent: property_dropdown
                    priv: _PRIV_MANAGE_ITEM_SLOT
                    label: HTML in head of page
                    tooltip: 'Empty'
                    admin_box:
                        path: zenario_head_foot_slot
                        key:
                            mode: head
                            level: item
                    visible_if: !item.head_html
                foot__populated:
                    copy_of: head__populated
                    label: HTML at foot of page
                    tooltip: 'Populated'
                    admin_box:
                        key:
                            mode: foot
                    visible_if: item.foot_html
                foot__empty:
                    copy_of: head__empty
                    label: HTML at foot of page
                    tooltip: 'Empty'
                    admin_box:
                        key:
                            mode: foot
                    visible_if: !item.foot_html
                                    
                layout:
                    priv: _PRIV_EDIT_DRAFT
                    visible_if: |
                        ((window.__selectedType = undefined) || true)
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                        && (window.__selectedType === item.type || window.__selectedType === undefined)
                        && (window.__selectedType = item.type)
                    # Note - a little bit of hacky code here, as we don't have proper support for a feature.
                    # What I'm trying to do is make sure that the button is only shown when the content type
                    # of all of the selected items is the same.
                    parent: property_dropdown
                    label: Change layout
                    multiple_select: true
                    admin_box:
                        path: zenario_content_layout
                    without_columns_set:
                        ghost: true
                    
                ###############################################
                ### Dropdown for publishing and (un)locking ###
                ###############################################
                publishing_dropdown:
                    label: Publishing
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                publish:
                    parent: publishing_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.publication_time &&
                        (item.draft || item.status == 'hidden')
                    without_columns_set:
                        ghost: true
                    admin_box:
                        path: zenario_publish
                change_scheduled_publishing:
                    parent: publishing_dropdown
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    hide_in_select_mode: true
                    label: Change or cancel scheduled publishing...
                    multiple_select: true
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id) &&
                        item.publication_time
                    without_columns_set:
                        ghost: true
                    admin_box:
                        path: zenario_publish
                lock:
                    priv: _PRIV_EDIT_DRAFT
                    parent: publishing_dropdown
                    visible_if_for_all_selected_items: >
                        ('' + item.status).match(/draft/)
                        && item.lock_owner_id == 0
                        && zenarioA.checkSpecificPerms(id)
                    label: Lock this draft
                    ajax:
                        confirm:
                            message: |
                                Lock this draft?
                                
                                No other administrator will be able to edit it until it is unlocked, published or deleted.
                            button_message: Lock
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            lock: 1
                locked:
                    parent: publishing_dropdown
                    visible_if_for_all_selected_items: >
                        ('' + item.status).match(/draft/)
                        && item.lock_owner_id != 0
                        && item.lock_owner_id != zenario.adminId
                    label: Locked
                    css_class: zenario_item_locked
                locked_by_you:
                    parent: publishing_dropdown
                    visible_if_for_all_selected_items: >
                        ('' + item.status).match(/draft/)
                        && item.lock_owner_id != 0
                        && item.lock_owner_id == zenario.adminId
                    label: LOCKED by you
                    css_class: zenario_item_locked
                unlock:
                    priv: _PRIV_EDIT_DRAFT
                    parent: publishing_dropdown
                    visible_if_for_all_selected_items: >
                        ('' + item.status).match(/draft/)
                        && item.lock_owner_id != 0
                        && item.lock_owner_id == zenario.adminId
                        && zenarioA.checkSpecificPerms(id)
                    label: Unlock
                    tooltip: This content item is locked by you
                    ajax:
                        confirm:
                            #message: |
                                #Are you sure that you wish to unlock this content item?
                                #
                                #Any administrator who has authoring permission will be able to make changes to it.
                            button_message: Unlock
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            unlock: 1
                force_open:
                    priv: _PRIV_CANCEL_CHECKOUT
                    parent: publishing_dropdown
                    visible_if_for_all_selected_items: >
                        ('' + item.status).match(/draft/)
                        && item.lock_owner_id != 0
                        && item.lock_owner_id != zenario.adminId
                    label: Force unlock
                    tooltip: This content item is locked by another administrator
                    ajax:
                        confirm:
                            # This message is set dynamically
                            #message: |
                                #Are you sure that you wish to force-unlock on this content item?
                                #
                                #Any administrator who has authoring permission will be able to make changes to it.
                            button_message: Cancel lock
                            cancel_button_message: Leave it alone
                            message_type: warning
                        request:
                            unlock: 1
                
                ######################################################
                ### End of dropdown for publishing and (un)locking ###
                ######################################################
                    
                
                action_dropdown:
                    label: Actions
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                category_dropdown:
                    label: Categories
                    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_frontend:
                    parent: view_dropdown
                    label: Content item in front-end
                    frontend_link: true
                inspect:
                    parent: view_dropdown
                    label: Quick-view in floating box
                    popout:
                        iframe: true
                    visible_if: >
                        zenario.engToBoolean(item.frontend_link)
                
                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
                    label: Download S3 file
                    hide_in_select_mode: true
                    hidden: true
                    ajax:
                        confirm:
                            message: 'Download the file "[[s3_filename]]" from S3?'
                            button_message: Download
                            cancel_button_message: Cancel
                            message_type: question
                            download: true
                        request:
                            s3_download: 1
                    with_columns_set:
                        has_s3file: true
                    without_columns_set:
                        ghost: true
                view_image:
                    parent: view_dropdown
                    label: View picture
                    tooltip: 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
                images:
                    parent: view_dropdown
                    label: Attached images
                    link:
                        path: zenario__library/panels/image_library
                        branch: true
                        refiner: images_for_content_item
                    without_columns_set:
                        no_images: true
                        ghost: true
                zenario_trans__view:
                    parent: view_dropdown
                    hide_in_select_mode: true
                    label: Translations
                    link:
                        path: zenario__content/panels/chained
                        branch: true
                        refiner: zenario_trans__chained_in_link
                view_slots:
                    priv: _PRIV_VIEW_SLOT
                    parent: view_dropdown
                    label: Slots and plugins on this content item
                    link:
                        path: zenario__content/panels/slots
                        branch: true
                        refiner: content_item
                
                categories_add:
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    parent: category_dropdown
                    label: Add to categories
                    multiple_select_only: true
                    multiple_select: true
                    admin_box:
                        path: zenario_content_categories_add
                    without_columns_set:
                        ghost: true
                    disabled_if_for_any_selected_items: |
                        !zenarioO.tuix.custom__content_types_with_categories[item.type]
                    disabled_tooltip: Categories are not enabled for this content type
                categories:
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    parent: category_dropdown
                    label: Change categories
                    admin_box:
                        path: zenario_content_categories
                    without_columns_set:
                        ghost: true
                    disabled_if_for_any_selected_items: |
                        !zenarioO.tuix.custom__content_types_with_categories[item.type]
                    disabled_tooltip: Categories are not enabled for this content type
                categories_remove:
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    parent: category_dropdown
                    label: Remove from categories
                    multiple_select_only: true
                    multiple_select: true
                    admin_box:
                        path: zenario_content_categories_remove
                    without_columns_set:
                        ghost: true
                    disabled_if_for_any_selected_items: |
                        !zenarioO.tuix.custom__content_types_with_categories[item.type]
                    disabled_tooltip: Categories are not enabled for this content type
                
                copy_to_hierarchical_documents:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DOCUMENTS
                    hide_in_select_mode: true
                    multiple_select: true
                    label: Copy to hierarchical documents
                    admin_box:
                        path: zenario_copy_to_hierarchical_documents
                    visible_if_for_all_selected_items: (item.type == 'document') && (item.status != 'hidden')
                
                quick_add_to_menu:
                    parent: action_dropdown
                    priv: _PRIV_ADD_MENU_ITEM
                    hide_in_select_mode: true
                    label: Attach content item to menu
                    multiple_select: No
                    combine_items:
                        path: zenario__menu/panels/menu_position/refiners/create////
                        min_path: zenario__menu/panels/menu_position
                        target_path: zenario__menu/panels/menu_position
                        disallow_refiners_looping_on_min_path: true
                        one_to_one_choose_phrase: Create menu node
                        visible_if_for_all_selected_items: >
                            zenario.engToBoolean(item.menu_id) || zenario.engToBoolean(item.is_dummy_child)
                        request:
                            mass_add_to_menu: 1
                    with_columns_set:
                        unlinked: true
                    without_columns_set:
                        ghost: true
                        hidden: true
                mass_add_to_menu:
                    parent: action_dropdown
                    priv: _PRIV_ADD_MENU_ITEM
                    hide_in_select_mode: true
                    label: Attach items to menu
                    multiple_select: true
                    multiple_select_only: true
                    combine_items:
                        path: zenario__menu/panels/menu_position/refiners/create////
                        min_path: zenario__menu/panels/menu_position
                        target_path: zenario__menu/panels/menu_position
                        disallow_refiners_looping_on_min_path: true
                        many_to_one_choose_phrase: Create menu nodes
                        visible_if_for_all_selected_items: >
                            zenario.engToBoolean(item.menu_id) || zenario.engToBoolean(item.is_dummy_child)
                        request:
                            mass_add_to_menu: 1
                    with_columns_set:
                        unlinked: true
                    without_columns_set:
                        ghost: true
                        hidden: true
                duplicate:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    # For limited admins: if the create button is not enabled, don't enable
                    # the duplicate button either
                    visible_if: |
                        !zenarioA.adminHasSpecificPerms
                        || zenarioO.tuix.collection_buttons.create
                    label: Duplicate
                    admin_box:
                        path: zenario_content
                        key:
                            duplicate: 1
                    with_columns_set:
                        has_duplicate: true        
                    without_columns_set:
                        ghost: true
                
                
                create_draft_by_copying:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    with_columns_set:
                        not_locked: true
                        has_document: true
                    without_columns_set:
                        draft: true
                    label: Copy from other...
                    combine_items:
                        path: zenario__content/panels/content/refiners/filter_exclude_documents////
                        min_path: zenario__content/panels/languages
                        max_path: zenario__content/panels/content
                        target_path: zenario__content/panels/content
                        one_to_one_choose_phrase: Copy from selected
                        ajax:
                            confirm:
                                message: |
                                    Are you sure you wish to copy the contents of the selected content item?
                                
                                    This will create a draft of the current content item with the contents of the one you selected.
                                button_message: Create draft and copy
                                cancel_button_message: Cancel
                                message_type: warning
                            request:
                                create_draft_by_copying: 1
                create_draft_by_overwriting:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    with_columns_set:
                        draft: true
                        not_locked: true
                        has_document: true
                    label: Copy from other...
                    combine_items:
                        path: zenario__content/panels/content/refiners/filter_exclude_documents////
                        min_path: zenario__content/panels/languages
                        max_path: zenario__content/panels/content
                        target_path: zenario__content/panels/content
                        one_to_one_choose_phrase: Copy from selected
                        ajax:
                            confirm:
                                message: |
                                    Are you sure you wish to copy the contents of the selected content item over the current draft?
                                
                                    This cannot be undone.
                                button_message: Copy and overwrite
                                cancel_button_message: Cancel
                                message_type: warning
                            request:
                                create_draft_by_copying: 1
                staging_mode:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if: |
                        zenarioA.siteSettings.enable_staging_mode
                        && item.draft
                        && item.privacy == 'public'
                    label: 'Staging mode'
                    admin_box:
                        path: zenario_content_staging_mode
                create_draft_by_overwriting:
                    parent: action_dropdown
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    with_columns_set:
                        draft: true
                        not_locked: true
                        has_document: true
                    label: Copy from other...
                    combine_items:
                        path: zenario__content/panels/content/refiners/filter_exclude_documents////
                        min_path: zenario__content/panels/languages
                        max_path: zenario__content/panels/content
                        target_path: zenario__content/panels/content
                        one_to_one_choose_phrase: Copy from selected
                        ajax:
                            confirm:
                                message: |
                                    Are you sure you wish to copy the contents of the selected content item over the current draft?
                                
                                    This cannot be undone.
                                button_message: Copy and overwrite
                                cancel_button_message: Cancel
                                message_type: warning
                            request:
                                create_draft_by_copying: 1
                
                delete_archives:
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    visible_if_for_any_selected_items: |
                        item.archives_exist &&
                        zenarioA.checkSpecificPerms(id)
                    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 any archived versions of "[[tag]]"?
                                
                                This cannot be undone.
                            multiple_select_message: |
                                Are you sure you wish to delete any archived versions of [[item_count]] content items?
                                
                                This cannot be undone.
                            button_message: Delete archived versions
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete_archives: 1
                delete:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(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
                delete_media_content_item:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                        && (item.type == 'audio' || item.type == 'document' || item.type == 'picture' || item.type == 'video')
                        && item.status != 'first_draft'
                    hide_in_select_mode: true
                    label: Delete content item
                    multiple_select: true
                    multiple_select_label: Delete content items
                    with_columns_set:
                        deletable: true
                        not_locked: true
                    without_columns_set:
                        ghost: true
                    admin_box:
                        path: zenario_delete_media_content_item
                delist:
                    parent: action_dropdown
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    hide_in_select_mode: true
                    label: Make unlisted
                    multiple_select: true
                    multiple_select_label: Make selected content items unlisted
                    with_columns_set:
                        delistable: true
                    without_columns_set:
                        ghost: true
                    ajax:
                        confirm:
                            html: true
                            message: |
                                <p>Are you sure you want to make this content item unlisted?</p>
                                <p>Unlisted content items:</p>
                                <ul><li>
                                    Are not shown in menus
                                </li><li>
                                    Are not shown in content summary lists
                                </li><li>
                                    Are not displayed in search plugins
                                </li><li>
                                    Are not displayed in site-maps
                                </li><li>
                                    Can still be reached by links from banners, WYSIWYG areas or Raw HTML snippets
                                </li></ul>
                            multiple_select_message: |
                                <p>Are you sure you want to make [[item_count]] content items unlisted?</p>
                                <p>Unlisted content items:</p>
                                <ul><li>
                                    Are not shown in menus
                                </li><li>
                                    Are not shown in content summary lists
                                </li><li>
                                    Are not displayed in search plugins
                                </li><li>
                                    Are not displayed in site-maps
                                </li><li>
                                    Can still be reached by links from banners, WYSIWYG areas or Raw HTML snippets
                                </li></ul>
                            button_message: Make unlisted
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delist: 1
                relist:
                    parent: action_dropdown
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    hide_in_select_mode: true
                    label: Make listed
                    multiple_select: true
                    multiple_select_label: Make selected content items listed
                    with_columns_set:
                        relistable: true
                    without_columns_set:
                        ghost: true
                    ajax:
                        confirm:
                            html: true
                            message: |
                                <p>Are you sure you want to make this content item listed?</p>
                                <p>When listed, the content item will appear in any menu/content summary list/search plugins as normal.</p>
                            multiple_select_message: |
                                <p>Are you sure you want to make [[item_count]] content items listed?</p>
                                <p>When listed, the content items will appear in any menu/content summary list/search plugins as normal.</p>
                            button_message: Make listed
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            relist: 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
                    multiple_select_label: Hide selected content items
                    with_columns_set:
                        hideable: true
                    without_columns_set:
                        ghost: true
                    admin_box:
                        path: zenario_hide
                trash:
                    parent: action_dropdown
                    priv: _PRIV_PUBLISH_CONTENT_ITEM
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                    hide_in_select_mode: true
                    label: Trash
                    multiple_select_label: Trash selected content items
                    multiple_select: true
                    with_columns_set:
                        trashable: true
                    without_columns_set:
                        ghost: true
                    admin_box:
                        path: zenario_trash
                redraft:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_DRAFT
                    label: Re-draft
                    css_class: create label_to_the_left
                    multiple_select: true
                    visible_if_for_all_selected_items: |
                        zenarioA.checkSpecificPerms(id)
                        && (item.status == 'hidden' || item.status == 'trashed')
                    tooltip: >
                        Re-draft this content item|This will create a new draft of
                        this content item, which will be available to visitors if
                        you Publish it.
                    ajax:
                        confirm:
                            message: |
                                Do you wish to re-draft "[[tag]]"? This will create
                                a new draft of this content item, which will be available to
                                visitors if you publish it.
                            multiple_select_message: |
                                Do you wish do re-draft these content items? This will create a new draft for each content item, which will be avaliable to visitors if you publish them.
                            button_message: Re-draft
                            cancel_button_message: Cancel
                            message_type: question
                        request:
                            create_draft: 1