Commit a956de78 authored by Dries's avatar Dries

- Fixed some PHP "notices".
parent 716e833a
......@@ -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:
......
......@@ -7,7 +7,7 @@
$mod = arg(0);
}
if ($mod && module_hook($mod, "page")) {
if (isset($mod) && module_hook($mod, "page")) {
if ($mod != "admin") {
page_header();
}
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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() {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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 ************************************************/
......
......@@ -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 ************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment