Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#32 - fix settings.php to allow see plugin settings on plugins admini… #35

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 69 additions & 72 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,82 +40,79 @@
get_string('label_cohortautoview', 'local_cohortauto'),
new moodle_url('/local/cohortauto/view.php')));

if ($ADMIN->fulltree) {
$settings = new admin_settingpage('local_cohortauto',
get_string('pluginname', 'local_cohortauto'));

$settings = new admin_settingpage('local_cohortauto',
get_string('pluginname', 'local_cohortauto'));
// Profile field helper.
$fldlist = array();
$usrhelper = get_admin();

// Profile field helper.
$fldlist = array();
$usrhelper = get_admin();
profile_load_data($usrhelper);
profile_load_custom_fields($usrhelper);
$fldlist = cohortauto_prepare_profile_data($usrhelper);

profile_load_data($usrhelper);
profile_load_custom_fields($usrhelper);
$fldlist = cohortauto_prepare_profile_data($usrhelper);
// Additional values for email.
if (!empty($fldlist['email'])) {
$fldlist['email'] = array(
'full' => '[email protected]',
'username' => 'exampleuser',
'domain' => 'mail.example.com',
'rootdomain' => 'example.com'
);
}

// Additional values for email.
if (!empty($fldlist['email'])) {
$fldlist['email'] = array(
'full' => '[email protected]',
'username' => 'exampleuser',
'domain' => 'mail.example.com',
'rootdomain' => 'example.com'
);
}
$helparray = array();
cohortauto_print_profile_data($fldlist, '', $helparray);

$helparray = array();
cohortauto_print_profile_data($fldlist, '', $helparray);
$helptext = implode(', ', $helparray);
$settings->add(new admin_setting_heading(
'local_cohortauto_profile_help',
get_string('profile_help', 'local_cohortauto'),
$helptext)
);
$settings->add(new admin_setting_configtextarea(
'local_cohortauto/mainrule_fld',
get_string('mainrule_fld', 'local_cohortauto'),
'', '')
);
$settings->add(new admin_setting_configselect(
'local_cohortauto/delim',
get_string('delim', 'local_cohortauto'),
get_string('delim_help', 'local_cohortauto'),
'CR+LF',
array('CR+LF' => 'CR+LF', 'CR' => 'CR', 'LF' => 'LF'))
);
$settings->add(new admin_setting_configtext(
'local_cohortauto/secondrule_fld',
get_string('secondrule_fld', 'local_cohortauto'),
'', 'n/a')
);
$settings->add(new admin_setting_configtextarea(
'local_cohortauto/replace_arr',
get_string('replace_arr', 'local_cohortauto'),
'', '')
);
$settings->add(new admin_setting_configtextarea(
'local_cohortauto/donttouchusers',
get_string('donttouchusers', 'local_cohortauto'),
'', '')
);
$settings->add(new admin_setting_configcheckbox(
'local_cohortauto/enableunenrol',
get_string('enableunenrol', 'local_cohortauto'),
'', 0)
);
$settings->add(new admin_setting_configtextarea(
'local_cohortauto/allowedemaildomains',
get_string('allowedemaildomains', 'local_cohortauto'),
get_string('configallowedemaildomains', 'local_cohortauto'),
'')
);
$settings->add(new admin_setting_configcheckbox(
'local_cohortauto/lowercase',
get_string('lowercase', 'local_cohortauto'),
'', 0)
);

$helptext = implode(', ', $helparray);
$settings->add(new admin_setting_heading(
'local_cohortauto_profile_help',
get_string('profile_help', 'local_cohortauto'),
$helptext)
);
$settings->add(new admin_setting_configtextarea(
'local_cohortauto/mainrule_fld',
get_string('mainrule_fld', 'local_cohortauto'),
'', '')
);
$settings->add(new admin_setting_configselect(
'local_cohortauto/delim',
get_string('delim', 'local_cohortauto'),
get_string('delim_help', 'local_cohortauto'),
'CR+LF',
array('CR+LF' => 'CR+LF', 'CR' => 'CR', 'LF' => 'LF'))
);
$settings->add(new admin_setting_configtext(
'local_cohortauto/secondrule_fld',
get_string('secondrule_fld', 'local_cohortauto'),
'', 'n/a')
);
$settings->add(new admin_setting_configtextarea(
'local_cohortauto/replace_arr',
get_string('replace_arr', 'local_cohortauto'),
'', '')
);
$settings->add(new admin_setting_configtextarea(
'local_cohortauto/donttouchusers',
get_string('donttouchusers', 'local_cohortauto'),
'', '')
);
$settings->add(new admin_setting_configcheckbox(
'local_cohortauto/enableunenrol',
get_string('enableunenrol', 'local_cohortauto'),
'', 0)
);
$settings->add(new admin_setting_configtextarea(
'local_cohortauto/allowedemaildomains',
get_string('allowedemaildomains', 'local_cohortauto'),
get_string('configallowedemaildomains', 'local_cohortauto'),
'')
);

$settings->add(new admin_setting_configcheckbox(
'local_cohortauto/lowercase',
get_string('lowercase', 'local_cohortauto'),
'', 0)
);
$ADMIN->add('localplugins', $settings);
}
$ADMIN->add('localplugins', $settings);
}
Loading