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. 10
      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. // The name of your plugin. Displayed on admin menus.
$string['enrolname'] = 'Course enrol confirmation'; $string['enrolname'] = 'Course enrol confirmation';
$string['pluginname'] = '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['confirmmailsubject'] = 'Confirm mail subject';
$string['confirmmailcontent'] = 'Confirm mail content'; $string['confirmmailcontent'] = 'Confirm mail content';

10
lib.php

@ -118,9 +118,9 @@ class enrol_apply_plugin extends enrol_plugin {
$icons = array(); $icons = array();
if (has_capability("enrol/manual:manage", $context)) { if (has_capability('enrol/manual:config', $context)) {
$editlink = new moodle_url("/enrol/apply/edit.php", array('courseid'=>$instance->courseid, 'id'=>$instance->id)); $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'))); $icons[] = $OUTPUT->action_icon($editlink, new pix_icon('t/edit', get_string('edit'), 'core', array('class' => 'iconsmall')));
} }
if (has_capability('enrol/manual:manage', $context)) { if (has_capability('enrol/manual:manage', $context)) {
@ -128,9 +128,9 @@ class enrol_apply_plugin extends enrol_plugin {
$icons[] = $OUTPUT->action_icon($managelink, new pix_icon('i/users', get_string('confirmenrol', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); $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)) { if (has_capability("enrol/manual:enrol", $context)) {
$managelink = new moodle_url("/enrol/apply/enroluser.php", array('enrolid'=>$instance->id)); $enrollink = 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'))); $icons[] = $OUTPUT->action_icon($enrollink, new pix_icon('t/enrolusers', get_string('enrolusers', 'enrol_apply'), 'core', array('class'=>'iconsmall')));
} }
return $icons; return $icons;

8
settings.php

@ -14,14 +14,16 @@ defined('MOODLE_INTERNAL') || die();
if ($ADMIN->fulltree) { if ($ADMIN->fulltree) {
//--- general settings ----------------------------------------------------------------------------------- //--- 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_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_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_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_confightmleditor('enrol_apply/cancelmailcontent', get_string('cancelmailcontent', 'enrol_apply'),'utf-8',''));
$settings->add(new admin_setting_configcheckbox('enrol_apply/sendmailtoteacher', $settings->add(new admin_setting_configcheckbox('enrol_apply/sendmailtoteacher',

Loading…
Cancel
Save