Permalink
Browse files

MDL-19488 mod_feedback: Coding style improvement

  • Loading branch information...
1 parent 629aa44 commit f35c45006ae4d6764bcdc9fc8ff946009ab1bf2d Sam Hemelryk committed Oct 16, 2011
Showing with 28 additions and 30 deletions.
  1. +27 −27 mod/feedback/delete_template.php
  2. +0 −2 mod/feedback/edit_form.php
  3. +1 −1 mod/feedback/lib.php
@@ -95,7 +95,7 @@
/// Print the page header
$strfeedbacks = get_string("modulenameplural", "feedback");
$strfeedback = get_string("modulename", "feedback");
-$str_delete_feedback = get_string('delete_template','feedback');
+$strdeletefeedback = get_string('delete_template','feedback');
$PAGE->set_heading(format_string($course->fullname));
$PAGE->set_title(format_string($feedback->name));
@@ -108,7 +108,7 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-echo $OUTPUT->heading($str_delete_feedback);
+echo $OUTPUT->heading($strdeletefeedback);
if($shoulddelete == 1) {
echo $OUTPUT->box_start('generalbox errorboxcontent boxaligncenter boxwidthnormal');
@@ -125,17 +125,17 @@
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
$tablecolumns = array('template', 'action');
$tableheaders = array(get_string('template', 'feedback'), '');
- $table_course = new flexible_table('feedback_template_course_table');
+ $tablecourse = new flexible_table('feedback_template_course_table');
- $table_course->define_columns($tablecolumns);
- $table_course->define_headers($tableheaders);
- $table_course->define_baseurl($deleteurl);
- $table_course->column_style('action', 'width', '10%');
+ $tablecourse->define_columns($tablecolumns);
+ $tablecourse->define_headers($tableheaders);
+ $tablecourse->define_baseurl($deleteurl);
+ $tablecourse->column_style('action', 'width', '10%');
- $table_course->sortable(false);
- $table_course->set_attribute('width', '100%');
- $table_course->set_attribute('class', 'generaltable');
- $table_course->setup();
+ $tablecourse->sortable(false);
+ $tablecourse->set_attribute('width', '100%');
+ $tablecourse->set_attribute('class', 'generaltable');
+ $tablecourse->setup();
foreach($templates as $template) {
$data = array();
@@ -146,10 +146,10 @@
'shoulddelete'=>1,
));
- $data[] = $OUTPUT->single_button($url, $str_delete_feedback, 'post');
- $table_course->add_data($data);
+ $data[] = $OUTPUT->single_button($url, $strdeletefeedback, 'post');
+ $tablecourse->add_data($data);
}
- $table_course->finish_output();
+ $tablecourse->finish_output();
echo $OUTPUT->box_end();
}
//now we get the public templates if it is permitted
@@ -162,19 +162,19 @@
}else {
echo $OUTPUT->heading(get_string('public', 'feedback'), 3);
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
- $tablecolumns = $tablecolumns = array('template', 'action');
+ $tablecolumns = array('template', 'action');
$tableheaders = array(get_string('template', 'feedback'), '');
- $table_public = new flexible_table('feedback_template_public_table');
+ $tablepublic = new flexible_table('feedback_template_public_table');
- $table_public->define_columns($tablecolumns);
- $table_public->define_headers($tableheaders);
- $table_public->define_baseurl($deleteurl);
- $table_public->column_style('action', 'width', '10%');
+ $tablepublic->define_columns($tablecolumns);
+ $tablepublic->define_headers($tableheaders);
+ $tablepublic->define_baseurl($deleteurl);
+ $tablepublic->column_style('action', 'width', '10%');
- $table_public->sortable(false);
- $table_public->set_attribute('width', '100%');
- $table_public->set_attribute('class', 'generaltable');
- $table_public->setup();
+ $tablepublic->sortable(false);
+ $tablepublic->set_attribute('width', '100%');
+ $tablepublic->set_attribute('class', 'generaltable');
+ $tablepublic->setup();
// echo $OUTPUT->heading(get_string('public', 'feedback'), 3);
@@ -188,10 +188,10 @@
'shoulddelete'=>1,
));
- $data[] = $OUTPUT->single_button($url, $str_delete_feedback, 'post');
- $table_public->add_data($data);
+ $data[] = $OUTPUT->single_button($url, $strdeletefeedback, 'post');
+ $tablepublic->add_data($data);
}
- $table_public->finish_output();
+ $tablepublic->finish_output();
echo $OUTPUT->box_end();
}
}
@@ -131,8 +131,6 @@ function set_feedbackdata($data) {
}
function set_form_elements(){
- global $CFG;
-
$mform =& $this->_form;
// $capabilities = $this->feedbackdata->capabilities;
@@ -220,7 +220,7 @@ function feedback_pluginfile($course, $cm, $context, $filearea, $args, $forcedow
}
}
- if ($context->contextlevel == CONTEXT_COURSE) {
+ if ($context->contextlevel == CONTEXT_COURSE || $context->contextlevel == CONTEXT_SYSTEM) {
if ($filearea !== 'template') {
return false;
}

0 comments on commit f35c450

Please sign in to comment.