# You must use a tab-size of 4 spaces to edit this file.
---
zenario_videos_manager:
    panels:
        videos:
            title: Video library
            no_items_message: No videos found
            panel_type: multi_line_list_or_grid
            use_tall_rows: true
            item: 
                css_class: zenario_videos_manager_item
            db_items:
                table: '[[DB_PREFIX]][[ZENARIO_VIDEOS_MANAGER_PREFIX]]videos AS v'
                id_column: v.id
            
            refiners:
                category:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]][[ZENARIO_VIDEOS_MANAGER_PREFIX]]category_video_link AS cvl2
                           ON cvl2.category_id = [[REFINER__CATEGORY]]
                           AND cvl2.video_id = v.id
            
            columns:
                thumbnail_id:
                    hidden: true
                    db_column: v.image_id
                thumbnail_checksum:
                    hidden: true
                    db_column: f.checksum
                    table_join: |
                        LEFT JOIN [[DB_PREFIX]]files f
                        ON f.id = v.image_id
                id:
                    title: ID
                    format: id
                    db_column: v.id
                    searchable: true
                    always_show: true
                    align_right: true
                    width: xxsmall
                title:
                    title: Title
                    db_column: v.title
                    width: xlarge
                    always_show: true
                    searchable: true
                duplicate_url:
                    title: URL not unique 
                    always_show: true
                    parent: url
                    db_column: |
                        (
                            SELECT 1
                            FROM [[DB_PREFIX]][[ZENARIO_VIDEOS_MANAGER_PREFIX]]videos AS url_duplicates
                            WHERE url_duplicates.url = v.url
                              AND url_duplicates.id <> v.id
                            LIMIT 1
                        )
                    filter_format: yes_or_no
                    microtemplate: |
                        <% if (m.item.duplicate_url) { %>
                            <span class="zenario_inline_warning">
                                URL not unique
                            </span>
                        <% } %>
                url:
                    title: Remote URL
                    show_by_default: true
                    db_column: v.url
                    searchable: true
                    width: xlarge
                date:
                    title: Date
                    db_column: v.date
                    format: date
                    always_show: true
                    searchable: true
                categories:
                    title: Categories
                    table_join: |
                        [[DB_PREFIX]][[ZENARIO_VIDEOS_MANAGER_PREFIX]]category_video_link cvl
                            ON v.id = cvl.video_id
                        LEFT JOIN [[DB_PREFIX]][[ZENARIO_VIDEOS_MANAGER_PREFIX]]categories c
                            ON cvl.category_id = c.id
                    db_column: GROUP_CONCAT(c.name ORDER BY c.name SEPARATOR ', ')
                    width: xlarge
                    always_show: true
                language:
                    title: Language
                    db_column: v.language_id
                vimeo_privacy_setting:
                    #This column loads the privacy setting from the DB.
                    db_column: v.vimeo_privacy_setting
                    hidden: true
                vimeo_privacy_last_cached:
                    db_column: v.vimeo_privacy_last_cached
                    hidden: true
                video_privacy:
                    #This column has the nicely formatted privacy setting.
                    title: Video privacy
                    show_by_default: true
                    width: xlarge
            item_buttons:
                edit:
                    hide_in_select_mode: true
                    label: Edit video
                    admin_box:
                        path: zenario_videos_manager__video
                category_dropdown:
                    label: Categories
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                categories_add:
                    #This button only appears if multiple videos are selected.
                    priv: _PRIV_MANAGE_VIDEOS
                    parent: category_dropdown
                    label: Add to categories...
                    multiple_select_only: true
                    multiple_select: true
                    admin_box:
                        path: zenario_video_categories_add
                    disabled_tooltip: Categories are not enabled for this content type
                categories:
                    #This button only appears if exactly 1 video is selected.
                    #It allows an admin to add/remove a video to/from
                    #any number of categories all within 1 admin box.
                    parent: category_dropdown
                    label: Change categories...
                    admin_box:
                        path: zenario_video_categories
                categories_remove:
                    #This button only appears if multiple videos are selected.
                    priv: _PRIV_MANAGE_VIDEOS
                    parent: category_dropdown
                    label: Remove from categories...
                    multiple_select_only: true
                    multiple_select: true
                    admin_box:
                        path: zenario_video_categories_remove
                    disabled_tooltip: Categories are not enabled for this content type
                delete:
                    priv: _PRIV_MANAGE_VIDEOS
                    hide_in_select_mode: true
                    label: Delete
                    multiple_select_tooltip: Delete these videos?
                    multiple_select: true
                    ajax:
                        confirm:
                            message: Are you sure you want to delete the video "[[title]]"?
                            multiple_select_message: Are you sure you wish to delete these videos?
                            button_message: Delete
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete_video: 1
            collection_buttons:
                # Commenting out the button as of 14 Oct 2021. Might restore it later.
                # upload_video:
                #     hide_in_select_mode: true
                #     css_class: zenario_create_a_new
                #     label: Upload a video
                #     popout: 
                #         href: "zenario_extra_modules/zenario_videos_manager/video_upload/video_upload.php"
                #         width: 60%
                #         height: 100%
                #         maxWidth: 100%
                #         maxHeight: 100%
                #         initialWidth: 60%
                #         initialHeight: 100%
                #         iframe: true
                #         transition: "none"
                add_embed_code:
                    priv: _PRIV_MANAGE_VIDEOS
                    hide_in_select_mode: true
                    css_class: zenario_create_a_new
                    label: Add a video
                    admin_box:
                        path: zenario_videos_manager__video
                update_vimeo_privacy:
                    priv: _PRIV_MANAGE_VIDEOS
                    hide_in_select_mode: true
                    label: "Update all videos' privacy from Vimeo"
                    ajax:
                        confirm:
                            message: This action will update the privacy settings for all Vimeo videos. It may take a long time. Proceed?
                            button_message: Update
                            cancel_button_message: Cancel
                            message_type: question
                        request:
                            update_vimeo_privacy: 1
                help:
                    label: Help
                    hide_in_select_mode: true
                    help: 
                        message: |
                            The video library holds videos that can be managed and played on this site, even thought they are stored on YouTube or Vimeo.

                            Videos can be public, or may be unlisted or private on YouTube/Vimeo, and by displaying them on a private page on Zenario you can control access through Zenario's extranet system.

                            To add a video, click the "Add video" button, and paste in the URL from the YouTube or Vimeo host.