Commit 05bea899 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1795097: Move some "basic" view settings to "advanced" section



behatnotneeded

Change-Id: I7a49a5425451d96562ade492e7f2a61ba0e712e1
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 20d715bb)
parent 8bac3989
...@@ -276,12 +276,6 @@ function get_basic_elements() { ...@@ -276,12 +276,6 @@ function get_basic_elements() {
'defaultvalue' => $view->get('description'), 'defaultvalue' => $view->get('description'),
'rules' => array('maxlength' => 65536), 'rules' => array('maxlength' => 65536),
), ),
'lockblocks' => array(
'type' => 'switchbox',
'title' => get_string('lockblocks', 'view'),
'description' => get_string('lockblocksdescription', 'view'),
'defaultvalue' => $view->get('lockblocks'),
),
'tags' => array( 'tags' => array(
'type' => 'tags', 'type' => 'tags',
'title' => get_string('tags'), 'title' => get_string('tags'),
...@@ -305,26 +299,6 @@ function get_basic_elements() { ...@@ -305,26 +299,6 @@ function get_basic_elements() {
'help' => true, 'help' => 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',
'title' => get_string('anonymise','view'),
'description' => get_string('anonymisedescription','view'),
'defaultvalue' => $view->get('anonymise'),
);
}
return $elements; return $elements;
} }
...@@ -366,6 +340,12 @@ function get_advanced_elements() { ...@@ -366,6 +340,12 @@ function get_advanced_elements() {
'rules' => array('maxlength' => 100, 'regex' => get_config('cleanurlvalidate')), 'rules' => array('maxlength' => 100, 'regex' => get_config('cleanurlvalidate')),
'ignore' => !$urlallowed, 'ignore' => !$urlallowed,
), ),
'lockblocks' => array(
'type' => 'switchbox',
'title' => get_string('lockblocks', 'view'),
'description' => get_string('lockblocksdescription', 'view'),
'defaultvalue' => $view->get('lockblocks'),
),
); );
if (!($group || $institution)) { if (!($group || $institution)) {
$default = $view->get('ownerformat'); $default = $view->get('ownerformat');
...@@ -381,6 +361,26 @@ function get_advanced_elements() { ...@@ -381,6 +361,26 @@ function get_advanced_elements() {
'rules' => array('required' => true), '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',
'title' => get_string('anonymise','view'),
'description' => get_string('anonymisedescription','view'),
'defaultvalue' => $view->get('anonymise'),
);
}
return $elements; return $elements;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment