Skip to content

Commit

Permalink
MDL-42672 blocks: warnings on /mod/xxx/index.php for frontpage course
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Nov 6, 2013
1 parent 7fd16ca commit 09af1e2
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion course/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
}

$strresources = get_string('resources');
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string('name');
$strintro = get_string('moduleintro');
$strlastmodified = get_string('lastmodified');
Expand Down Expand Up @@ -100,6 +99,7 @@
$table->attributes['class'] = 'generaltable mod_index';

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strintro);
$table->align = array ('center', 'left', 'left');
} else {
Expand Down
3 changes: 2 additions & 1 deletion mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2003,11 +2003,12 @@ private function view_course_index() {
return $o;
}

$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strsectionname = '';
$usesections = course_format_uses_sections($course->format);
$modinfo = get_fast_modinfo($course);

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$sections = $modinfo->get_section_info_all();
}
$courseindexsummary = new assign_course_index_summary($usesections, $strsectionname);
Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
$strassignments = get_string("modulenameplural", "assignment");
$strassignment = get_string("modulename", "assignment");
$strassignmenttype = get_string("assignmenttype", "assignment");
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string("name");
$strduedate = get_string("duedate", "assignment");
$strsubmitted = get_string("submitted", "assignment");
Expand All @@ -43,6 +42,7 @@
$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strassignmenttype, $strduedate, $strsubmitted, $strgrade);
} else {
$table->head = array ($strname, $strassignmenttype, $strduedate, $strsubmitted, $strgrade);
Expand Down
2 changes: 1 addition & 1 deletion mod/book/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
// Get all required strings
$strbooks = get_string('modulenameplural', 'mod_book');
$strbook = get_string('modulename', 'mod_book');
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string('name');
$strintro = get_string('moduleintro');
$strlastmodified = get_string('lastmodified');
Expand Down Expand Up @@ -66,6 +65,7 @@
$table->attributes['class'] = 'generaltable mod_index';

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strintro);
$table->align = array ('center', 'left', 'left');
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

/// Get all required strings

$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strchats = get_string('modulenameplural', 'chat');
$strchat = get_string('modulename', 'chat');

Expand Down Expand Up @@ -51,6 +50,7 @@
$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname);
$table->align = array ('center', 'left');
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/choice/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

$strchoice = get_string("modulename", "choice");
$strchoices = get_string("modulenameplural", "choice");
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$PAGE->set_title($strchoices);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add($strchoices);
Expand Down Expand Up @@ -51,6 +50,7 @@
$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, get_string("question"), get_string("answer"));
$table->align = array ("center", "left", "left");
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/data/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

add_to_log($course->id, "data", "view all", "index.php?id=$course->id", "");

$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string('name');
$strdata = get_string('modulename','data');
$strdataplural = get_string('modulenameplural','data');
Expand All @@ -67,6 +66,7 @@
$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strdescription, $strentries, $strnumnotapproved);
$table->align = array ('center', 'center', 'center', 'center', 'center');
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/feedback/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@

$timenow = time();
$strname = get_string("name");
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strresponses = get_string('responses', 'feedback');

$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
if (has_capability('mod/feedback:viewreports', $context)) {
$table->head = array ($strsectionname, $strname, $strresponses);
$table->align = array ("center", "left", 'center');
Expand Down
2 changes: 1 addition & 1 deletion mod/folder/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

$strfolder = get_string('modulename', 'folder');
$strfolders = get_string('modulenameplural', 'folder');
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string('name');
$strintro = get_string('moduleintro');
$strlastmodified = get_string('lastmodified');
Expand All @@ -60,6 +59,7 @@
$table->attributes['class'] = 'generaltable mod_index';

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strintro);
$table->align = array ('center', 'left', 'left');
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/glossary/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
/// Print the list of instances (your module will probably extend this)

$timenow = time();
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string("name");
$strentries = get_string("entries", "glossary");

