summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-04-21 14:55:03 +0000
committerDries Buytaert <dries@buytaert.net>2003-04-21 14:55:03 +0000
commita956de78b9681f55cfc81785306031aa6e3ac9c1 (patch)
treefeae400f1ae2191fb3253f527be4cc2d01728a62
parent716e833a6e103585d1d1478b6a4ee47a1e8bbbef (diff)
downloadbrdo-a956de78b9681f55cfc81785306031aa6e3ac9c1.tar.gz
brdo-a956de78b9681f55cfc81785306031aa6e3ac9c1.tar.bz2
- Fixed some PHP "notices".
-rw-r--r--includes/module.inc2
-rw-r--r--index.php2
-rw-r--r--modules/aggregator.module4
-rw-r--r--modules/aggregator/aggregator.module4
-rw-r--r--modules/archive.module5
-rw-r--r--modules/archive/archive.module5
-rw-r--r--modules/blog.module8
-rw-r--r--modules/blog/blog.module8
-rw-r--r--modules/book.module5
-rw-r--r--modules/book/book.module5
-rw-r--r--modules/cloud.module4
-rw-r--r--modules/forum.module4
-rw-r--r--modules/forum/forum.module4
-rw-r--r--modules/import.module4
-rw-r--r--modules/node.module4
-rw-r--r--modules/node/node.module4
-rw-r--r--modules/page.module5
-rw-r--r--modules/page/page.module5
-rw-r--r--modules/poll.module5
-rw-r--r--modules/poll/poll.module5
-rw-r--r--modules/search.module4
-rw-r--r--modules/search/search.module4
-rw-r--r--modules/story.module4
-rw-r--r--modules/story/story.module4
-rw-r--r--modules/tracker.module4
-rw-r--r--modules/tracker/tracker.module4
-rw-r--r--modules/user.module5
-rw-r--r--modules/user/user.module5
28 files changed, 96 insertions, 30 deletions
diff --git a/includes/module.inc b/includes/module.inc
index a8214e49c..d126944a9 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -66,7 +66,7 @@ function module_list($refresh = 0) {
// return 1 if module $name exists, 0 otherwise:
function module_exist($name) {
$list = module_list();
- return ($list[$name]) ? 1 : 0;
+ return isset($list[$name]) ? 1 : 0;
}
// return 1 if module $name implements hook $hook, 0 otherwise:
diff --git a/index.php b/index.php
index 795c73eed..f7f539b21 100644
--- a/index.php
+++ b/index.php
@@ -7,7 +7,7 @@ if (isset($q)) {
$mod = arg(0);
}
-if ($mod && module_hook($mod, "page")) {
+if (isset($mod) && module_hook($mod, "page")) {
if ($mod != "admin") {
page_header();
}
diff --git a/modules/aggregator.module b/modules/aggregator.module
index a36ef3215..dcf3d2d49 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -30,6 +30,8 @@ function import_perm() {
function import_link($type) {
+ $links = array();
+
if ($type == "page" && user_access("access news feeds")) {
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated websites.")));
}
@@ -45,7 +47,7 @@ function import_link($type) {
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
}
- return $links ? $links : array();
+ return $links;
}
function import_cron() {
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index a36ef3215..dcf3d2d49 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -30,6 +30,8 @@ function import_perm() {
function import_link($type) {
+ $links = array();
+
if ($type == "page" && user_access("access news feeds")) {
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated websites.")));
}
@@ -45,7 +47,7 @@ function import_link($type) {
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
}
- return $links ? $links : array();
+ return $links;
}
function import_cron() {
diff --git a/modules/archive.module b/modules/archive.module
index be3555d14..71aec57f6 100644
--- a/modules/archive.module
+++ b/modules/archive.module
@@ -129,11 +129,14 @@ function archive_block($op = "list", $delta = 0) {
}
function archive_link($type) {
+
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$links[] = l(t("archives"), "archive", array("title" => t("Read the older content in our archive.")));
}
- return $links ? $links : array();
+ return $links;
}
function archive_page() {
diff --git a/modules/archive/archive.module b/modules/archive/archive.module
index be3555d14..71aec57f6 100644
--- a/modules/archive/archive.module
+++ b/modules/archive/archive.module
@@ -129,11 +129,14 @@ function archive_block($op = "list", $delta = 0) {
}
function archive_link($type) {
+
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$links[] = l(t("archives"), "archive", array("title" => t("Read the older content in our archive.")));
}
- return $links ? $links : array();
+ return $links;
}
function archive_page() {
diff --git a/modules/blog.module b/modules/blog.module
index 7f8b04f1d..dc90b99cd 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -51,12 +51,14 @@ function blog_head($main = 0) {
$mod = arg(0);
$id = arg(1);
+ $output = array();
+
if ($mod == "blog" && $id) {
$account = user_load(array("uid" => $id));
$output[] = "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS - ". $account->name. "'s blog\" href=\"". url("blog/view/$id") ."\" />";
}
- return $output ? $output : array();
+ return $output;
}
function blog_user($type, &$edit, &$user) {
@@ -208,6 +210,8 @@ function blog_page() {
function blog_link($type, $node = 0, $main) {
global $user;
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$links[] = l(t("user blogs"), "blog", array("title" => t("Read the latest blog entries.")));
}
@@ -231,7 +235,7 @@ function blog_link($type, $node = 0, $main) {
}
}
- return $links ? $links : array();
+ return $links;
}
function blog_block($op = "list", $delta = 0) {
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 7f8b04f1d..dc90b99cd 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -51,12 +51,14 @@ function blog_head($main = 0) {
$mod = arg(0);
$id = arg(1);
+ $output = array();
+
if ($mod == "blog" && $id) {
$account = user_load(array("uid" => $id));
$output[] = "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS - ". $account->name. "'s blog\" href=\"". url("blog/view/$id") ."\" />";
}
- return $output ? $output : array();
+ return $output;
}
function blog_user($type, &$edit, &$user) {
@@ -208,6 +210,8 @@ function blog_page() {
function blog_link($type, $node = 0, $main) {
global $user;
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$links[] = l(t("user blogs"), "blog", array("title" => t("Read the latest blog entries.")));
}
@@ -231,7 +235,7 @@ function blog_link($type, $node = 0, $main) {
}
}
- return $links ? $links : array();
+ return $links;
}
function blog_block($op = "list", $delta = 0) {
diff --git a/modules/book.module b/modules/book.module
index 5153ee9b2..ad9c23870 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -58,6 +58,9 @@ function book_access($op, $node) {
}
function book_link($type, $node = 0, $main = 0) {
+
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$links[] = l(t("collaborative book"), "book", array("title" => t("Read and contribute to the collaborative books.")));
}
@@ -87,7 +90,7 @@ function book_link($type, $node = 0, $main = 0) {
}
}
- return $links ? $links : array();
+ return $links;
}
function book_load($node) {
diff --git a/modules/book/book.module b/modules/book/book.module
index 5153ee9b2..ad9c23870 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -58,6 +58,9 @@ function book_access($op, $node) {
}
function book_link($type, $node = 0, $main = 0) {
+
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$links[] = l(t("collaborative book"), "book", array("title" => t("Read and contribute to the collaborative books.")));
}
@@ -87,7 +90,7 @@ function book_link($type, $node = 0, $main = 0) {
}
}
- return $links ? $links : array();
+ return $links;
}
function book_load($node) {
diff --git a/modules/cloud.module b/modules/cloud.module
index 60c565d8c..890ccca05 100644
--- a/modules/cloud.module
+++ b/modules/cloud.module
@@ -35,6 +35,8 @@ function cloud_perm() {
}
function cloud_link($type) {
+ $links = array();
+
if ($type == "page" && user_access("access site cloud")) {
$links[] = l(t("site cloud"), "cloud", array("title" => t("Monitor other sites in the cloud.")));
}
@@ -48,7 +50,7 @@ function cloud_link($type) {
menu("admin/syndication/cloud/help", "help", "cloud_help", NULL, 9);
}
- return $links ? $links : array();
+ return $links;
}
function cloud_update($site) {
diff --git a/modules/forum.module b/modules/forum.module
index 141d130bc..9f7d4e881 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -112,6 +112,8 @@ function forum_block($op = "list", $delta = 0) {
function forum_link($type, $node = 0, $main = 0) {
global $user;
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$links[] = l(t("forum"), "forum");
}
@@ -147,7 +149,7 @@ function forum_link($type, $node = 0, $main = 0) {
}
}
- return $links ? $links : array();
+ return $links;
}
function forum_view($node, $main = 0) {
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 141d130bc..9f7d4e881 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -112,6 +112,8 @@ function forum_block($op = "list", $delta = 0) {
function forum_link($type, $node = 0, $main = 0) {
global $user;
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$links[] = l(t("forum"), "forum");
}
@@ -147,7 +149,7 @@ function forum_link($type, $node = 0, $main = 0) {
}
}
- return $links ? $links : array();
+ return $links;
}
function forum_view($node, $main = 0) {
diff --git a/modules/import.module b/modules/import.module
index a36ef3215..dcf3d2d49 100644
--- a/modules/import.module
+++ b/modules/import.module
@@ -30,6 +30,8 @@ function import_perm() {
function import_link($type) {
+ $links = array();
+
if ($type == "page" && user_access("access news feeds")) {
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated websites.")));
}
@@ -45,7 +47,7 @@ function import_link($type) {
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
}
- return $links ? $links : array();
+ return $links;
}
function import_cron() {
diff --git a/modules/node.module b/modules/node.module
index 66e083846..4b27955ed 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -491,6 +491,8 @@ function node_filter($text) {
function node_link($type, $node = 0, $main = 0) {
+ $links = array();
+
if ($type == "page") {
$links[] = l(t("submit"), "node/add", array("title" => t("Submit or suggest new content.")));
}
@@ -522,7 +524,7 @@ function node_link($type, $node = 0, $main = 0) {
menu("admin/node/settings", "content settings", "node_admin", NULL, 8);
}
- return $links ? $links : array();
+ return $links;
}
function node_admin_edit($node) {
diff --git a/modules/node/node.module b/modules/node/node.module
index 66e083846..4b27955ed 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -491,6 +491,8 @@ function node_filter($text) {
function node_link($type, $node = 0, $main = 0) {
+ $links = array();
+
if ($type == "page") {
$links[] = l(t("submit"), "node/add", array("title" => t("Submit or suggest new content.")));
}
@@ -522,7 +524,7 @@ function node_link($type, $node = 0, $main = 0) {
menu("admin/node/settings", "content settings", "node_admin", NULL, 8);
}
- return $links ? $links : array();
+ return $links;
}
function node_admin_edit($node) {
diff --git a/modules/page.module b/modules/page.module
index 7bc108dbc..33145fcb7 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -71,6 +71,9 @@ function page_load($node) {
}
function page_link($type) {
+
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$result = db_query("SELECT n.nid, n.title, p.link, p.description FROM page p LEFT JOIN node n ON p.nid = n.nid WHERE n.status = '1' AND p.link != '' ORDER BY p.link");
while ($page = db_fetch_object($result)) {
@@ -82,7 +85,7 @@ function page_link($type) {
$links[] = l(t("create static page"), "node/add/page", array("title" => t("Add a new static page.")));
}
- return $links ? $links : array();
+ return $links;
}
function page_body($node) {
diff --git a/modules/page/page.module b/modules/page/page.module
index 7bc108dbc..33145fcb7 100644
--- a/modules/page/page.module
+++ b/modules/page/page.module
@@ -71,6 +71,9 @@ function page_load($node) {
}
function page_link($type) {
+
+ $links = array();
+
if ($type == "page" && user_access("access content")) {
$result = db_query("SELECT n.nid, n.title, p.link, p.description FROM page p LEFT JOIN node n ON p.nid = n.nid WHERE n.status = '1' AND p.link != '' ORDER BY p.link");
while ($page = db_fetch_object($result)) {
@@ -82,7 +85,7 @@ function page_link($type) {
$links[] = l(t("create static page"), "node/add/page", array("title" => t("Add a new static page.")));
}
- return $links ? $links : array();
+ return $links;
}
function page_body($node) {
diff --git a/modules/poll.module b/modules/poll.module
index cb8710132..45188c78a 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -152,6 +152,8 @@ function poll_insert($node) {
}
function poll_link($type, $node = 0, $main) {
+ $links = array();
+
if ($type == "menu.create" && user_access("create polls")) {
$links[] = l(t("create poll"), "node/add/poll", array("title" => t("Add a new poll.")));
}
@@ -190,7 +192,8 @@ function poll_link($type, $node = 0, $main) {
}
}
}
- return $links ? $links : array();
+
+ return $links;
}
function poll_load($node) {
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index cb8710132..45188c78a 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -152,6 +152,8 @@ function poll_insert($node) {
}
function poll_link($type, $node = 0, $main) {
+ $links = array();
+
if ($type == "menu.create" && user_access("create polls")) {
$links[] = l(t("create poll"), "node/add/poll", array("title" => t("Add a new poll.")));
}
@@ -190,7 +192,8 @@ function poll_link($type, $node = 0, $main) {
}
}
}
- return $links ? $links : array();
+
+ return $links;
}
function poll_load($node) {
diff --git a/modules/search.module b/modules/search.module
index ecefa8e32..4f878e589 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -28,11 +28,13 @@ function search_perm() {
*
*/
function search_link($type) {
+ $links = array();
+
if ($type == "page" && user_access("search content")) {
$links[] = l(t("search"), "search", array("title" => t("Search for older content.")));
}
- return $links ? $links : array();
+ return $links;
}
function search_settings() {
diff --git a/modules/search/search.module b/modules/search/search.module
index ecefa8e32..4f878e589 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -28,11 +28,13 @@ function search_perm() {
*
*/
function search_link($type) {
+ $links = array();
+
if ($type == "page" && user_access("search content")) {
$links[] = l(t("search"), "search", array("title" => t("Search for older content.")));
}
- return $links ? $links : array();
+ return $links;
}
function search_settings() {
diff --git a/modules/story.module b/modules/story.module
index 163db2b4e..2ac869fa3 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -40,11 +40,13 @@ function story_access($op, $node) {
}
function story_link($type) {
+ $links = array();
+
if ($type == "menu.create" && user_access("create stories")) {
$links[] = l(t("create story"), "node/add/story", array("title" => t("Add a new story.")));
}
- return $links ? $links : array();
+ return $links;
}
function story_form(&$node, &$help, &$error) {
diff --git a/modules/story/story.module b/modules/story/story.module
index 163db2b4e..2ac869fa3 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -40,11 +40,13 @@ function story_access($op, $node) {
}
function story_link($type) {
+ $links = array();
+
if ($type == "menu.create" && user_access("create stories")) {
$links[] = l(t("create story"), "node/add/story", array("title" => t("Add a new story.")));
}
- return $links ? $links : array();
+ return $links;
}
function story_form(&$node, &$help, &$error) {
diff --git a/modules/tracker.module b/modules/tracker.module
index a5d0f090f..30ec7b6c0 100644
--- a/modules/tracker.module
+++ b/modules/tracker.module
@@ -13,11 +13,13 @@ function tracker_system($field) {
function tracker_link($type) {
+ $links = array();
+
if ($type == "menu.view" && user_access("access content")) {
$links[] = l(t("view recent posts"), "tracker", array("title" => t("Display an overview of the recent posts.")));
}
- return $links ? $links : array();
+ return $links;
}
function tracker_posts($id = 0) {
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module
index a5d0f090f..30ec7b6c0 100644
--- a/modules/tracker/tracker.module
+++ b/modules/tracker/tracker.module
@@ -13,11 +13,13 @@ function tracker_system($field) {
function tracker_link($type) {
+ $links = array();
+
if ($type == "menu.view" && user_access("access content")) {
$links[] = l(t("view recent posts"), "tracker", array("title" => t("Display an overview of the recent posts.")));
}
- return $links ? $links : array();
+ return $links;
}
function tracker_posts($id = 0) {
diff --git a/modules/user.module b/modules/user.module
index 71386c52f..edfae5e83 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -380,6 +380,9 @@ function user_block($op = "list", $delta = 0) {
}
function user_link($type) {
+
+ $links = array();
+
if ($type == "page") {
$links[] = l(t("user account"), "user", array("title" => t("Create a user account, request a new password or edit your account settings.")));
}
@@ -427,7 +430,7 @@ function user_link($type) {
}
}
- return $links ? $links : array();
+ return $links;
}
/*** Authentication methods ************************************************/
diff --git a/modules/user/user.module b/modules/user/user.module
index 71386c52f..edfae5e83 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -380,6 +380,9 @@ function user_block($op = "list", $delta = 0) {
}
function user_link($type) {
+
+ $links = array();
+
if ($type == "page") {
$links[] = l(t("user account"), "user", array("title" => t("Create a user account, request a new password or edit your account settings.")));
}
@@ -427,7 +430,7 @@ function user_link($type) {
}
}
- return $links ? $links : array();
+ return $links;
}
/*** Authentication methods ************************************************/