From 87ce71eb90588a443c05a6b7e378aca8d0e7b3b3 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 27 Mar 2011 11:49:36 -0700
Subject: Sort users in group box by name. Thanks edisonnews! Fixes #1662.
---
modules/user/views/admin_users_group.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'modules/user/views')
diff --git a/modules/user/views/admin_users_group.html.php b/modules/user/views/admin_users_group.html.php
index 2362e42b..31b91351 100644
--- a/modules/user/views/admin_users_group.html.php
+++ b/modules/user/views/admin_users_group.html.php
@@ -17,7 +17,7 @@
if ($group->users->count_all() > 0): ?>
- foreach ($group->users->find_all() as $i => $user): ?>
+ foreach ($group->users->order_by("name", "ASC")->find_all() as $i => $user): ?>
-
= html::clean($user->name) ?>
if (!$group->special): ?>
--
cgit v1.2.3
From 5cf38ed816006af52fa08475d2957a6f18846887 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Tue, 26 Apr 2011 09:48:21 -0700
Subject: Stop using Pagination() and instead use $theme->pager() in views.
Move the pager() function up to Gallery_View and replace
themes/admin_wind/views/pager.html.php (Pagination based) with a modified
version from the wind theme in themes/admin_wind/views/paginator.html.php.
Fixes #1718.
---
.../comment/controllers/admin_manage_comments.php | 13 ++--
.../comment/views/admin_manage_comments.html.php | 2 +-
modules/gallery/libraries/Gallery_View.php | 46 +++++++++++
modules/gallery/libraries/MY_Pagination.php | 35 ---------
modules/gallery/libraries/Theme_View.php | 46 -----------
modules/user/controllers/admin_users.php | 8 ++
modules/user/views/admin_users.html.php | 2 +-
themes/admin_wind/views/pager.html.php | 44 -----------
themes/admin_wind/views/paginator.html.php | 88 ++++++++++++++++++++++
9 files changed, 151 insertions(+), 133 deletions(-)
delete mode 100644 modules/gallery/libraries/MY_Pagination.php
delete mode 100644 themes/admin_wind/views/pager.html.php
create mode 100644 themes/admin_wind/views/paginator.html.php
(limited to 'modules/user/views')
diff --git a/modules/comment/controllers/admin_manage_comments.php b/modules/comment/controllers/admin_manage_comments.php
index 9bd1d7f6..effefcbb 100644
--- a/modules/comment/controllers/admin_manage_comments.php
+++ b/modules/comment/controllers/admin_manage_comments.php
@@ -45,6 +45,8 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
$view = new Admin_View("admin.html");
$view->page_title = t("Manage comments");
+ $view->page_type = "collection";
+ $view->page_subtype = "admin_comments";
$view->content = new View("admin_manage_comments.html");
$view->content->counts = $this->_counts();
$view->content->menu = $this->_menu($view->content->counts);
@@ -56,13 +58,12 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
->limit(self::$items_per_page)
->offset(($page - 1) * self::$items_per_page)
->find_all();
- $view->content->pager = new Pagination();
- $view->content->pager->initialize(
- array("query_string" => "page",
- "total_items" => $view->content->counts->$state,
- "items_per_page" => self::$items_per_page,
- "style" => "classic"));
+ // Pagination info
+ $view->page = $page;
+ $view->page_size = self::$items_per_page;
+ $view->children_count = $this->_counts()->$state;
+ $view->max_pages = ceil($view->children_count / $view->page_size);
print $view;
}
diff --git a/modules/comment/views/admin_manage_comments.html.php b/modules/comment/views/admin_manage_comments.html.php
index 34a28986..e7a61837 100644
--- a/modules/comment/views/admin_manage_comments.html.php
+++ b/modules/comment/views/admin_manage_comments.html.php
@@ -194,7 +194,7 @@
- = $pager ?>
+ = $theme->paginator() ?>
diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php
index 1395686c..e04b9169 100644
--- a/modules/gallery/libraries/Gallery_View.php
+++ b/modules/gallery/libraries/Gallery_View.php
@@ -30,6 +30,52 @@ class Gallery_View_Core extends View {
return $absolute_url ? url::abs_file($arg) : url::file($arg);
}
+ /**
+ * Set up the data and render a pager.
+ *
+ * See themes/wind/views/pager.html for documentation on the variables generated here.
+ */
+ public function paginator() {
+ $v = new View("paginator.html");
+ $v->page_type = $this->page_type;
+ $v->page_subtype = $this->page_subtype;
+ $v->first_page_url = null;
+ $v->previous_page_url = null;
+ $v->next_page_url = null;
+ $v->last_page_url = null;
+
+ if ($this->page_type == "collection") {
+ $v->page = $this->page;
+ $v->max_pages = $this->max_pages;
+ $v->total = $this->children_count;
+
+ if ($this->page != 1) {
+ $v->first_page_url = url::site(url::merge(array("page" => 1)));
+ $v->previous_page_url = url::site(url::merge(array("page" => $this->page - 1)));
+ }
+
+ if ($this->page != $this->max_pages) {
+ $v->next_page_url = url::site(url::merge(array("page" => $this->page + 1)));
+ $v->last_page_url = url::site(url::merge(array("page" => $this->max_pages)));
+ }
+
+ $v->first_visible_position = ($this->page - 1) * $this->page_size + 1;
+ $v->last_visible_position = min($this->page * $this->page_size, $v->total);
+ } else if ($this->page_type == "item") {
+ $v->position = $this->position;
+ $v->total = $this->sibling_count;
+ if ($this->previous_item) {
+ $v->previous_page_url = $this->previous_item->url();
+ }
+
+ if ($this->next_item) {
+ $v->next_page_url = $this->next_item->url();
+ }
+ }
+
+ return $v;
+ }
+
/**
* Begin gather up scripts or css files so that they can be combined into a single request.
*
diff --git a/modules/gallery/libraries/MY_Pagination.php b/modules/gallery/libraries/MY_Pagination.php
deleted file mode 100644
index e697c0bd..00000000
--- a/modules/gallery/libraries/MY_Pagination.php
+++ /dev/null
@@ -1,35 +0,0 @@
-auto_hide === TRUE AND $this->total_pages <= 1) {
- return "";
- }
-
- if ($style === NULL) {
- // Use default style
- $style = $this->style;
- }
-
- // Return rendered pagination view
- return View::factory("pager.html", get_object_vars($this))->render();
- }
-}
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 152efc37..d6834464 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -138,52 +138,6 @@ class Theme_View_Core extends Gallery_View {
return $menu->render();
}
- /**
- * Set up the data and render a pager.
- *
- * See themes/wind/views/pager.html for documentation on the variables generated here.
- */
- public function paginator() {
- $v = new View("paginator.html");
- $v->page_type = $this->page_type;
- $v->page_subtype = $this->page_subtype;
- $v->first_page_url = null;
- $v->previous_page_url = null;
- $v->next_page_url = null;
- $v->last_page_url = null;
-
- if ($this->page_type == "collection") {
- $v->page = $this->page;
- $v->max_pages = $this->max_pages;
- $v->total = $this->children_count;
-
- if ($this->page != 1) {
- $v->first_page_url = url::site(url::merge(array("page" => 1)));
- $v->previous_page_url = url::site(url::merge(array("page" => $this->page - 1)));
- }
-
- if ($this->page != $this->max_pages) {
- $v->next_page_url = url::site(url::merge(array("page" => $this->page + 1)));
- $v->last_page_url = url::site(url::merge(array("page" => $this->max_pages)));
- }
-
- $v->first_visible_position = ($this->page - 1) * $this->page_size + 1;
- $v->last_visible_position = min($this->page * $this->page_size, $v->total);
- } else if ($this->page_type == "item") {
- $v->position = $this->position;
- $v->total = $this->sibling_count;
- if ($this->previous_item) {
- $v->previous_page_url = $this->previous_item->url();
- }
-
- if ($this->next_item) {
- $v->next_page_url = $this->next_item->url();
- }
- }
-
- return $v;
- }
-
/**
* Print out any site wide status information.
*/
diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php
index a3633b52..41be6c03 100644
--- a/modules/user/controllers/admin_users.php
+++ b/modules/user/controllers/admin_users.php
@@ -21,6 +21,8 @@ class Admin_Users_Controller extends Admin_Controller {
public function index() {
$view = new Admin_View("admin.html");
$view->page_title = t("Users and groups");
+ $view->page_type = "collection";
+ $view->page_subtype = "admin_users";
$view->content = new View("admin_users.html");
// @todo: add this as a config option
@@ -29,6 +31,12 @@ class Admin_Users_Controller extends Admin_Controller {
$builder = db::build();
$user_count = $builder->from("users")->count_records();
+ // Pagination info
+ $view->page = $page;
+ $view->page_size = $page_size;
+ $view->children_count = $user_count;
+ $view->max_pages = ceil($view->children_count / $view->page_size);
+
$view->content->pager = new Pagination();
$view->content->pager->initialize(
array("query_string" => "page",
diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php
index a7bd6b27..033c9dae 100644
--- a/modules/user/views/admin_users.html.php
+++ b/modules/user/views/admin_users.html.php
@@ -110,7 +110,7 @@
- = $pager ?>
+ = $theme->paginator() ?>
diff --git a/themes/admin_wind/views/pager.html.php b/themes/admin_wind/views/pager.html.php
deleted file mode 100644
index 5fff5845..00000000
--- a/themes/admin_wind/views/pager.html.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- // See http://docs.kohanaphp.com/libraries/pagination ?>
-
diff --git a/themes/admin_wind/views/paginator.html.php b/themes/admin_wind/views/paginator.html.php
new file mode 100644
index 00000000..3cb0223d
--- /dev/null
+++ b/themes/admin_wind/views/paginator.html.php
@@ -0,0 +1,88 @@
+
+
+// This is a generic paginator for admin collections. Depending on the page type, there are
+// different sets of variables available. With this data, you can make a paginator that
+// lets you say "You're viewing photo 5 of 35", or "You're viewing photos 10 - 18 of 37"
+// for album views.
+
+//
+// Available variables for all page types:
+// $page_type - "collection", "item", or "other"
+// $page_subtype - "album", "movie", "photo", "tag", etc.
+// $previous_page_url - the url to the previous page, if there is one
+// $next_page_url - the url to the next page, if there is one
+// $total - the total number of photos in this album
+//
+// Available for the "collection" page types:
+// $page - what page number we're on
+// $max_pages - the maximum page number
+// $page_size - the page size
+// $first_page_url - the url to the first page, or null if we're on the first page
+// $last_page_url - the url to the last page, or null if we're on the last page
+// $first_visible_position - the position number of the first visible photo on this page
+// $last_visible_position - the position number of the last visible photo on this page
+//
+// Available for "item" page types:
+// $position - the position number of this photo
+//
+?>
+
+
+ -
+ if ($page_type == "collection"): ?>
+ if (isset($first_page_url)): ?>
+
+ = t("First") ?>
+ else: ?>
+
+ = t("First") ?>
+ endif ?>
+ endif ?>
+
+ if (isset($previous_page_url)): ?>
+
+ = t("Previous") ?>
+ else: ?>
+
+ = t("Previous") ?>
+ endif ?>
+
+
+ -
+ if ($total): ?>
+ if ($page_type == "collection"): ?>
+ = /* @todo This message isn't easily localizable */
+ t2("Viewing %from_number of %count",
+ "Viewing %from_number - %to_number of %count",
+ $total,
+ array("from_number" => $first_visible_position,
+ "to_number" => $last_visible_position,
+ "count" => $total)) ?>
+ else: ?>
+ = t("%position of %total", array("position" => $position, "total" => $total)) ?>
+ endif ?>
+ else: ?>
+ = t("No photos") ?>
+ endif ?>
+
+
+ -
+ if (isset($next_page_url)): ?>
+
+ = t("Next") ?>
+ else: ?>
+
+ = t("Next") ?>
+ endif ?>
+
+ if ($page_type == "collection"): ?>
+ if (isset($last_page_url)): ?>
+
+ = t("Last") ?>
+ else: ?>
+
+ = t("Last") ?>
+ endif ?>
+ endif ?>
+
+
--
cgit v1.2.3
From e736d98eaa37df24122c746c21c473f0988d58f2 Mon Sep 17 00:00:00 2001
From: Tim Almdal
Date: Thu, 4 Aug 2011 21:00:21 -0700
Subject: Patch for ticket #1765. Provide the full site url for the the gallery
link instead of trying to use url_base for the hidden link and the
presentation text.
---
modules/user/views/reset_password.html.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'modules/user/views')
diff --git a/modules/user/views/reset_password.html.php b/modules/user/views/reset_password.html.php
index 3afca881..d939ad42 100644
--- a/modules/user/views/reset_password.html.php
+++ b/modules/user/views/reset_password.html.php
@@ -9,8 +9,9 @@
= t("Hello, %name,", array("name" => $user->full_name ? $user->full_name : $user->name)) ?>
- = t("We received a request to reset your password for %site_url. If you made this request, you can confirm it by clicking this link. If you didn't request this password reset, it's ok to ignore this mail.",
- array("site_url" => html::mark_clean(url::base(false, "http")),
+ = t("We received a request to reset your password for %base_url. If you made this request, you can confirm it by clicking this link. If you didn't request this password reset, it's ok to ignore this mail.",
+ array("site_url" => html::mark_clean(url::abs_site("/")),
+ "base_url" => html::mark_clean(url::base(false)),
"confirm_url" => $confirm_url)) ?>