diff --git a/lang/en/enrol_apply.php b/lang/en/enrol_apply.php index 29e6bf1..995d5d9 100644 --- a/lang/en/enrol_apply.php +++ b/lang/en/enrol_apply.php @@ -12,6 +12,7 @@ // The name of your plugin. Displayed on admin menus. $string['enrolname'] = 'Course enrol confirmation'; $string['pluginname'] = 'Course enrol confirmation'; +$string['pluginname_desc'] = 'With this plugin users can apply to a course and a teacher have to comfirm before the user gets enroled.'; $string['confirmmailsubject'] = 'Confirm mail subject'; $string['confirmmailcontent'] = 'Confirm mail content'; diff --git a/lib.php b/lib.php index eb8f75f..ee63ad5 100644 --- a/lib.php +++ b/lib.php @@ -118,19 +118,19 @@ class enrol_apply_plugin extends enrol_plugin { $icons = array(); - if (has_capability("enrol/manual:manage", $context)) { - $editlink = new moodle_url("/enrol/apply/edit.php", array('courseid'=>$instance->courseid, 'id'=>$instance->id)); - $icons[] = $OUTPUT->action_icon($editlink, new pix_icon('i/edit', get_string('edit'), 'core', array('class'=>'icon'))); - } + if (has_capability('enrol/manual:config', $context)) { + $editlink = new moodle_url("/enrol/apply/edit.php", array('courseid'=>$instance->courseid, 'id'=>$instance->id)); + $icons[] = $OUTPUT->action_icon($editlink, new pix_icon('t/edit', get_string('edit'), 'core', array('class' => 'iconsmall'))); + } if (has_capability('enrol/manual:manage', $context)) { $managelink = new moodle_url("/enrol/apply/apply.php", array('id'=>$_GET['id'],'enrolid'=>$instance->id)); $icons[] = $OUTPUT->action_icon($managelink, new pix_icon('i/users', get_string('confirmenrol', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); } - if (has_capability("enrol/manual:manage", $context)) { - $managelink = new moodle_url("/enrol/apply/enroluser.php", array('enrolid'=>$instance->id)); - $icons[] = $OUTPUT->action_icon($managelink, new pix_icon('i/users', get_string('enrolusers', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); + if (has_capability("enrol/manual:enrol", $context)) { + $enrollink = new moodle_url("/enrol/apply/enroluser.php", array('enrolid'=>$instance->id)); + $icons[] = $OUTPUT->action_icon($enrollink, new pix_icon('t/enrolusers', get_string('enrolusers', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); } return $icons; diff --git a/settings.php b/settings.php index 913aaf9..f8d8493 100644 --- a/settings.php +++ b/settings.php @@ -14,14 +14,16 @@ defined('MOODLE_INTERNAL') || die(); if ($ADMIN->fulltree) { //--- general settings ----------------------------------------------------------------------------------- - $settings->add(new admin_setting_heading('enrol_apply_enrolname','','')); + $settings->add(new admin_setting_heading('enrol_apply_enrolname','',get_string('pluginname_desc', 'enrol_apply'))); $settings->add(new admin_setting_configtext('enrol_apply/confirmmailsubject','',get_string('confirmmailsubject', 'enrol_apply'),null,PARAM_TEXT,60)); - $settings->add(new admin_setting_heading('enrol_apply_settings', '', get_string('confirmmailcontent_desc', 'enrol_apply'))); + + $settings->add(new admin_setting_heading('enrol_apply_confirmmailcontent', '', get_string('confirmmailcontent_desc', 'enrol_apply'))); $settings->add(new admin_setting_confightmleditor('enrol_apply/confirmmailcontent', get_string('confirmmailcontent', 'enrol_apply'),'utf-8','')); $settings->add(new admin_setting_configtext('enrol_apply/cancelmailsubject','',get_string('cancelmailsubject', 'enrol_apply'),null,PARAM_TEXT,60)); - //$settings->add(new admin_setting_heading('enrol_apply_settings', '', get_string('cancelmailcontent_desc', 'enrol_apply'))); + + $settings->add(new admin_setting_heading('enrol_apply_cancelmailcontent', '', get_string('cancelmailcontent_desc', 'enrol_apply'))); $settings->add(new admin_setting_confightmleditor('enrol_apply/cancelmailcontent', get_string('cancelmailcontent', 'enrol_apply'),'utf-8','')); $settings->add(new admin_setting_configcheckbox('enrol_apply/sendmailtoteacher',