summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-02-15 06:27:17 -0800
committerTim Almdal <tnalmdal@shaw.ca>2010-02-15 06:27:17 -0800
commiteb1cdd037646b3697b64753652669fa9e25a5c8e (patch)
tree2f9dd9bd70329d5997993eced0a9f94a80895b8a /modules/gallery/helpers
parente41a2d4e5226c45a5201df91ca6633a40b357630 (diff)
parent409121942590e12692eaf4e6e9e8b71bfe5ed60c (diff)
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_event.php3
-rw-r--r--modules/gallery/helpers/gallery_installer.php13
-rw-r--r--modules/gallery/helpers/gallery_theme.php7
-rw-r--r--modules/gallery/helpers/items_rest.php44
4 files changed, 62 insertions, 5 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index faf1c0c6..3f77bc42 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -423,6 +423,9 @@ class gallery_event_Core {
if ($field == "locale") {
$value = locales::display_name($value);
}
+ if ($field == "full_name") {
+ $value = t($value);
+ }
$v->user_profile_data[(string) $label] = $value;
}
}
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index dd53cf43..45d991af 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -284,11 +284,13 @@ class gallery_installer {
module::set_var("gallery", "date_time_format", "Y-M-d H:i:s");
module::set_var("gallery", "time_format", "H:i:s");
module::set_var("gallery", "show_credits", 1);
- // @todo this string needs to be picked up by l10n_scanner
- module::set_var("gallery", "credits", "Powered by <a href=\"%url\">Gallery %version</a>");
+ // Mark string for translation
+ $powered_by_string = t("Powered by <a href=\"%url\">%gallery_version</a>",
+ array("locale" => "root"));
+ module::set_var("gallery", "credits", $powered_by_string);
module::set_var("gallery", "simultaneous_upload_limit", 5);
module::set_var("gallery", "admin_area_timeout", 90 * 60);
- module::set_version("gallery", 28);
+ module::set_version("gallery", 29);
}
static function upgrade($version) {
@@ -538,6 +540,11 @@ class gallery_installer {
module::set_var("gallery", "admin_area_timeout", 90 * 60);
module::set_version("gallery", $version = 28);
}
+
+ if ($version == 28) {
+ module::set_var("gallery", "credits", "Powered by <a href=\"%url\">%gallery_version</a>");
+ module::set_version("gallery", $version = 29);
+ }
}
static function uninstall() {
diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php
index ec650e1c..d6944323 100644
--- a/modules/gallery/helpers/gallery_theme.php
+++ b/modules/gallery/helpers/gallery_theme.php
@@ -112,9 +112,12 @@ class gallery_theme_Core {
}
static function credits() {
- return "<li class=\"g-first\">" .
+ $version_string = SafeString::of_safe_html(
+ '<bdo dir="ltr">Gallery ' . gallery::VERSION . '</bdo>');
+ return "<li class=\"g-first\">" .
t(module::get_var("gallery", "credits"),
- array("url" => "http://gallery.menalto.com", "version" => gallery::VERSION)) .
+ array("url" => "http://gallery.menalto.com",
+ "gallery_version" => $version_string)) .
"</li>";
}
diff --git a/modules/gallery/helpers/items_rest.php b/modules/gallery/helpers/items_rest.php
new file mode 100644
index 00000000..c4dd4a5f
--- /dev/null
+++ b/modules/gallery/helpers/items_rest.php
@@ -0,0 +1,44 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2009 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class items_rest_Core {
+ static function get($request) {
+
+ $items = array();
+ if (isset($request->params->url)) {
+ foreach($request->params->url as $url) {
+ $item = rest::resolve($url);
+ if (access::can("view", $item)) {
+ $members = array();
+ if ($item->type == "album") {
+ foreach ($item->children() as $child) {
+ $members[] = rest::url("item", $child);
+ }
+ }
+ $items[] = array("url" => $url,
+ "entity" => $item->as_restful_array(),
+ "members" => $members,
+ "relationship" => rest::relationships("item", $item));
+ }
+ }
+ }
+
+ return $items;
+ }
+}