Commit b5909435 authored by Dries's avatar Dries

- Made the tracker module link to your own posts. Patch 79 from Gerhard.

- Added a permalink to the Xtemplate theme.  Requested by Scott.

- Added pager support to the locale module.
parent bfd68e80
......@@ -173,13 +173,19 @@ function locale_seek() {
$query[] = "(". implode(" || ", $string_query) .")";
}
$result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "") ." ORDER BY string");
$result = pager_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "") ." ORDER BY string", 50);
$header = array(t("string"), (($edit["status"] != 2 && strlen($edit["language"]) == 2) ? t("translated string") : t("languages")), array("data" => t("operations"), "colspan" => "2"));
while ($locale = db_fetch_object($result)) {
$rows[] = array("$locale->string<br /><small><i>$locale->location</i></small>", array("data" => (($edit["status"] != 2 && strlen($edit["language"]) == 2) ? $locale->$edit["language"] : locale_languages($locale)), "align" => "center"), array("data" => l(t("edit locale"), "admin/locale/edit/$locale->lid"), "nowrap" => "nowrap"), array("data" => l(t("delete locale"), "admin/locale/delete/$locale->lid"), "nowrap" => "nowrap"));
}
if ($pager = pager_display(NULL, 50, 0, "admin")) {
$rows[] = array(array("data" => "$pager", "colspan" => "5"));
}
$output .= table($header, $rows);
}
return $output;
......
......@@ -173,13 +173,19 @@ function locale_seek() {
$query[] = "(". implode(" || ", $string_query) .")";
}
$result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "") ." ORDER BY string");
$result = pager_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "") ." ORDER BY string", 50);
$header = array(t("string"), (($edit["status"] != 2 && strlen($edit["language"]) == 2) ? t("translated string") : t("languages")), array("data" => t("operations"), "colspan" => "2"));
while ($locale = db_fetch_object($result)) {
$rows[] = array("$locale->string<br /><small><i>$locale->location</i></small>", array("data" => (($edit["status"] != 2 && strlen($edit["language"]) == 2) ? $locale->$edit["language"] : locale_languages($locale)), "align" => "center"), array("data" => l(t("edit locale"), "admin/locale/edit/$locale->lid"), "nowrap" => "nowrap"), array("data" => l(t("delete locale"), "admin/locale/delete/$locale->lid"), "nowrap" => "nowrap"));
}
if ($pager = pager_display(NULL, 50, 0, "admin")) {
$rows[] = array(array("data" => "$pager", "colspan" => "5"));
}
$output .= table($header, $rows);
}
return $output;
......
......@@ -73,6 +73,7 @@ function tracker_posts($id = 0) {
function tracker_user($type, &$edit, &$user) {
switch ($type) {
case "view_private":
case "view_public":
if (user_access("access content")) {
return form_item(t("Recent posts"), l(t("view recent posts"), "tracker/$user->uid"));
......
......@@ -73,6 +73,7 @@ function tracker_posts($id = 0) {
function tracker_user($type, &$edit, &$user) {
switch ($type) {
case "view_private":
case "view_public":
if (user_access("access content")) {
return form_item(t("Recent posts"), l(t("view recent posts"), "tracker/$user->uid"));
......
......@@ -31,7 +31,8 @@ function Theme_xtemplate() {
function node($node, $main = 0) {
$this->template->assign(array (
$this->template->assign(array(
"link" => url("node/view/$node->nid"),
"title" => ucfirst($node->title),
"author" => format_name($node),
"date" => format_date($node->created),
......
......@@ -46,7 +46,7 @@
<!-- BEGIN: node -->
<div class="node">
<div class="title">{title}</div>
<div class="title"><a href="{link}">{title}</a></div>
<span class="author">Submitted by {author} on {date}.</span>
<span class="taxonomy">{taxonomy}</span>
<div class="content">{content}</div>
......
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