Skip to content

Commit

Permalink
MDL-19807 Converted print_box* to $OUTPUT->box*
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Aug 10, 2009
1 parent 883fa98 commit d4b1d58
Show file tree
Hide file tree
Showing 24 changed files with 563 additions and 558 deletions.
14 changes: 7 additions & 7 deletions mod/feedback/analysis.php
Expand Up @@ -21,11 +21,11 @@
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
print_error('invalidcoursemodule');
}

if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
print_error('coursemisconf');
}

if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
print_error('invalidcoursemodule');
}
Expand Down Expand Up @@ -57,13 +57,13 @@
$strfeedbacks = get_string("modulenameplural", "feedback");
$strfeedback = get_string("modulename", "feedback");
$buttontext = update_module_button($cm->id, $course->id, $strfeedback);

$navlinks = array();
$navlinks[] = array('name' => $strfeedbacks, 'link' => "index.php?id=$course->id", 'type' => 'activity');
$navlinks[] = array('name' => format_string($feedback->name), 'link' => "", 'type' => 'activityinstance');

$navigation = build_navigation($navlinks);

print_header_simple(format_string($feedback->name), "",
$navigation, "", "", true, $buttontext, navmenu($course, $cm));

Expand All @@ -73,7 +73,7 @@

//print analysed items
// print_simple_box_start("center", '80%');
print_box_start('generalbox boxaligncenter boxwidthwide');
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');

//get the groupid
$groupselect = groups_print_activity_menu($cm, 'analysis.php?id=' . $cm->id.'&do_show=analysis', true);
Expand Down Expand Up @@ -146,7 +146,7 @@
}
echo '</td></tr></table></div>';
// print_simple_box_end();
print_box_end();
echo $OUTPUT->box_end();

echo $OUTPUT->footer();

Expand Down
42 changes: 21 additions & 21 deletions mod/feedback/analysis_course.php
Expand Up @@ -10,54 +10,54 @@

require_once("../../config.php");
require_once("lib.php");

// $SESSION->feedback->current_tab = 'analysis';
$current_tab = 'analysis';

$id = required_param('id', PARAM_INT); //the POST dominated the GET
$coursefilter = optional_param('coursefilter', '0', PARAM_INT);
$courseitemfilter = optional_param('courseitemfilter', '0', PARAM_INT);
$courseitemfiltertyp = optional_param('courseitemfiltertyp', '0', PARAM_ALPHANUM);
// $searchcourse = optional_param('searchcourse', '', PARAM_ALPHAEXT);
$searchcourse = optional_param('searchcourse', '', PARAM_RAW);
$courseid = optional_param('courseid', false, PARAM_INT);

if(($searchcourse OR $courseitemfilter OR $coursefilter) AND !confirm_sesskey()) {
print_error('invalidsesskey');
}

if ($id) {
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
print_error('invalidcoursemodule');
}

if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
print_error('coursemisconf');
}

if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
print_error('invalidcoursemodule');
}
}
$capabilities = feedback_load_capabilities($cm->id);

require_login($course->id, true, $cm);

if( !( (intval($feedback->publish_stats) == 1) || $capabilities->viewreports)) {
print_error('error');
}

/// Print the page header
$strfeedbacks = get_string("modulenameplural", "feedback");
$strfeedback = get_string("modulename", "feedback");
$buttontext = update_module_button($cm->id, $course->id, $strfeedback);

$navlinks = array();
$navlinks[] = array('name' => $strfeedbacks, 'link' => "index.php?id=$course->id", 'type' => 'activity');
$navlinks[] = array('name' => format_string($feedback->name), 'link' => "", 'type' => 'activityinstance');

$navigation = build_navigation($navlinks);

print_header_simple(format_string($feedback->name), "",
$navigation, "", "", true, $buttontext, navmenu($course, $cm));

Expand All @@ -66,7 +66,7 @@

//print the analysed items
// print_simple_box_start("center", '80%');
print_box_start('generalbox boxaligncenter boxwidthwide');
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');

if( $capabilities->viewreports ) {
//button "export to excel"
Expand All @@ -77,16 +77,16 @@
print_single_button($export_button_link, $export_button_options, $export_button_label, 'post');
echo '</div>';
}

//get the groupid
//lstgroupid is the choosen id
$mygroupid = false;
//get completed feedbacks
$completedscount = feedback_get_completeds_group_count($feedback, $mygroupid, $coursefilter);

//show the count
echo '<b>'.get_string('completed_feedbacks', 'feedback').': '.$completedscount. '</b><br />';

// get the items of the feedback
$items = $DB->get_records('feedback_item', array('feedback'=>$feedback->id, 'hasvalue'=>1), 'position');
//show the count
Expand Down Expand Up @@ -138,11 +138,11 @@
'{feedback_value} fv, {feedback_item} fi '.
'where c.id = fv.course_id and fv.item = fi.id '.
'and fi.feedback = ?'.
'and
'and
(c.shortname '.$DB->sql_ilike().' ?
OR c.fullname '.$DB->sql_ilike().' ?)';
$params = array($feedback->id, "%$searchcourse%", "%$searchcourse%");

if ($courses = $DB->get_records_sql_menu($sql, $params)) {

echo ' ' . get_string('filter_by_course', 'feedback') . ': ';
Expand All @@ -159,7 +159,7 @@
echo '<tr><td>';
foreach($items as $item) {
if($item->hasvalue == 0) continue;
echo '<table width="100%" class="generalbox">';
echo '<table width="100%" class="generalbox">';
//get the class from item-typ
$itemclass = 'feedback_item_'.$item->typ;
//get the instance of the item-class
Expand All @@ -173,16 +173,16 @@
$itemobj->print_analysed($item, $printnr, $mygroupid, $coursefilter);
if (preg_match('/rated$/i', $item->typ)) {
echo '<tr><td colspan="2"><a href="#" onclick="setcourseitemfilter('.$item->id.',\''.$item->typ.'\'); return false;">'.
get_string('sort_by_course', 'feedback').'</a></td></tr>';
get_string('sort_by_course', 'feedback').'</a></td></tr>';
}
echo '</table>';
}
echo '</td></tr>';
}
echo '</table></div>';
echo '</form>';
print_box_end();
echo $OUTPUT->box_end();

echo $OUTPUT->footer();

?>

0 comments on commit d4b1d58

Please sign in to comment.