$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strentries);
$table->align = array ("CENTER", "LEFT", "CENTER");
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/imscp/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

$strimscp = get_string('modulename', 'imscp');
$strimscps = get_string('modulenameplural', 'imscp');
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string('name');
$strintro = get_string('moduleintro');
$strlastmodified = get_string('lastmodified');
Expand All @@ -60,6 +59,7 @@
$table->attributes['class'] = 'generaltable mod_index';

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strintro);
$table->align = array ('center', 'left', 'left');
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/lesson/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
/// Print the list of instances (your module will probably extend this)

$timenow = time();
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string("name");
$strgrade = get_string("grade");
$strdeadline = get_string("deadline", "lesson");
$strnodeadline = get_string("nodeadline", "lesson");
$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strgrade, $strdeadline);
$table->align = array ("center", "left", "center", "center");
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/lti/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@
// Print the list of instances (your module will probably extend this)
$timenow = time();
$strname = get_string("name");
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$usesections = course_format_uses_sections($course->format);

$table = new html_table();
$table->attributes['class'] = 'generaltable mod_index';

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname);
$table->align = array ("center", "left");
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/page/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

$strpage = get_string('modulename', 'page');
$strpages = get_string('modulenameplural', 'page');
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string('name');
$strintro = get_string('moduleintro');
$strlastmodified = get_string('lastmodified');
Expand All @@ -61,6 +60,7 @@
$table->attributes['class'] = 'generaltable mod_index';

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strintro);
$table->align = array ('center', 'left', 'left');
} else {
Expand Down
6 changes: 5 additions & 1 deletion mod/quiz/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@
array_push($align, 'left');
}

array_unshift($headings, get_string('sectionname', 'format_'.$course->format));
if (course_format_uses_sections($course->format)) {
array_unshift($headings, get_string('sectionname', 'format_'.$course->format));
} else {
array_unshift($headings, '');
}
array_unshift($align, 'center');

$showing = '';
Expand Down
2 changes: 1 addition & 1 deletion mod/scorm/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

$strscorm = get_string("modulename", "scorm");
$strscorms = get_string("modulenameplural", "scorm");
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string("name");
$strsummary = get_string("summary");
$strreport = get_string("report", 'scorm');
Expand Down Expand Up @@ -64,6 +63,7 @@
$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strsummary, $strreport);
$table->align = array ("center", "left", "left", "left");
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/survey/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
add_to_log($course->id, "survey", "view all", "index.php?id=$course->id", "");

$strsurveys = get_string("modulenameplural", "survey");
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string("name");
$strstatus = get_string("status");
$strdone = get_string("done", "survey");
Expand All @@ -39,6 +38,7 @@
$table->width = '100%';

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strstatus);
} else {
$table->head = array ($strname, $strstatus);
Expand Down
2 changes: 1 addition & 1 deletion mod/url/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

$strurl = get_string('modulename', 'url');
$strurls = get_string('modulenameplural', 'url');
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string('name');
$strintro = get_string('moduleintro');
$strlastmodified = get_string('lastmodified');
Expand All @@ -60,6 +59,7 @@
$table->attributes['class'] = 'generaltable mod_index';

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname, $strintro);
$table->align = array ('center', 'left', 'left');
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/wiki/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
/// Print the list of instances (your module will probably extend this)

$timenow = time();
$strsectionname = get_string('sectionname', 'format_' . $course->format);
$strname = get_string("name");
$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_' . $course->format);
$table->head = array($strsectionname, $strname);
} else {
$table->head = array($strname);
Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
$usesections = course_format_uses_sections($course->format);

$timenow = time();
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$strname = get_string('name');
$table = new html_table();

if ($usesections) {
$strsectionname = get_string('sectionname', 'format_'.$course->format);
$table->head = array ($strsectionname, $strname);
$table->align = array ('center', 'left');
} else {
Expand Down

0 comments on commit 09af1e2

Please sign in to comment.