Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-19488 - allow the creation of a "Public" feedback

  • Loading branch information...
commit e70dab06469d0c818a2bd39931f1fd5d8d921676 1 parent 485ec59
@grabs grabs authored
View
2  mod/feedback/edit.php
@@ -99,7 +99,7 @@
$savereturn = 'notsaved_name';
}else {
//if the feedback is located on the frontpage then templates can be public
- if($CFG->frontpage === $course->id && has_capability('mod/feedback:createpublictemplate', $context)) {
+ if(SITEID === $course->id && has_capability('mod/feedback:createpublictemplate', $context)) {
$create_template_formdata->ispublic = isset($create_template_formdata->ispublic) ? 1 : 0;
}else {
$create_template_formdata->ispublic = 0;
View
2  mod/feedback/edit_form.php
@@ -145,7 +145,7 @@ function set_form_elements(){
$elementgroup[] =& $mform->createElement('text', 'templatename', get_string('name', 'feedback'), array('size'=>'40', 'maxlength'=>'200'));
//If the feedback is located on the frontpage the we can create public templates
- if($CFG->frontpage === $this->feedbackdata->course->id) {
+ if(SITEID === $this->feedbackdata->course->id) {
if(has_capability('mod/feedback:createpublictemplate', $this->feedbackdata->context)) {
$elementgroup[] =& $mform->createElement('checkbox', 'ispublic', get_string('public', 'feedback'), get_string('public', 'feedback'));
}
View
2  mod/feedback/lib.php
@@ -1228,7 +1228,7 @@ function feedback_get_template_list($course, $onlyownorpublic = '') {
$templates = $DB->get_records('feedback_template', array('course'=>$course->id), 'name');
break;
case 'public':
- $templates = $DB->get_records('feedback_template', array('course'=>$CFG->frontpage, 'ispublic'=>1), 'name');
+ $templates = $DB->get_records('feedback_template', array('course'=>SITEID, 'ispublic'=>1), 'name');
break;
}
return $templates;
Please sign in to comment.
Something went wrong with that request. Please try again.