$blogtype = 'personal'; $returnurl = 'view.php?user='******'user', array('id' => $oubloginstance->userid)))) { print_error('invaliduserid'); } $PAGE->navbar->add(fullname($oubloguser), new moodle_url("/user/view.php", array('id' => $oubloguser->id))); $PAGE->navbar->add($blogname, new moodle_url("/mod/oublog/view.php", array('user' => $oubloginstance->userid))); $url = new moodle_url("{$CFG->wwwroot}/course/mod.php", array('update' => $cm->id, 'return' => true, 'sesskey' => sesskey())); } else { $blogtype = 'course'; $returnurl = 'view.php?id=' . $cm->id; $blogname = $oublog->name; $url = new moodle_url("{$CFG->wwwroot}/course/mod.php", array('update' => $cm->id, 'return' => true, 'sesskey' => sesskey())); } $CFG->additionalhtmlhead .= oublog_get_meta_tags($oublog, $oubloginstance, $currentgroup, $cm); $PAGE->set_title(format_string($oublog->name)); $PAGE->set_heading(format_string($course->fullname)); oublog_get_post_extranav($post, false); echo $OUTPUT->header(); // Print the main part of the page. echo '<div class="oublog-topofpage"></div>'; // Print blog posts. echo '<div id="middle-column" >'; echo '<div class="oublog-post-commented">'; echo $oublogoutput->render_post($cm, $oublog, $post, $returnurl, $blogtype, $canmanageposts, $canaudit, false, false); if (!empty($post->comments)) { // Code extracted to new renderer function. echo $oublogoutput->render_comments($post, $oublog, $canaudit, $canmanagecomments, false, $cm); } echo '</div>';
if (oublog_search_installed()) { $buttontext = <<<EOF <form action="search.php" method="get"><div> <input type="text" name="query" value=""/> <input type="hidden" name="id" value="{$cm->id}"/> <input type="submit" value="{$strblogsearch}"/> </div></form> EOF; } else { $buttontext = ''; } $buttontext .= update_module_button($cm->id, $course->id, $stroublog); $PAGEWILLCALLSKIPMAINDESTINATION = true; // OU accessibility feature $navigation = build_navigation($navlinks); print_header_simple(format_string($oublog->name), "", $navigation, "", oublog_get_meta_tags($oublog, 'all', '', $cm), true, $buttontext, navmenu($course, $cm)); print '<div class="oublog-topofpage"></div>'; // The left column ... if ($hasleft = !empty($CFG->showblocksonmodpages) && blocks_have_content($pageblocks, BLOCK_POS_LEFT)) { print '<div id="left-column">'; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); print '</div>'; } // The right column, BEFORE the middle-column. print '<div id="right-column">'; if (isloggedin() and !isguestuser()) { list($oublog, $oubloginstance) = oublog_get_personal_blog($USER->id); $blogeditlink = "<br /><a href=\"view.php\" class=\"oublog-links\">{$oubloginstance->name}</a>"; print_side_block(format_string($oublog->name), $blogeditlink, NULL, NULL, NULL, array('id' => 'oublog-summary'), get_string('bloginfo', 'oublog')); } if ($feeds = oublog_get_feedblock($oublog, 'all', '', false, $cm)) {
$event = \mod_oublog\event\site_entries_viewed::create($params); $event->add_record_snapshot('course_modules', $cm); $event->add_record_snapshot('course', $course); $event->trigger(); // Get strings. $stroublog = get_string('modulename', 'oublog'); $strnewposts = get_string('newerposts', 'oublog'); $strolderposts = get_string('olderposts', 'oublog'); $strfeeds = get_string('feeds', 'oublog'); $strblogsearch = get_string('searchblogs', 'oublog'); // Get Posts. list($posts, $recordcount) = oublog_get_posts($oublog, $context, $offset, $cm, null, -1, null, $tag, $canaudit, true); $PAGE->set_title(format_string($oublog->name)); $PAGE->set_heading(format_string($course->fullname)); $PAGE->navbar->add(format_string($oublog->name), new moodle_url('/mod/oublog/allposts.php')); $CFG->additionalhtmlhead .= oublog_get_meta_tags($oublog, 'all', '', $cm); // Generate extra navigation. if ($offset) { $a = new stdClass(); $a->from = $offset + 1; $a->to = $recordcount - $offset > OUBLOG_POSTS_PER_PAGE ? $offset + OUBLOG_POSTS_PER_PAGE : $recordcount; $PAGE->navbar->add(get_string('extranavolderposts', 'oublog', $a)); } else { if (!empty($tag)) { $PAGE->navbar->add(get_string('extranavtag', 'oublog', $tag)); } } if (oublog_search_installed()) { $buttontext = <<<EOF <form action="search.php" method="get"><div> <input type="text" name="query" value=""/>
$navlinks[] = array('name' => $blogname, 'link' => $returnurl, 'type' => 'activityinstance'); if ($extranav) { $navlinks[] = $extranav; } $navigation = build_navigation($navlinks); print_header_simple(format_string($oublog->name), "", $navigation, "", oublog_get_meta_tags($oublog, $oubloginstance, $currentgroup, $cm), true, update_module_button($cm->id, $course->id, $stroublog), navmenu($course, $cm)); } else { $blogtype = 'course'; $returnurl = 'view.php?id=' . $cm->id; $blogname = $oublog->name; $navlinks = array(); if ($extranav) { $navlinks[] = $extranav; } $navigation = build_navigation($navlinks, $cm); print_header_simple(format_string($oublog->name), "", $navigation, "", oublog_get_meta_tags($oublog, $oubloginstance, $currentgroup, $cm), true, update_module_button($cm->id, $course->id, $blogname), navmenu($course, $cm)); } /// Print the main part of the page echo '<div class="oublog-topofpage"></div>'; if (class_exists('ouflags') && ou_get_is_mobile() && $blogdets == 'show') { print '<div id="middle-column">'; ou_print_mobile_navigation(null, $blogdets, $postid); } else { // The right column, BEFORE the middle-column. print '<div id="right-column">'; } // Title & Print summary // Name, summary, related links oublog_print_summary_block($oublog, $oubloginstance, $canmanageposts); // Tag Cloud if ($tags = oublog_get_tag_cloud($returnurl, $oublog, $currentgroup, $cm, $oubloginstance->id)) {
if ($oublog->global) { // bit about hidden with if global then $posts // In order to prevent people from looping through numbers to get the // name of every user in the site (in case these names are considered // private), don't display the header when not displaying posts, except // to users who can post $hideunusedblog = !$posts && !$canpost && !$canaudit; if ($hideunusedblog) { print_header(); } else { $navigation = oublog_build_navigation($cm, $oublog, $oubloginstance, $oubloguser, $extranav); print_header_simple(format_string($oublog->name), "", $navigation, "", oublog_get_meta_tags($oublog, $oubloginstance, $currentgroup, $cm), true, $buttontext, navmenu($course, $cm)); } } else { $navigation = oublog_build_navigation($cm, $oublog, $oubloginstance, null, $extranav); print_header_simple(format_string($oublog->name), "", $navigation, "", oublog_get_meta_tags($oublog, $oubloginstance, $currentgroup, $cm), true, $buttontext, navmenu($course, $cm)); } print '<div class="oublog-topofpage"></div>'; require_once dirname(__FILE__) . '/pagelib.php'; // Initialize $PAGE, compute blocks $PAGE = page_create_instance($oublog->id); $pageblocks = blocks_setup($PAGE); $editing = isediting($cm->course); if (class_exists('ouflags') && ou_get_is_mobile() && $blogdets == 'show') { print '<div id="middle-column">'; ou_print_mobile_navigation($id, $blogdets, null, $user); } else { // The left column ... if ($hasleft = !empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing)) { print '<div id="left-column">'; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);