Commit 0dc60d48 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1795097: placing 'locked' above 'locked blocks'



behatnotneeded

Change-Id: I9748442b78d0ad48c8d1e891f6dbc4d6c71905a3
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 62d11942
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -340,12 +340,24 @@ function get_advanced_elements() {
            'rules'        => array('maxlength' => 100, 'regex' => get_config('cleanurlvalidate')),
            'ignore'       => !$urlallowed,
        ),
        'lockblocks' => array(
    );
    if ($group) {
        $grouproles = $USER->get('grouproles');
        if ($grouproles[$group] == 'admin') {
            $elements['locked'] = array(
                'type'         => 'switchbox',
                'title'        => get_string('Locked', 'view'),
                'description'  => get_string('lockedgroupviewdesc', 'view'),
                'defaultvalue' => $view->get('locked'),
                'disabled'     => $view->get('type') == 'grouphomepage', // This page unreachable for grouphomepage anyway
            );
        }
    }
    $elements['lockblocks'] = array(
        'type'         => 'switchbox',
        'title'        => get_string('lockblocks', 'view'),
        'description'  => get_string('lockblocksdescription', 'view'),
        'defaultvalue' => $view->get('lockblocks'),
        ),
    );
    if (!($group || $institution)) {
        $default = $view->get('ownerformat');
@@ -361,18 +373,6 @@ function get_advanced_elements() {
            'rules'        => array('required' => true),
        );
    }
    if ($group) {
        $grouproles = $USER->get('grouproles');
        if ($grouproles[$group] == 'admin') {
            $elements['locked'] = array(
                'type'         => 'switchbox',
                'title'        => get_string('Locked', 'view'),
                'description'  => get_string('lockedgroupviewdesc', 'view'),
                'defaultvalue' => $view->get('locked'),
                'disabled'     => $view->get('type') == 'grouphomepage', // This page unreachable for grouphomepage anyway
            );
        }
    }
    if (get_config('allowanonymouspages')) {
        $elements['anonymise'] = array(
            'type'         => 'switchbox',