Merge branch 'MDL-59766-master' of git://github.com/damyon/moodle

This commit is contained in:
Jun Pataleta 2017-12-12 16:26:34 +13:00
commit 9244faa3a4
3 changed files with 11 additions and 5 deletions

View File

@ -39,6 +39,8 @@ $string['command'] = 'Command:';
$string['commentcontextmenu'] = 'Comment context menu';
$string['couldnotsavepage'] = 'Could not save page {$a}';
$string['currentstamp'] = 'Stamp';
$string['default'] = 'Enabled by default';
$string['default_help'] = 'If set, this feedback method will be enabled by default for all new assignments.';
$string['deleteannotation'] = 'Delete annotation';
$string['deletecomment'] = 'Delete comment';
$string['deletefeedback'] = 'Delete feedback PDF';

View File

@ -332,12 +332,11 @@ class assign_feedback_editpdf extends assign_feedback_plugin {
}
/**
* Automatically enable or disable editpdf feedback plugin based on
* whether the ghostscript path is set correctly.
* Determine if ghostscript is available and working.
*
* @return bool
*/
public function is_enabled() {
public function is_available() {
if ($this->enabledcache === null) {
$testpath = assignfeedback_editpdf\pdf::test_gs_path(false);
$this->enabledcache = ($testpath->status == assignfeedback_editpdf\pdf::GSPATH_OK);
@ -345,12 +344,12 @@ class assign_feedback_editpdf extends assign_feedback_plugin {
return $this->enabledcache;
}
/**
* Automatically hide the setting for the editpdf feedback plugin.
* Prevent enabling this plugin if ghostscript is not available.
*
* @return bool false
*/
public function is_configurable() {
return false;
return $this->is_available();
}
/**

View File

@ -24,6 +24,11 @@
defined('MOODLE_INTERNAL') || die();
// Enabled by default.
$settings->add(new admin_setting_configcheckbox('assignfeedback_editpdf/default',
new lang_string('default', 'assignfeedback_editpdf'),
new lang_string('default_help', 'assignfeedback_editpdf'), 1));
// Stamp files setting.
$name = 'assignfeedback_editpdf/stamps';
$title = get_string('stamps','assignfeedback_editpdf');