MDL-38856 reposition activity group control and fixed titles in chat, database and forum

This commit is contained in:
Andrew Davis 2013-08-22 12:03:23 +07:00
parent 438715218d
commit 66e2b9f8c2
19 changed files with 62 additions and 56 deletions

View File

@ -117,7 +117,11 @@ if (!empty($refresh) and data_submitted()) {
$PAGE->set_title("$strchat: $course->shortname: ".format_string($chat->name,true)."$groupname");
echo $OUTPUT->header();
echo $OUTPUT->container_start(null, 'page-mod-chat-gui_basic');
echo $OUTPUT->heading(get_string('participants'), 2, 'mdl-left');
echo $OUTPUT->heading(format_string($course->shortname), 1);
echo $OUTPUT->heading(format_string($chat->name), 2);
echo $OUTPUT->heading(get_string('participants'), 3);
echo $OUTPUT->box_start('generalbox', 'participants');
echo '<ul>';
@ -155,7 +159,7 @@ echo '</form>';
echo '</div>';
echo '<div id="messages">';
echo $OUTPUT->heading(get_string('messages', 'chat'), 2, 'mdl-left');
echo $OUTPUT->heading(get_string('messages', 'chat'), 3);
$allmessages = array();
$options = new stdClass();

View File

@ -29,6 +29,7 @@ $PAGE->navbar->add($strchats);
$PAGE->set_title($strchats);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading($strchats, 2);
/// Get all the appropriate data

View File

@ -65,6 +65,7 @@
$PAGE->navbar->add($strchatreport);
$PAGE->set_title(format_string($chat->name).": $strchatreport");
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($chat->name), 2);
/// Check to see if groups are being used here
$groupmode = groups_get_activity_groupmode($cm);
@ -133,8 +134,7 @@
$PAGE->set_title(format_string($chat->name).": $strchatreport");
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($chat->name).': '.get_string('sessions', 'chat'));
echo $OUTPUT->heading(format_string($chat->name).': '.get_string('sessions', 'chat'), 2);
/// Check to see if groups are being used here
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used
@ -168,16 +168,16 @@
/// Get the messages
if (empty($messages)) { /// May have already got them above
if (!$messages = $DB->get_records_select('chat_messages', "chatid = :chatid $groupselect", $params, "timestamp DESC")) {
echo $OUTPUT->heading(get_string('nomessages', 'chat'));
echo $OUTPUT->heading(get_string('nomessages', 'chat'), 3);
echo $OUTPUT->footer();
exit;
}
}
if ($show_all) {
echo $OUTPUT->heading(get_string('listing_all_sessions', 'chat') .
'&nbsp;<a href="report.php?id='.$cm->id.'&amp;show_all=0">' .
get_string('list_complete_sessions', 'chat') . '</a>');
$headingstr = get_string('listing_all_sessions', 'chat') . '&nbsp;';
$headingstr .= html_writer::link("report.php?id={$cm->id}&amp;show_all=0", get_string('list_complete_sessions', 'chat'));
echo $OUTPUT->heading($headingstr, 3);
}
/// Show all the sessions
@ -271,10 +271,10 @@
if (!$show_all and $complete_sessions == 0) {
echo $OUTPUT->heading(get_string('no_complete_sessions_found', 'chat') .
'&nbsp;<a href="report.php?id='.$cm->id.'&amp;show_all=1">' .
get_string('list_all_sessions', 'chat') .
'</a>');
echo html_writer::start_tag('p');
echo get_string('no_complete_sessions_found', 'chat') . '&nbsp;';
echo html_writer::link('report.php?id='.$cm->id.'&amp;show_all=1', get_string('list_all_sessions', 'chat'));
echo html_writer::end_tag('p');
}
/// Finish the page

View File

@ -38,4 +38,3 @@
.path-mod-chat .yui-layout .yui-layout-hd {border:0;}
.path-mod-chat .yui-layout .yui-layout-unit div.yui-layout-bd {border:0;background: transparent;}
.path-mod-chat .yui-layout .yui-layout-unit div.yui-layout-unit-right {background: white;}
.path-mod-chat .yui-layout-doc .yui-layout-unit .yui-layout-wrap .yui-layout-hd h2 {font-size:100%;padding:0px;font-weight:normal;}

