Browse Source

Merge pull request #5 from emeneo/dev-contentchanges

Admin settings page adjusted, plugin description added (just english language), adjusted capabilities used for checking in lib.php before displaying edit, manage, enrol links (it's more like I bugfix) and changed icons for these links.
develop_fields
Johannes Burk 11 years ago
parent
commit
b7cf0e3647
  1. 1
      lang/en/enrol_apply.php
  2. 14
      lib.php
  3. 8
      settings.php

1
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';

14
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;

8
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',

Loading…
Cancel
Save