mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-69228 tool_mobile: Hide dependant settings
This commit is contained in:
parent
49a9e8b07d
commit
0bf024e48a
1 changed files with 141 additions and 120 deletions
|
@ -48,9 +48,6 @@ if ($hassiteconfig) {
|
|||
|
||||
$ADMIN->add('mobileapp', $temp);
|
||||
|
||||
// Show only mobile settings if the mobile service is enabled.
|
||||
if (!empty($CFG->enablemobilewebservice)) {
|
||||
|
||||
$featuresnotice = null;
|
||||
if (empty($CFG->disablemobileappsubscription)) {
|
||||
// General notification about limited features due to app restrictions.
|
||||
|
@ -59,14 +56,29 @@ if ($hassiteconfig) {
|
|||
get_string('moodleappsportalfeatureswarning', 'tool_mobile', $subscriptionurl),
|
||||
\core\output\notification::NOTIFY_WARNING);
|
||||
$featuresnotice = $OUTPUT->render($notify);
|
||||
|
||||
$ADMIN->add('mobileapp', new admin_externalpage('mobileappsubscription',
|
||||
new lang_string('mobileappsubscription', 'tool_mobile'),
|
||||
"$CFG->wwwroot/$CFG->admin/tool/mobile/subscription.php"));
|
||||
}
|
||||
|
||||
$hideappsubscription = empty($CFG->enablemobilewebservice);
|
||||
$hideappsubscription = $hideappsubscription || (isset($CFG->disablemobileappsubscription) && !empty($CFG->disablemobileappsubscription));
|
||||
|
||||
$ADMIN->add(
|
||||
'mobileapp',
|
||||
new admin_externalpage(
|
||||
'mobileappsubscription',
|
||||
new lang_string('mobileappsubscription', 'tool_mobile'),
|
||||
"$CFG->wwwroot/$CFG->admin/tool/mobile/subscription.php",
|
||||
'moodle/site:config',
|
||||
$hideappsubscription
|
||||
)
|
||||
);
|
||||
|
||||
// Type of login.
|
||||
$temp = new admin_settingpage('mobileauthentication', new lang_string('mobileauthentication', 'tool_mobile'));
|
||||
$temp = new admin_settingpage(
|
||||
'mobileauthentication',
|
||||
new lang_string('mobileauthentication', 'tool_mobile'),
|
||||
'moodle/site:config',
|
||||
empty($CFG->enablemobilewebservice)
|
||||
);
|
||||
|
||||
$temp->add(new admin_setting_heading('tool_mobile/moodleappsportalfeaturesauth', '', $featuresnotice));
|
||||
|
||||
|
@ -99,7 +111,12 @@ if ($hassiteconfig) {
|
|||
$ADMIN->add('mobileapp', $temp);
|
||||
|
||||
// Appearance related settings.
|
||||
$temp = new admin_settingpage('mobileappearance', new lang_string('mobileappearance', 'tool_mobile'));
|
||||
$temp = new admin_settingpage(
|
||||
'mobileappearance',
|
||||
new lang_string('mobileappearance', 'tool_mobile'),
|
||||
'moodle/site:config',
|
||||
empty($CFG->enablemobilewebservice)
|
||||
);
|
||||
|
||||
if (!empty($featuresnotice)) {
|
||||
$temp->add(new admin_setting_heading('tool_mobile/moodleappsportalfeaturesappearance', '', $featuresnotice));
|
||||
|
@ -135,7 +152,12 @@ if ($hassiteconfig) {
|
|||
$ADMIN->add('mobileapp', $temp);
|
||||
|
||||
// Features related settings.
|
||||
$temp = new admin_settingpage('mobilefeatures', new lang_string('mobilefeatures', 'tool_mobile'));
|
||||
$temp = new admin_settingpage(
|
||||
'mobilefeatures',
|
||||
new lang_string('mobilefeatures', 'tool_mobile'),
|
||||
'moodle/site:config',
|
||||
empty($CFG->enablemobilewebservice)
|
||||
);
|
||||
|
||||
if (!empty($featuresnotice)) {
|
||||
$temp->add(new admin_setting_heading('tool_mobile/moodleappsportalfeatures', '', $featuresnotice));
|
||||
|
@ -169,4 +191,3 @@ if ($hassiteconfig) {
|
|||
|
||||
$ADMIN->add('mobileapp', $temp);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue