Permalink
Browse files

Changed attachment section on content page to only display if there are

attachments, and then only as a link to the attachments control page.
  • Loading branch information...
1 parent b36a469 commit 5d2f5274494c9a722010b182ad2a5ebc3b870791 mchurch committed Aug 25, 2004
Showing with 18 additions and 12 deletions.
  1. +18 −12 mod/wiki/ewiki/plugins/aview/downloads.php
@@ -25,19 +25,25 @@ function ewiki_view_append_attachments($id, $data, $action) {
$scan = 's:7:"section";' . serialize($id);
$result = ewiki_database("SEARCH", array("meta" => $scan));
- $ord = array();
- while ($row = $result->get()) {
- $ord[$row["id"]] = $row["created"];
- }
- arsort($ord);
-
- foreach ($ord as $id => $uu) {
- $row = ewiki_database("GET", array("id"=>$id));
- if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $row, "view")) {
- continue;
- }
- $o .= ewiki_entry_downloads($row, "*");
+#### BEGIN MOODLE CHANGES - show attachments link only if there are attachments.
+#### - don't show the attachments on the content page.
+ if (count($result->entries) <= 0) {
+ $o = '';
}
+// $ord = array();
+// while ($row = $result->get()) {
+// $ord[$row["id"]] = $row["created"];
+// }
+// arsort($ord);
+//
+// foreach ($ord as $id => $uu) {
+// $row = ewiki_database("GET", array("id"=>$id));
+// if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $row, "view")) {
+// continue;
+// }
+// $o .= ewiki_entry_downloads($row, "*");
+// }
+#### END MOODLE CHANGES
return($o);
}

0 comments on commit 5d2f527

Please sign in to comment.