if (empty($mod->fullpage)) { echo "<p><a href=\"view.php?id={$cm->id}&section={$section}&article=" . $articles[key($articles)]->id . "\">"; echo $strreadmore . "</a></p>\n"; } else { echo stripslashes($articles[key($articles)]->content); echo "<p style=\"font-size: x-small;\">("; echo $strcreated; echo ": " . userdate($articles[key($articles)]->timecreated); echo " " . $strmodified . ": " . userdate($articles[key($articles)]->timemodified) . ")</p>\n"; } } else { if (!$frontpage) { /// display a single article on the page (the first in current section $thearticle = netpublish_get_article($article); // Edit buttons netpublish_print_actionbuttons($cm, $thearticle, $USER->id, $course->id, true); echo "<h2>" . stripslashes($thearticle->title) . "</h2>\n"; //if ( $_GET['id'] != 15832 ) { // (nadavkav) orit tati hack. do not forget to remove after 9.3.2010 echo "<div class=\"authors\"><strong>" . $strauthor . "</strong>: " . s($thearticle->firstname) . " " . s($thearticle->lastname); netpublish_print_authors($thearticle->authors); echo "<br />\n"; echo "<strong>" . $strpublished . "</strong>: " . userdate($thearticle->timepublished) . "</div>\n"; //} echo stripslashes($thearticle->intro); echo stripslashes($thearticle->content); echo "<p style=\"font-size: x-small;\">("; echo $strcreated; echo ": " . userdate($thearticle->timecreated); echo " " . $strmodified . ": " . userdate($thearticle->timemodified) . ")</p>\n"; } else { /// display all articles in current section
$tbl->nowrap = array("nowrap", "nowrap", "nowrap", "", "", ""); $tbl->data = array(); $mine = array(); $others = array(); if (!empty($articles)) { $formcount = 1; foreach ($articles as $article) { $rights = netpublish_get_rights($article->rights); $canread = !empty($rights[$USER->id]) ? $nperm->can_read($rights[$USER->id]) : 0; $newrow = array(); if (has_capability('moodle/legacy:editingteacher', $coursecontext) || $canread || intval($article->userid) == intval($USER->id)) { $newrow[] = "<a href=\"preview.php?id={$cm->id}&article={$article->id}&" . "status={$article->statusid}\">{$article->title}</a>"; } else { $newrow[] = $article->title; } $newrow[] = netpublish_print_actionbuttons($cm, $article, $USER->id, $course->id, true, true); if (!empty($article->authors)) { $newrow[] = fullname($article) . ' ' . netpublish_print_authors($article->authors, true); } else { $newrow[] = fullname($article); } $teacher = new stdClass(); $teacher->firstname = $article->tfirstname; $teacher->lastname = $article->tlastname; $newrow[] = fullname($teacher); unset($teacher); if (has_capability('moodle/legacy:editingteacher', $coursecontext)) { $newrow[] = "<form id=\"frm_{$formcount}\" name=\"frm_{$formcount}\"" . " method=\"post\" action=\"drafts.php\">\n" . "<input type=\"hidden\" name=\"id\" value=\"" . $cm->id . "\" />\n" . "<input type=\"hidden\" name=\"articleid\" value=\"" . $article->id . "\" />\n" . "<input type=\"hidden\" name=\"sesskey\" value=\"" . $USER->sesskey . "\" />\n" . netpublish_print_status_list("statusid", $publish, $article->statusid, "onchange=\"send_form('frm_{$formcount}');\"", true) . "</form>\n"; } else { $newrow[] = $article->status; }