# You must use a tab-size of 4 spaces to edit this file.
---
zenario_content_privacy:
    priv: _PRIV_EDIT_DRAFT
    hide_tab_bar: true
    key:
        id: ""
        originalId: ""
        equivId: ""
        cType: ""
        id_is_menu_node_id: false
        privacy_settings_on_load: {}
        menu_node_id: ''
    identifier:
        css_class: content_draft
        label: Content item ID
    tabs:
        privacy:
            label: Permissions
            edit_mode:
                enabled: true
            fields: &contentPrivacyFields
                privacy_settings_disabled_note:
                    pre_field_html: '<div class="zenario_fbInfo">'
                    snippet:
                        html: 'Zenario can show options for making content items private, i.e. needing a password to access them. To do this, the module "Extranet Base Module and Login" (zenario_extranet) must be running.'
                    post_field_html: '</div>'
                    hidden: true
                
                privacy_grouping_left:
                    type: grouping
                    grouping_css_class: duplicating_left_column
                    start_new_grouping_wrapper: true
                    grouping_wrapper_css_class: row_of_groupings
                
                privacy_grouping_right:
                    type: grouping
                    grouping_css_class: duplicating_right_column
                
                privacy:
                    grouping: privacy_grouping_right
                    label: 'Permission to access:'
                    type: radios
                    values:
                        public:
                            icon_class: content_privacy public
                            label: 'Public: visible to everyone'
                        logged_in:
                            icon_class: content_privacy logged_in
                            label: 'Private: access is only for extranet users ([[user_count]])'
                        group_members:
                            icon_class: content_privacy group_members
                            label: 'Private: access is only for extranet users in groups...'
                            split_values_if_selected: true
                        in_smart_group:
                            icon_class: content_privacy smart_group
                            label: 'Private: access is only for extranet users in the smart group...'
                            split_values_if_selected: true
                        logged_in_not_in_smart_group:
                            icon_class: content_privacy smart_group
                            label: 'Private: access is only for extranet users NOT in the smart group...'
                            split_values_if_selected: true
                        with_role:
                            icon_class: content_privacy with_role
                            label: 'Private: access is only for extranet users with role...'
                            type: checkboxes
                            values: ""
                            checking_child_checks_parents: true
                            split_values_if_selected: true
                        logged_out:
                            icon_class: content_privacy logged_out
                            label: 'Access is only for visitors who are NOT logged in (advanced)'
                        call_static_method:
                            icon_class: content_privacy call_static_method
                            label: "Call a module's static method to decide (advanced):"
                            split_values_if_selected: true
                        send_signal:
                            icon_class: content_privacy send_signal
                            label: 'Send a signal to decide (advanced)'
                    format_onchange: true
                    validation:
                        required_if_not_hidden: Please select a visibility option
                
                group_ids:
                    grouping: privacy_grouping_right
                    indent: 1
                    visible_if:
                        zenarioAB.valueIs: privacy, group_members
                    type: checkboxes
                    no_values_message: No groups found
                    validation:
                        required_if_not_hidden: Please select a group.
                    format_onchange: true
                smart_group_id:
                    grouping: privacy_grouping_right
                    #If no smart groups are defined, this field will not be displayed.
                    #It will be hidden in the PHP class, and its visible_if logic will be removed.
                    indent: 1
                    visible_if:
                        zenarioAB.valueIn: privacy, in_smart_group, logged_in_not_in_smart_group
                    type: select
                    empty_value: ' -- Select -- '
                    validation:
                        required_if_not_hidden: Please select a smart group.
                    format_onchange: true
                no_smart_groups_defined:
                    grouping: privacy_grouping_right
                    #If there are smart groups defined, this field will not be displayed.
                    #It will be unset in the PHP class.
                    indent: 1
                    snippet:
                        html: 'No smart groups found'
                    visible_if:
                        zenarioAB.valueIn: privacy, in_smart_group, logged_in_not_in_smart_group
                    validation:
                        required_if_not_hidden: Please select a smart group.
                role_ids:
                    grouping: privacy_grouping_right
                    indent: 1
                    visible_if:
                        zenarioAB.valueIs: privacy, with_role
                    type: checkboxes
                    no_values_message: No roles found
                    validation:
                        required_if_not_hidden: Please select a role.
                    format_onchange: true
                at_location:
                    grouping: privacy_grouping_right
                    indent: 1
                    hide_with_previous_field: true
                    type: radios
                    value: any
                    values:
                        any:
                            label: at ANY location
                        in_url:
                            label: at the location in the URL
                        detect:
                            label: at the location in the URL, or at ANY location when there is no location in the URL
                    format_onchange: true
                module_class_name:
                    grouping: privacy_grouping_right
                    indent: 1
                    visible_if:
                        zenarioAB.valueIs: privacy, call_static_method
                    label: 'Module class name:'
                    type: text
                    maxlength: 200
                    oninput: |
                        var $warningRow = $(lib.get('row__content_item_privacy_info_warning'));
                        
                        var moduleClassNameOnLoad = zenarioAB.tuix.key.privacy_settings_on_load.module_class_name;
                        if (moduleClassNameOnLoad != this.value) {
                            $warningRow.removeClass('zfab_inline_warning_hidden');
                        } else {
                            $warningRow.addClass('zfab_inline_warning_hidden');
                        }
                method_name:
                    grouping: privacy_grouping_right
                    indent: 1
                    hide_with_previous_field: true
                    label: 'Static method name:'
                    type: text
                    maxlength: 127
                param_1:
                    grouping: privacy_grouping_right
                    indent: 1
                    hide_with_previous_field: true
                    label: 'Parameter 1:'
                    type: text
                    maxlength: 255
                param_2:
                    grouping: privacy_grouping_right
                    indent: 1
                    hide_with_previous_field: true
                    label: 'Parameter 2:'
                    type: text
                    maxlength: 255
                signal_blurb:
                    grouping: privacy_grouping_right
                    indent: 1
                    visible_if:
                        zenarioAB.valueIs: privacy, send_signal
                    snippet:
                        html: |
                            This option can be used in conjunction with a module,
                            such as the ecommerce module, to sell access to this content.
                            The following signal will be sent:
                signal_name:
                    grouping: privacy_grouping_right
                    indent: 2
                    hide_with_previous_field: true
                    snippet:
                        html: |
                             <code>eventCheckContentItemPermission($userId, $cID, $cType, $cVersion)</code>
                
                clist_warning:
                    grouping: privacy_grouping_right
                    indent: 1
                    visible_if:
                        zenarioAB.valueIn: privacy, in_smart_group, logged_in_not_in_smart_group
                    note_below: |
                        Content items with this permission will never appear in Content Summary Lists.
                
                privacy_part_2:
                    grouping: privacy_grouping_right
                    snippet:
                        show_split_values_from: privacy
                    note_below: |
                        Content items are always visible to logged-in administrators.
                
                content_item_privacy_info_warning:
                    grouping: privacy_grouping_right
                    row_class: zfab_inline_warning_hidden
                    snippet:
                        html: |
                            <div class="zenario_fbWarning">[[content_item_privacy_changed_warning]]</div>

    confirm:
        message: ''
        message_type: warning
        button_message: Save
        cancel_button_message: Cancel





zenario_content:
    tabs:
        privacy:
            hidden: false
            ord: 35
            label: Permissions
            edit_mode:
                enabled: ""
                priv: _PRIV_EDIT_DRAFT
            fields: *contentPrivacyFields
