# You must use a tab-size of 4 spaces to edit this file.
---
zenario__layouts:
    panels:
        layouts: &panel
            title: Available layouts
            panel_type: multi_line_list
            css_class: two_line_list_panel
            use_tall_rows: true
            two_line_list: true
            no_items_message: No layouts have been created
            grid_view_microtemplate: zenario_grid_view_layout
            db_items:
                table: >
                    [[DB_PREFIX]]layouts AS l
                    LEFT JOIN [[DB_PREFIX]]content_types AS ct
                       ON l.layout_id = ct.default_layout_id
                    LEFT JOIN [[DB_PREFIX]]skins AS s
                    ON s.id = l.skin_id
                id_column: l.layout_id
                where_statement: "WHERE (l.status IS NULL OR l.status = 'active')"
                custom_where_statement__archived: "WHERE l.status = 'suspended'"
                custom_where_statement__typeahead_search: "WHERE l.status = 'active'"
            columns:
                code:
                    title: ID
                    format: id
                    always_show: true
                    db_column: l.layout_id
                    sort_column: l.layout_id
                    searchable: true
                    chop_prefix_from_search: L
                    width: xxsmall
                name:
                    title: Details
                    always_show: true
                    db_column: l.name
                    searchable: true
                    width: xxlarge
                    html: true
                    css_class: label_column
                default_used:
                    title: Default usage
                    always_show: true
                    width: xlarge
                    html: true
                    parent: name
                summary:
                    title: Summary
                    always_show: true
                    width: xlarge
                    html: true
                skin_name:
                    parent: summary
                    title: Skin
                    db_column: IF(s.display_name != '', CONCAT(s.display_name, ' ', 'skin'), '')
                    searchable: true
                    always_show: true
                
                default:
                    #title: Default layout for content type
                    db_column: ct.default_layout_id IS NOT NULL
                    format: yes_or_no
                delete_disabled:
                    title: Default disabled
                    format: yes_or_no
                    hidden: true
                archived:
                    format: yes_or_no
                    db_column: >
                        l.status = 'suspended'
                status:
                    db_column: l.status
                    title: Status
                    hidden: true
                    format: enum
                    values:
                        active: Available
                        active_default: Default layout for content type
                        suspended: Retired
                    width: large
                cols:
                    db_column: l.cols
                min_width:
                    db_column: l.min_width
                max_width:
                    db_column: l.max_width
                fluid:
                    db_column: l.fluid
                responsive:
                    db_column: l.responsive
                header_and_footer:
                    db_column: l.header_and_footer
                content_type:
                    title: Content type
                    db_column: l.content_type
                    always_show: true
                    format: enum
                    searchable: true
                    ascii_only: true
                    width: small
                where_used:
                    title: Usage
                    always_show: true
                    width: xlarge
                    html: true
                grid_name: {}
                usage_status:
                    format: enum
                    values:
                        active: Available
                        suspended: Retired
                
            default_sort_column: name
            label_format_for_grid_view: '[[code]] [[name]]'
            label_format_for_popouts: '[[code]] [[name]]'
            label_format_for_picked_items: '[[code]] [[name]]'
            bold_columns_in_list_view: '[[code]]'
            refiners:
                content_type:
                    sql: '`content_type` = [[REFINER_ID]]'
                module_usage:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]plugin_layout_link AS pitl
                           ON pitl.module_id = [[REFINER__MODULE_USAGE]]
                          AND pitl.layout_id = l.layout_id
                plugin_instance_usage:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]plugin_layout_link AS pitl
                           ON pitl.instance_id = [[REFINER__PLUGIN_INSTANCE_USAGE]]
                          AND pitl.layout_id = l.layout_id
                layouts_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]]plugin_layout_link AS pitl
                           ON pitl.instance_id = ps.instance_id
                          AND pitl.layout_id = l.layout_id
                archived: {}
            item:
                css_class: template
            collection_buttons:
                create:
                    priv: _PRIV_EDIT_TEMPLATE
                    hide_in_select_mode: true
                    css_class: zenario_create_a_new
                    hide_on_filter: true
                    label: Create a layout with Gridmaker
                    hide_on_refiner:
                        module_usage: true
                        plugin_instance_usage: true
                    popout:
                        href: zenario/admin/grid_maker/grid_maker.php
                        width: 100%
                        height: 100%
                        maxWidth: 100%
                        maxHeight: 100%
                        initialWidth: 100%
                        initialHeight: 100%
                        iframe: true
                        escKey: false
                        transition: none
                        css_class: zenario_grid_maker
                edit_head_slots:
                    priv: _PRIV_EDIT_SITEWIDE
                    hide_in_select_mode: true
                    label: Edit site-wide header
                    hide_on_refiner:
                        module_usage: true
                        plugin_instance_usage: true
                    popout:
                        href: zenario/admin/grid_maker/grid_maker.php?edit_head_slots=1
                        width: 100%
                        height: 100%
                        maxWidth: 100%
                        maxHeight: 100%
                        initialWidth: 100%
                        initialHeight: 100%
                        iframe: true
                        escKey: false
                        transition: none
                        css_class: zenario_grid_maker
                edit_foot_slots:
                    priv: _PRIV_EDIT_SITEWIDE
                    hide_in_select_mode: true
                    label: Edit site-wide footer
                    hide_on_refiner:
                        module_usage: true
                        plugin_instance_usage: true
                    popout:
                        href: zenario/admin/grid_maker/grid_maker.php?edit_foot_slots=1
                        width: 100%
                        height: 100%
                        maxWidth: 100%
                        maxHeight: 100%
                        initialWidth: 100%
                        initialHeight: 100%
                        iframe: true
                        escKey: false
                        transition: none
                        css_class: zenario_grid_maker
                help:
                    label: Help
                    help:
                        message: |
                            Layouts define the layout of content items (web pages): the sizes and positions of slots, and which plugins are in which slots.
                            
                            Zenario uses the 960gs grid system, which means that layouts are based on a number of columns (often 12, but this can be adjusted), with each slot spanning a certain number of columns.
                            
                            There's an interactive tool called Gridmaker. Click the "Create" button to make a new layout, or select an existing one and click "Edit with Gridmaker". Gridmaker lets you specify the type of layout, to add slots, groupings of slots, grid-breaks, whitespace and other features.
            
            inline_buttons:
                layout:
                    css_class: zenario_layout_inline_button
                    label: |
                        [[code]]
                    visible_if: |
                        zenarioA.checkSpecificPerms(id)
                active:
                    css_class: zenario_ib_active
                    tooltip: |
                        Available
                    visible_if: |
                        item.status == 'active'
                default:
                    css_class: zenario_ib_default
                    tooltip: 'Available; default layout for content type [[content_type]]'
                    visible_if: |
                        item.status == 'active_default'
                archived:
                    css_class: zenario_ib_archived
                    tooltip: |
                        Retired, so cannot be used for new content
                    visible_if: |
                        item.status == 'suspended'
                
            item_buttons:
                edit_grid:
                    priv: _PRIV_EDIT_TEMPLATE
                    hide_in_select_mode: true
                    label: Edit with Gridmaker
                    popout:
                        href: zenario/admin/grid_maker/grid_maker.php?loadTemplateFile=1
                        width: 100%
                        height: 100%
                        maxWidth: 100%
                        maxHeight: 100%
                        initialWidth: 100%
                        initialHeight: 100%
                        iframe: true
                        escKey: false
                        transition: none
                        css_class: zenario_grid_maker
                settings:
                    priv: _PRIV_VIEW_SITE_SETTING
                    hide_in_select_mode: true
                    label: Edit layout settings
                    admin_box:
                        path: zenario_layout
                view_dropdown:
                    label: View
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                preview:
                    parent: view_dropdown
                    label: Preview
                    visible_if_for_all_selected_items: >
                        !zenario.engToBoolean(item.missing)
                    popout: 
                        href: zenario/admin/layout_preview.php
                        iframe: true
                        
                code:
                    parent: view_dropdown
                    hide_in_select_mode: true
                    label: HTML source
                    visible_if_for_all_selected_items: >
                        !zenario.engToBoolean(item.missing)
                    admin_box:
                        path: zenario_view_source_code
                        key:
                            type: layout
                view_content:
                    parent: view_dropdown
                    hide_in_select_mode: true
                    label: Content items using this layout
                    record_count: usage_content_items
                    link:
                        path: zenario__content/panels/content
                        refiner: template
                view_slots:
                    priv: _PRIV_VIEW_SLOT
                    parent: view_dropdown
                    hide_in_select_mode: true
                    label: Slots and plugins on this layout
                    link:
                        path: zenario__content/panels/slots
                        refiner: layout
                
                head_slot_layers:
                    parent: view_dropdown
                    priv: _PRIV_MANAGE_ITEM_SLOT
                    label: Common HTML in <head>
                    admin_box:
                        path: zenario_head_foot_slot
                        key:
                            level: layout
                            mode: head
                    
                foot_slot_layers:
                    parent: view_dropdown
                    priv: _PRIV_MANAGE_ITEM_SLOT
                    label: Common HTML in foot
                    admin_box:
                        path: zenario_head_foot_slot
                        key:
                            level: layout
                            mode: foot
                
                action_dropdown:
                    label: Actions
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                duplicate:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_TEMPLATE
                    hide_in_select_mode: false
                    label: Duplicate
                    admin_box:
                        path: zenario_layout
                        key:
                            duplicate: "1"
                restore:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_TEMPLATE
                    hide_in_select_mode: true
                    label: Restore for use
                    multiple_select: true
                    multiple_select_tooltip: Restore selected layouts for use
                    ajax:
                        confirm:
                            message: 'Are you sure you wish to restore the layout "[[code]] [[name]]" so it is again available for use?'
                            multiple_select_message: Are you sure you wish to restore the selected layouts so they are again available for use?
                            button_message: Restore
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            restore: "1"
                    visible_if_for_all_selected_items: |
                        zenario.engToBoolean(item.archived)
                archive:
                    parent: action_dropdown
                    priv: _PRIV_EDIT_TEMPLATE
                    hide_in_select_mode: true
                    label: Retire
                    multiple_select: true
                    multiple_select_tooltip: Retire selected layouts
                    ajax:
                        confirm:
                            message: |
                                Are you sure you wish to retire the "[[code]] [[name]]" layout?
                                                            
                                It will no longer be possible to choose this layout when making new content items, but the change will not affect existing content items that use it.
                            multiple_select_message: |
                                Are you sure you wish to retire the selected layouts?
                                                            
                                It will no longer be possible to choose these layouts when making new content items, but the change will not affect existing content items that use them.
                            button_message: Retire
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            archive: "1"
                    without_columns_set:
                        deletable: true
                    visible_if_for_all_selected_items: |
                        !zenario.engToBoolean(item.archived)
                    disabled_if_for_any_selected_items: |
                        zenario.engToBoolean(item.default)
                    disabled_tooltip: 'You cannot retire a layout that is the default layout for a content type.'
                delete:
                    priv: _PRIV_EDIT_TEMPLATE
                    label: Delete
                    hide_in_select_mode: true
                    multiple_select: true
                    multiple_select_tooltip: Delete the selected layouts
                    ajax:
                        confirm:
                            message: 'Are you sure you wish to delete the layout "[[code]] [[name]]"?'
                            multiple_select_message: Are you sure you wish to delete the selected layouts?
                            button_message: Delete
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete: "1"
                    with_columns_set:
                        deletable: false
                    disabled_if_for_any_selected_items: |
                        zenario.engToBoolean(item.delete_disabled)
                    disabled_tooltip: 'You cannot delete a layout if it is the default layout for a content type, or if the layout is used by content items.'
