# You must use a tab-size of 4 spaces to edit this file.
---
site_settings:
    setting_group: dirs
    title: Editing settings for backups
    tabs:
        
        automated_backups:
            label: Automated backups
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
            notices: 
                show_warning_message:
                    type: warning
                    show: true

            fields:
                check_automated_backups:
                    site_setting:
                        name: check_automated_backups
                    full_width: true
                    type: radios
                    value: 0
                    values:
                        0:
                            label: Don't check if automated backups are running
                        1:
                            label: Check for automated backups and warn if they are not running
                    redraw_onchange: true
                blurb:
                    indent: 1
                    visible_if: zenarioAB.value('check_automated_backups')
                    full_width: true
                    snippet:
                        html: |
                            If you will run automated backups of this site,
                            please ensure that your backup script appends to a log file to report
                            when it makes a backup. This should be a CSV file in this format:
                    note_below: |
                        <pre tstyle="margin: 10px;">2021-01-31 23:59:59,dbhost,dbname1
                        2021-01-31 23:59:59,dbhost,dbname2
                        2021-01-31 23:59:59,dbhost,dbname3
                        ...</pre>
                automated_backup_log_path:
                    indent: 1
                    visible_if: zenarioAB.value('check_automated_backups')
                    site_setting:
                        name: automated_backup_log_path
                        protect_from_database_restore: true
                    label: 'Path to log file including file name:'
                    type: text
                    placeholder: 'E.g. /var/www/log/dbbackup.log'
                test:
                    same_row: true
                    visible_if: zenarioAB.value('check_automated_backups')
                    type: submit
                    value: Test
                    class: zenario_gp_button
                    can_be_pressed_in_view_mode: true
                    validate_onchange: true
                automated_backup_days:
                    indent: 1
                    visible_if: zenarioAB.value('check_automated_backups')
                    site_setting:
                        name: automated_backup_days
                    label: 'Show a warning on diagnostics screen if a backup has not been taken for more than:'
                    type: select
                    value: 1
                    values:
                        1:
                            label: 1 day
                        2:
                            label: 2 days
                        3:
                            label: 3 days
                        4:
                            label: 4 days
                        5:
                            label: 5 days
                        6:
                            label: 6 days
                        7:
                            label: 7 days
        
        backup_dir:
            label: Manual backups
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
            fields:
                dir_1_blurb:
                    full_width: true
                    snippet:
                        html: |
                            <p>
                                You can use Zenario to manually take a backup of your site's database and store it on your server.
                                This works best with small-to-medium sized sites.
                                For large sites, the backup will take a long time to make, and require a lot of storage space.
                            </p><p>
                                Note that the manual backups only contain the site's database. They do not include the contents of
                                the <code>docstore</code> or <code>zenario_custom</code> directories.
                            </p><p>
                                Please create a directory on your server in which to keep these backups.
                                Enter an absolute path starting with a slash, but do not add a trailing slash.
                            </p>
                backup_dir:
                    site_setting:
                        name: backup_dir
                        protect_from_database_restore: true
                    label: 'Backup directory:'
                    type: text
                    #onkeyup: zenarioAB.quickValidateWelcomePage(500);
                #backup_dir_status:
                #    snippet:
                #        html: '&nbsp;'
        
        restore_policy:
            label: Restore policy
            edit_mode: 
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
            fields: 
                description:
                    full_width: true
                    snippet:
                        html: |
                            Settings shown in pink boxes are determined in the <code>zenario_siteconfig.php</code> file.
                            Ask your Zenario system administrator to make changes.
                zenario_site_description: 
                    class_name: zenario_common_features
                    type: grouping
                    name: zenario_site_description
                allow_restore:
                    grouping: zenario_site_description
                    legend: Set in the <code>zenario_siteconfig.php</code> file
                    label: |
                        Restore policy (<code>RESTORE_POLICY</code>):
                    type: text
                    readonly: true
                    style:
                        width: 4em
                    note_below: |
                        "always" means allow database backups to be restored using Organizer.
                        "never" means disable the ability to restore database backups using Organizer.
                        Today's date means to allow database backups to be restored on today only.
                        The diagnostics screen will show a warning if not set.


