From 6cde632962a461d2dc2acef0917b592823e123f8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 27 Sep 2001 18:30:36 +0000 Subject: - book.module: fixed "/admin.php" bug reported by Gerhard. - search.module: made the search categories translatable. --- modules/book.module | 4 ++-- modules/book/book.module | 4 ++-- modules/search.module | 3 +-- modules/search/search.module | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/book.module b/modules/book.module index 58b14a3f2..bbfde7677 100644 --- a/modules/book.module +++ b/modules/book.module @@ -85,7 +85,7 @@ function book_search($keys) { global $PHP_SELF, $status; $result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid LEFT JOIN user u ON n.author = u.uid WHERE n.type = 'book' AND n.status = '$status[posted]' AND (n.title LIKE '%". check_input($keys) ."%' OR b.body LIKE '%". check_input($keys) ."%') ORDER BY n.timestamp DESC LIMIT 20"); while ($node = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($node->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=node&type=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->name, "date" => $node->timestamp); + $find[$i++] = array("title" => check_output($node->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->name, "date" => $node->timestamp); } return $find; } @@ -213,7 +213,7 @@ function book_tree($parent = "", $depth = 0) { // render output: while ($node = db_fetch_object($result)) { - $output .= "
  • nid\">". check_output($node->title) ."". ($PHP_SELF == "/admin.php" ? " (weight: $node->weight/$node->parent, status: $node->status) (nid\">edit)" : "") ."
  • \n"; + $output .= "
  • nid\">". check_output($node->title) ."". (strstr($PHP_SELF, "admin.php") ? " (weight: $node->weight/$node->parent, status: $node->status) (nid\">edit)" : "") ."
  • \n"; $output .= book_tree($node->nid, $depth + 1); } $output = ""; diff --git a/modules/book/book.module b/modules/book/book.module index 58b14a3f2..bbfde7677 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -85,7 +85,7 @@ function book_search($keys) { global $PHP_SELF, $status; $result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid LEFT JOIN user u ON n.author = u.uid WHERE n.type = 'book' AND n.status = '$status[posted]' AND (n.title LIKE '%". check_input($keys) ."%' OR b.body LIKE '%". check_input($keys) ."%') ORDER BY n.timestamp DESC LIMIT 20"); while ($node = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($node->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=node&type=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->name, "date" => $node->timestamp); + $find[$i++] = array("title" => check_output($node->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->name, "date" => $node->timestamp); } return $find; } @@ -213,7 +213,7 @@ function book_tree($parent = "", $depth = 0) { // render output: while ($node = db_fetch_object($result)) { - $output .= "
  • nid\">". check_output($node->title) ."". ($PHP_SELF == "/admin.php" ? " (weight: $node->weight/$node->parent, status: $node->status) (nid\">edit)" : "") ."
  • \n"; + $output .= "
  • nid\">". check_output($node->title) ."". (strstr($PHP_SELF, "admin.php") ? " (weight: $node->weight/$node->parent, status: $node->status) (nid\">edit)" : "") ."
  • \n"; $output .= book_tree($node->nid, $depth + 1); } $output = ""; diff --git a/modules/search.module b/modules/search.module index afe827b2e..beb30565e 100644 --- a/modules/search.module +++ b/modules/search.module @@ -33,7 +33,6 @@ function search_page() { $type = check_input($type); $keys = check_input($keys); - /* ** Construct the search form: */ @@ -45,7 +44,7 @@ function search_page() { foreach (module_list() as $name) { if (module_hook($name, "search")) { - $form .= " $name "; + $form .= " ". t($name); } } diff --git a/modules/search/search.module b/modules/search/search.module index afe827b2e..beb30565e 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -33,7 +33,6 @@ function search_page() { $type = check_input($type); $keys = check_input($keys); - /* ** Construct the search form: */ @@ -45,7 +44,7 @@ function search_page() { foreach (module_list() as $name) { if (module_hook($name, "search")) { - $form .= " $name "; + $form .= " ". t($name); } } -- cgit v1.2.3