View File

@ -95,7 +95,6 @@ echo $OUTPUT->header();
/// Check to see if groups are being used here
$groupmode = groups_get_activity_groupmode($cm);
$currentgroup = groups_get_activity_group($cm, true);
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/chat/view.php?id=$cm->id");
// url parameters
$params = array();
@ -108,12 +107,14 @@ if ($currentgroup) {
$groupparam = "";
}
echo $OUTPUT->heading(format_string($chat->name));
echo $OUTPUT->heading(format_string($chat->name), 2);
if ($chat->intro) {
echo $OUTPUT->box(format_module_intro('chat', $chat, $cm->id), 'generalbox', 'intro');
}
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/chat/view.php?id=$cm->id");
if (has_capability('mod/chat:chat', $context)) {
/// Print the main part of the page
echo $OUTPUT->box_start('generalbox', 'enterlink');
@ -161,7 +162,7 @@ chat_delete_old_users();
if ($chatusers = chat_get_users($chat->id, $currentgroup, $cm->groupingid)) {
$timenow = time();
echo $OUTPUT->box_start('generalbox', 'chatcurrentusers');
echo $OUTPUT->heading($strcurrentusers, 4);
echo $OUTPUT->heading($strcurrentusers, 3);
echo '<table>';
foreach ($chatusers as $chatuser) {
$lastping = $timenow - $chatuser->lastmessageping;

View File

@ -249,10 +249,9 @@ if ($datarecord = data_submitted() and confirm_sesskey()) {
/// Print the page header
echo $OUTPUT->header();
groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/data/edit.php?d='.$data->id);
echo $OUTPUT->heading(format_string($data->name));
echo $OUTPUT->heading(format_string($data->name), 2);
echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/data/edit.php?d='.$data->id);
/// Print the tabs
@ -277,7 +276,7 @@ echo '<input name="sesskey" value="'.sesskey().'" type="hidden" />';
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
if (!$rid){
echo $OUTPUT->heading(get_string('newentry','data'), 2);
echo $OUTPUT->heading(get_string('newentry','data'), 3);
}
/******************************************

View File

@ -84,10 +84,11 @@ if($mform->is_cancelled()) {
$PAGE->set_title($data->name);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($data->name), 2);
echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
$url = new moodle_url('/mod/data/export.php', array('d' => $d));
groups_print_activity_menu($cm, $url);
echo $OUTPUT->heading(format_string($data->name));
echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
// these are for the tab display
$currentgroup = groups_get_activity_group($cm);

View File

@ -50,6 +50,7 @@ $PAGE->navbar->add($strdata, new moodle_url('/mod/data/index.php', array('id'=>$
$PAGE->set_title($strdata);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading($strdataplural, 2);
if (! $datas = get_all_instances_in_course("data", $course)) {
notice(get_string('thereareno', 'moodle',$strdataplural) , "$CFG->wwwroot/course/view.php?id=$course->id");

View File

@ -279,7 +279,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/
echo '<input type="hidden" name="type" value="'.$this->type.'" />'."\n";
echo '<input name="sesskey" value="'.sesskey().'" type="hidden" />'."\n";
echo $OUTPUT->heading($this->name());
echo $OUTPUT->heading($this->name(), 3);
require_once($CFG->dirroot.'/mod/data/field/'.$this->type.'/mod.html');
@ -1986,14 +1986,13 @@ function data_print_header($course, $cm, $data, $currenttab='') {
$PAGE->set_title($data->name);
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($data->name));
echo $OUTPUT->heading(format_string($data->name), 2);
echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
// Groups needed for Add entry tab
// Groups needed for Add entry tab
$currentgroup = groups_get_activity_group($cm);
$groupmode = groups_get_activity_groupmode($cm);
echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
// Print the tabs
if ($currenttab) {

View File

@ -97,7 +97,7 @@ $form_save->set_data(array('d' => $data->id, 'name'=>$data->name));
/* Output */
if (!$form_export->is_submitted()) {
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($data->name));
echo $OUTPUT->heading(format_string($data->name), 2);
// Needed for tabs.php
$currenttab = 'presets';
@ -243,13 +243,13 @@ if (optional_param('sesskey', false, PARAM_BOOL) && confirm_sesskey()) {
}
// Export forms
echo $OUTPUT->heading(get_string('export', 'data'));
echo $OUTPUT->heading(get_string('export', 'data'), 3);
$form_export->display();
$form_save->display();
// Import forms
echo $OUTPUT->heading(get_string('import'));
echo $OUTPUT->heading(get_string('import'), 3);
$form_importzip->display();
$form_importexisting->display();
echo $OUTPUT->footer();
echo $OUTPUT->footer();

View File

@ -32,7 +32,7 @@ class mod_data_renderer extends plugin_renderer_base {
}
if (!empty($newfields)) {
$html .= $this->output->heading_with_help($strfieldmappings, 'fieldmappings', 'data');
$html .= $this->output->heading_with_help($strfieldmappings, 'fieldmappings', 'data', '', '', 3);
$table = new html_table();
$table->data = array();

View File

@ -66,4 +66,4 @@
.dir-rtl .mod-data-default-template .template-field {text-align:left;}
.dir-rtl .mod-data-default-template .template-token {text-align:right;}
.dir-rtl .mod-data-default-template searchcontrols {text-align:left;}
.dir-rtl .mod-data-default-template searchcontrols {text-align:left;}

View File

@ -92,15 +92,13 @@ $PAGE->set_title($data->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_pagelayout('report');
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($data->name));
echo $OUTPUT->heading(format_string($data->name), 2);
echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
/// Groups needed for Add entry tab
$currentgroup = groups_get_activity_group($cm);
$groupmode = groups_get_activity_groupmode($cm);
echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
/// Print the tabs.
$currenttab = 'templates';
include('tabs.php');

View File

@ -324,8 +324,6 @@
echo $OUTPUT->header();
/// Check to see if groups are being used here
$returnurl = $CFG->wwwroot . '/mod/data/view.php?d='.$data->id.'&amp;search='.s($search).'&amp;sort='.s($sort).'&amp;order='.s($order).'&amp;';
groups_print_activity_menu($cm, $returnurl);
$currentgroup = groups_get_activity_group($cm);
$groupmode = groups_get_activity_groupmode($cm);
$canmanageentries = has_capability('mod/data:manageentries', $context);
@ -344,7 +342,7 @@
}
}
echo $OUTPUT->heading(format_string($data->name));
echo $OUTPUT->heading(format_string($data->name), 2);
// Do we need to show a link to the RSS feed for the records?
//this links has been Settings (database activity administration) block
@ -360,6 +358,9 @@
$options->noclean = true;
}
echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro');
$returnurl = $CFG->wwwroot . '/mod/data/view.php?d='.$data->id.'&amp;search='.s($search).'&amp;sort='.s($sort).'&amp;order='.s($order).'&amp;';
groups_print_activity_menu($cm, $returnurl);
/// Delete any requested records

View File

@ -160,6 +160,7 @@
$PAGE->set_heading($course->fullname);
$PAGE->set_button($searchform);
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($forum->name), 2);
/// Check to see if groups are being used in this forum
/// If so, make sure the current person is allowed to see this discussion

View File

@ -477,12 +477,12 @@ if (!isguestuser() && isloggedin() && $can_subscribe) {
}
if ($generalforums) {
echo $OUTPUT->heading(get_string('generalforums', 'forum'));
echo $OUTPUT->heading(get_string('generalforums', 'forum'), 2);
echo html_writer::table($generaltable);
}
if ($learningforums) {
echo $OUTPUT->heading(get_string('learningforums', 'forum'));
echo $OUTPUT->heading(get_string('learningforums', 'forum'), 2);
echo html_writer::table($learningtable);
}

View File

@ -372,6 +372,7 @@ if (!empty($forum)) { // User is starting a new discussion in a forum
forum_go_back_to("discuss.php?d=$post->discussion"));
}
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($forum->name), 2);
echo $OUTPUT->confirm(get_string("deletesureplural", "forum", $replycount+1),
"post.php?delete=$delete&confirm=$delete",
$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#p'.$post->id);
@ -385,6 +386,7 @@ if (!empty($forum)) { // User is starting a new discussion in a forum
}
} else {
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($forum->name), 2);
echo $OUTPUT->confirm(get_string("deletesure", "forum", $replycount),
"post.php?delete=$delete&confirm=$delete",
$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#p'.$post->id);
@ -467,7 +469,8 @@ if (!empty($forum)) { // User is starting a new discussion in a forum
$PAGE->set_title(format_string($discussion->name).": ".format_string($post->subject));
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('pruneheading', 'forum'));
echo $OUTPUT->heading(format_string($forum->name), 2);
echo $OUTPUT->heading(get_string('pruneheading', 'forum'), 3);
echo '<center>';
include('prune.html');
@ -860,6 +863,7 @@ $PAGE->set_title("$course->shortname: $strdiscussionname ".format_string($toppos
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($forum->name), 2);
// checkup
if (!empty($parent) && !forum_user_can_see_post($forum, $discussion, $post, null, $cm)) {

View File

@ -146,7 +146,9 @@ if (!$posts = forum_search_posts($searchterms, $course->id, $page*$perpage, $per
$PAGE->set_title($strsearchresults);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string("noposts", "forum"));
echo $OUTPUT->heading($strforums, 2);
echo $OUTPUT->heading($strsearchresults, 3);
echo $OUTPUT->heading(get_string("noposts", "forum"), 4);
if (!$individualparams) {
$words = $search;
@ -189,7 +191,8 @@ echo '<a href="search.php?id='.$course->id.
'">'.get_string('advancedsearch','forum').'...</a>';
echo '</div>';
echo $OUTPUT->heading("$strsearchresults: $totalcount");
echo $OUTPUT->heading($strforums, 2);
echo $OUTPUT->heading("$strsearchresults: $totalcount", 3);
$url = new moodle_url('search.php', array('search' => $search, 'id' => $course->id, 'perpage' => $perpage));
echo $OUTPUT->paging_bar($totalcount, $page, $perpage, $url);

View File

@ -121,10 +121,13 @@
notice(get_string('noviewdiscussionspermission', 'forum'));
}
echo $OUTPUT->heading(format_string($forum->name), 2);
if (!empty($forum->intro) && $forum->type != 'single' && $forum->type != 'teacher') {
echo $OUTPUT->box(format_module_intro('forum', $forum, $cm->id), 'generalbox', 'intro');
}
/// find out current groups mode
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/forum/view.php?id=' . $cm->id);
$currentgroup = groups_get_activity_group($cm);
$groupmode = groups_get_activity_groupmode($cm);
/// Okay, we can show the discussions. Log the forum view.
if ($cm->id) {
@ -187,9 +190,6 @@
break;
case 'eachuser':
if (!empty($forum->intro)) {
echo $OUTPUT->box(format_module_intro('forum', $forum, $cm->id), 'generalbox', 'intro');
}
echo '<p class="mdl-align">';
if (forum_user_can_post_discussion($forum, null, -1, $cm)) {
print_string("allowsdiscussions", "forum");
@ -213,9 +213,6 @@
break;
case 'blog':
if (!empty($forum->intro)) {
echo $OUTPUT->box(format_module_intro('forum', $forum, $cm->id), 'generalbox', 'intro');
}
echo '<br />';
if (!empty($showall)) {
forum_print_latest_discussions($course, $forum, 0, 'plain', '', -1, -1, -1, 0, $cm);
@ -225,9 +222,6 @@
break;
default:
if (!empty($forum->intro)) {
echo $OUTPUT->box(format_module_intro('forum', $forum, $cm->id), 'generalbox', 'intro');
}
echo '<br />';
if (!empty($showall)) {
forum_print_latest_discussions($course, $forum, 0, 'header', '', -1, -1, -1, 0, $cm);