$taburl = clone $pageurl; $taburl->remove_params('tab'); $tabs = array(new tabobject('tab0', $taburl . '&tab=0', $tabtitle1), new tabobject('tab1', $taburl . '&tab=1', $tabtitle2)); print $out->tabtree($tabs, "tab{$tab}"); } // Display time filter options form. if ($start || $end || $ratedstart || $ratedend) { $timefilter->set_data(array('start' => $start, 'end' => $end, 'ratedstart' => $ratedstart, 'ratedend' => $ratedend)); } if (!empty($submitted->ratedposts)) { $timefilter->set_data(array('ratedposts' => $submitted->ratedposts)); } $timefilter->display(); // Display the download button only if we have posts to download. if ($posts) { print $table->download_buttons(); } } $data = array(); foreach ($posts as $postid => $post) { $deleted = $post->get_deleted(); $discussion = $post->get_discussion(); $discussiondeleted = $discussion->is_deleted(); // Don't display if post or discussion is deleted and user is a student. if (!(($deleted || $discussiondeleted) && $student)) { if (empty($download)) { print "<div class='forumng-userpostheading'>"; // Get URL to post. print '<a href="' . s($post->get_url()) . '">'; } // If this post is a reply, then print a link to the discussion.
if (!empty($download)) { $gradeitem = str_replace('/', '//', $gradeitem); // Fix in excel. } } else { $gradeitem = get_string('nograde'); } } } $row[4] = $span . $gradeitem . $postspan; $data[] = $row; } if (empty($download)) { // Display heading. print $out->heading(get_string('userposts', 'forumngfeature_userposts')); echo $ptable->download_buttons(); // Print out participation form. if ($cangrade) { print forumngfeature_userposts_grade_form_header($cmid, $groupid); } } $ptable->downloadable = false; $ptable->setup(); foreach ($data as $row) { $ptable->add_data($row); } $ptable->finish_output(); // Print out grade form footer. if ($cangrade && empty($download)) { print forumngfeature_userposts_grade_form_footer(); }