summaryrefslogtreecommitdiff
path: root/modules/blog.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-04-21 13:56:38 +0000
committerDries Buytaert <dries@buytaert.net>2004-04-21 13:56:38 +0000
commit7231c88a326f92bdc2b1579ac6afb8f7f568170b (patch)
treeb7586493410910be188d97440dbdf1d44b084b91 /modules/blog.module
parent7976678719f6e04ecda315a6088ee0eb3cfb0318 (diff)
downloadbrdo-7231c88a326f92bdc2b1579ac6afb8f7f568170b.tar.gz
brdo-7231c88a326f92bdc2b1579ac6afb8f7f568170b.tar.bz2
- Added support for 403 handling. Patch by JonBob. As a side benefit,
administrators will be able to define a custom 403 page, just as they can define 404 pages now. This needs to be documented in the "Changes since / migrating to ..." pages.
Diffstat (limited to 'modules/blog.module')
-rw-r--r--modules/blog.module27
1 files changed, 13 insertions, 14 deletions
diff --git a/modules/blog.module b/modules/blog.module
index 796df58ab..48fdb5847 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -211,31 +211,30 @@ function blog_view($node, $main = 0, $page = 0) {
return theme("node", $node, $main, $page);
}
+/**
+ * Implementation of hook_link().
+ */
function blog_link($type, $node = 0, $main) {
global $user;
$links = array();
- if ($type == "system") {
- if (user_access("maintain personal blog")) {
- menu("node/add/blog", t("blog entry"), "node_page", 0);
- menu("blog/". $user->uid, t("my blog"), "blog_page", 1, MENU_SHOW, MENU_LOCKED);
- }
- if (user_access("access content")) {
- menu("blog", t("blogs"), "blog_page", 0, MENU_HIDE);
- }
+ if ($type == 'system') {
+ menu('node/add/blog', t('blog entry'), user_access('maintain personal blog') ? 'node_page' : MENU_DENIED, 0);
+ menu('blog/'. $user->uid, t('my blog'), user_access('maintain personal blog') ? 'blog_page' : MENU_DENIED, 1, MENU_SHOW, MENU_LOCKED);
+ menu('blog', t('blogs'), user_access('access content') ? 'blog_page' : MENU_DENIED, 0, MENU_HIDE);
}
- if ($type == "page" && user_access("access content")) {
- $links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries.")));
+ if ($type == 'page' && user_access('access content')) {
+ $links[] = l(t('blogs'), 'blog', array('title' => t('Read the latest blog entries.')));
}
- if ($type == "node" && $node->type == "blog") {
- if (blog_access("update", $node)) {
- $links[] = l(t("edit this blog entry"), "node/edit/$node->nid", array("title" => t("Edit this blog entry.")));
+ if ($type == 'node' && $node->type == 'blog') {
+ if (blog_access('update', $node)) {
+ $links[] = l(t('edit this blog entry'), "node/edit/$node->nid", array('title' => t('Edit this blog entry.')));
}
elseif (arg(0) != 'blog' && arg(1) != $node->uid) {
- $links[] = l(t("%username's blog", array("%username" => $node->name)), "blog/$node->uid", array("title" => t("Read %username's latest blog entries.", array("%username" => $node->name))));
+ $links[] = l(t("%username's blog", array('%username' => $node->name)), "blog/$node->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name))));
}
}