cvs: pearweb /include pear-format-html.php
| From: | Thomas V.V.Cox | Date: | Sat, 29 Dec 2001 18:27:05 +0000 |
| Subject: | cvs: pearweb /include pear-format-html.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1769@lists.php.net to get a copy of this message | ||
cox Sat Dec 29 13:27:05 2001 EDT
Modified files:
/pearweb/include pear-format-html.php
Log:
make html_category_urhere() more flexible
Index: pearweb/include/pear-format-html.php
diff -u pearweb/include/pear-format-html.php:1.24 pearweb/include/pear-format-html.php:1.25
--- pearweb/include/pear-format-html.php:1.24 Sat Dec 29 00:45:58 2001
+++ pearweb/include/pear-format-html.php Sat Dec 29 13:27:05 2001
@@ -195,7 +195,7 @@
print "</td>\n";
}
print "$i </tr>\n";
-
+
}
function headRow() {
@@ -239,7 +239,7 @@
}
print ">$text</td>\n";
print "$i </tr>\n";
-
+
}
}
@@ -251,27 +251,38 @@
print $border->toHtml();
}
-// prints "urhere" menu bar
-function html_category_urhere($id, $name=null)
+/**
+* prints "urhere" menu bar
+* Top Level :: XML :: XML_RPC
+* @param bool $link_lastest If the last category should or not be a link
+*/
+function html_category_urhere($id, $link_lastest = false)
{
global $PHP_SELF;
- $html = "<a href=\"$PHP_SELF\">Top Level</a>";
+ $html = "<a href=\"packages.php\">Top Level</a>";
if ($id !== null) {
global $dbh;
$res = $dbh->query("SELECT c.id, c.name
FROM categories c, categories cat
WHERE cat.id = $id
- AND c.cat_left < cat.cat_left
- AND c.cat_right > cat.cat_right");
-
+ AND c.cat_left <= cat.cat_left
+ AND c.cat_right >= cat.cat_right");
+ $nrows = $res->numRows();
+ $i = 0;
while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) {
+ if (!$link_lastest && $i >= $nrows -1) {
+ break;
+ }
$html .= " :: ".
- "<a
href=\"$PHP_SELF?catpid={$row['id']}&catname={$row['name']}\">".
+ "<a
href=\"/packages.php?catpid={$row['id']}&catname={$row['name']}\">".
"{$row['name']}</a>";
+ $i++;
+ }
+ if (!$link_lastest) {
+ $html .= " :: <b>".$row['name']."</b>";
}
- $html .= " :: <b>".htmlspecialchars($name)."</b>";
}
- print "$html";
+ print $html;
}
function localRedirect($file)