summaryrefslogtreecommitdiff
path: root/modules/archive/archive.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-10-26 15:17:26 +0000
committerDries Buytaert <dries@buytaert.net>2002-10-26 15:17:26 +0000
commit8d103a08984ac2de72d756eb5c5c8d23061ab028 (patch)
treee8cb8b9b2f071a9b7bd2e222d8183e5c27ad6683 /modules/archive/archive.module
parent2ec14f35ac7d5600e6d03b5cf79f717f43d1cfab (diff)
downloadbrdo-8d103a08984ac2de72d756eb5c5c8d23061ab028.tar.gz
brdo-8d103a08984ac2de72d756eb5c5c8d23061ab028.tar.bz2
- Committed Marco's block rewrite:
+ Blocks are not longer called if not rendered: major performance improvement. + Fixed some bugs (preview option was broken, path option was broken). + Removed "ascii"-type blocks. + Added permission to for "PHP blocks" + ... NOTES: + You'll want to run "update.php": ALTER TABLE blocks DROP remove; ALTER TABLE blocks DROP name; + You'll want to update your custom modules as well as the modules in the contrib repository. Block function should now read: function *_block($op = "list", $delta = 0) { if ($op == "list") { return array of block infos } else { return subject and content of $delta block } }
Diffstat (limited to 'modules/archive/archive.module')
-rw-r--r--modules/archive/archive.module25
1 files changed, 16 insertions, 9 deletions
diff --git a/modules/archive/archive.module b/modules/archive/archive.module
index 15d61e5b6..d2f33c0ab 100644
--- a/modules/archive/archive.module
+++ b/modules/archive/archive.module
@@ -102,14 +102,20 @@ function archive_display($original = 0) {
return $output;
}
-function archive_block() {
+function archive_block($op = "list", $delta = 0) {
global $date;
-
- $block[0]["subject"] = "Browse archives";
- $block[0]["content"] = archive_display($date);
- $block[0]["info"] = "Calendar to browse archives";
-
- return $block;
+ if ($op == "list") {
+ $blocks[0]["info"] = t("Calendar to browse archives");
+ return $blocks;
+ }
+ else {
+ switch ($delta) {
+ case 0:
+ $block["subject"] = t("Browse archives");
+ $block["content"] = archive_display($date);
+ return $block;
+ }
+ }
}
function archive_link($type) {
@@ -169,10 +175,11 @@ function archive_page() {
}
}
else {
- $theme->box(t("Access denied"), message_access());
+ #$theme->box(t("Access denied"), message_access());
+ message_access();
}
$theme->footer();
}
-?>
+?> \ No newline at end of file