public templates deactivated

This commit is contained in:
Andreas Grabs 2010-05-02 22:17:26 +00:00
parent c0772270d7
commit 71720abd2f
2 changed files with 10 additions and 7 deletions

View File

@ -99,11 +99,12 @@ if(isset($create_template_formdata->savetemplate) && $create_template_formdata->
{
$savereturn = 'notsaved_name';
}else {
if(has_capability('mod/feedback:createpublictemplate', $context)) {
$create_template_formdata->ispublic = isset($create_template_formdata->ispublic) ? 1 : 0;
}else {
//public templates are currently deaktivated
// if(has_capability('mod/feedback:createpublictemplate', $context)) {
// $create_template_formdata->ispublic = isset($create_template_formdata->ispublic) ? 1 : 0;
// }else {
$create_template_formdata->ispublic = 0;
}
// }
if(!feedback_save_as_template($feedback, $create_template_formdata->templatename, $create_template_formdata->ispublic))
{
$savereturn = 'failed';

View File

@ -129,9 +129,11 @@ class feedback_edit_create_template_form extends moodleform {
$elementgroup[] =& $mform->createElement('static', 'templatenamelabel', get_string('name', 'feedback'));
$elementgroup[] =& $mform->createElement('text', 'templatename', get_string('name', 'feedback'), array('size'=>'40', 'maxlength'=>'200'));
if(has_capability('mod/feedback:createpublictemplate', $this->feedbackdata->context)) {
$elementgroup[] =& $mform->createElement('checkbox', 'ispublic', get_string('public', 'feedback'), get_string('public', 'feedback'));
}
//public templates are currently deactivated
// if(has_capability('mod/feedback:createpublictemplate', $this->feedbackdata->context)) {
// $elementgroup[] =& $mform->createElement('checkbox', 'ispublic', get_string('public', 'feedback'), get_string('public', 'feedback'));
// }
// buttons
$elementgroup[] =& $mform->createElement('submit', 'create_template', get_string('save_as_new_template', 'feedback'));