summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/tests/Comment_Model_Test.php3
-rw-r--r--modules/g2_import/helpers/g2_import.php11
-rw-r--r--modules/g2_import/views/admin_g2_import.html.php2
-rw-r--r--modules/gallery/controllers/admin_maintenance.php5
-rw-r--r--modules/gallery/controllers/l10n_client.php2
-rw-r--r--modules/gallery/controllers/packager.php1
-rw-r--r--modules/gallery/helpers/gallery.php2
-rw-r--r--modules/gallery/helpers/gallery_installer.php12
-rw-r--r--modules/gallery/helpers/gallery_task.php2
-rw-r--r--modules/gallery/helpers/locales.php1
-rw-r--r--modules/gallery/libraries/Gallery_I18n.php46
-rw-r--r--modules/gallery/libraries/Menu.php17
-rw-r--r--modules/gallery/libraries/drivers/Cache/Database.php14
-rw-r--r--modules/gallery/module.info2
-rw-r--r--modules/gallery/tests/Access_Helper_Test.php9
-rw-r--r--modules/gallery/tests/Cache_Test.php4
-rw-r--r--modules/gallery/tests/Item_Helper_Test.php3
-rw-r--r--modules/gallery/tests/Item_Rest_Helper_Test.php4
-rw-r--r--modules/gallery/tests/xss_data.txt41
-rw-r--r--modules/gallery/views/admin_languages.html.php15
-rw-r--r--modules/organize/js/organize.js2
-rw-r--r--modules/rest/controllers/rest.php2
-rw-r--r--modules/server_add/controllers/server_add.php4
-rw-r--r--modules/server_add/views/admin_server_add.html.php2
-rw-r--r--modules/tag/tests/Tags_Rest_Helper_Test.php4
25 files changed, 140 insertions, 70 deletions
diff --git a/modules/comment/tests/Comment_Model_Test.php b/modules/comment/tests/Comment_Model_Test.php
index f0449c05..798e4f6d 100644
--- a/modules/comment/tests/Comment_Model_Test.php
+++ b/modules/comment/tests/Comment_Model_Test.php
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Comment_Model_Test extends Gallery_Unit_Test_Case {
+ public function teardown() {
+ identity::set_active_user(identity::admin_user());
+ }
public function cant_view_comments_for_unviewable_items_test() {
$album = test::random_album();
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index faf08291..9a91770a 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -304,20 +304,27 @@ class g2_import_Core {
if ($user) {
$message = t("Loaded existing user: '%name'.", array("name" => $user->name));
} else {
+ $email = $g2_user->getEmail();
+ if (empty($email) || !valid::email($email)) {
+ $email = "unknown@unknown.com";
+ }
$user = identity::create_user($g2_user->getUsername(), $g2_user->getfullname(),
// Note: The API expects a password in cleartext.
// Just use the hashed password as an unpredictable
// value here. The user will have to reset the password.
- $g2_user->getHashedPassword(), $g2_user->getEmail());
+ $g2_user->getHashedPassword(), $email);
if (class_exists("User_Model") && $user instanceof User_Model) {
// This will work if G2's password is a PasswordHash password as well.
$user->hashed_password = $g2_user->getHashedPassword();
}
$message = t("Created user: '%name'.", array("name" => $user->name));
+ if ($email == "unknown@unknown.com") {
+ $message .= t("\n\tFixed invalid email (was '%invalid_email')",
+ array("invalid_email" => $g2_user->getEmail()));
+ }
}
$user->hashed_password = $g2_user->getHashedPassword();
- $user->email = $g2_user->getEmail() ? $g2_user->getEmail() : "unknown@unknown.com";
$user->locale = $g2_user->getLanguage();
foreach ($g2_groups as $g2_group_id => $g2_group_name) {
if ($g2_group_id == $g2_admin_group_id) {
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index 5c520172..05cbab71 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -47,7 +47,7 @@
<? if ($g2_sizes["resize"]["size"] && $resize_size != $g2_sizes["resize"]["size"]): ?>
<li class="g-warning">
- <?= t("Your most common intermediate size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
+ <?= t("Your most common intermediate size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 intermediate size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
array("g2_pixels" => $g2_sizes["resize"]["size"],
"g3_pixels" => $resize_size,
"url" => html::mark_clean(url::site("admin/theme_options")))) ?>
diff --git a/modules/gallery/controllers/admin_maintenance.php b/modules/gallery/controllers/admin_maintenance.php
index d90fe0ea..c16c5c41 100644
--- a/modules/gallery/controllers/admin_maintenance.php
+++ b/modules/gallery/controllers/admin_maintenance.php
@@ -209,9 +209,10 @@ class Admin_Maintenance_Controller extends Admin_Controller {
message::success(t("Task failed"));
break;
}
+ // Using sprintf("%F") to avoid comma as decimal separator.
print json_encode(array("result" => "success",
"task" => array(
- "percent_complete" => $task->percent_complete,
+ "percent_complete" => sprintf("%F", $task->percent_complete),
"status" => (string) $task->status,
"done" => (bool) $task->done),
"location" => url::site("admin/maintenance")));
@@ -219,7 +220,7 @@ class Admin_Maintenance_Controller extends Admin_Controller {
} else {
print json_encode(array("result" => "in_progress",
"task" => array(
- "percent_complete" => $task->percent_complete,
+ "percent_complete" => sprintf("%F", $task->percent_complete),
"status" => (string) $task->status,
"done" => (bool) $task->done)));
}
diff --git a/modules/gallery/controllers/l10n_client.php b/modules/gallery/controllers/l10n_client.php
index e20bab50..be0aaa11 100644
--- a/modules/gallery/controllers/l10n_client.php
+++ b/modules/gallery/controllers/l10n_client.php
@@ -80,6 +80,8 @@ class L10n_Client_Controller extends Controller {
$entry->save();
+ Gallery_I18n::clear_cache($locale);
+
print json_encode(new stdClass());
}
diff --git a/modules/gallery/controllers/packager.php b/modules/gallery/controllers/packager.php
index 66626483..aef032a0 100644
--- a/modules/gallery/controllers/packager.php
+++ b/modules/gallery/controllers/packager.php
@@ -82,6 +82,7 @@ class Packager_Controller extends Controller {
module::set_var("gallery", "blocks_{$key}", serialize($blocks));
}
+ Database::instance()->query("TRUNCATE {caches}");
Database::instance()->query("TRUNCATE {sessions}");
Database::instance()->query("TRUNCATE {logs}");
db::build()
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index 84f8a7fb..a43b180b 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class gallery_Core {
- const VERSION = "3.0 git (pre-RC1)";
+ const VERSION = "3.0 RC1 (Santa Fe)";
/**
* If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index b594ddcf..6f8a6688 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -32,6 +32,10 @@ class gallery_installer {
PRIMARY KEY (`id`))
DEFAULT CHARSET=utf8;");
+ // Using a simple index instead of a unique key for the
+ // key column to avoid handling of concurrency issues
+ // on insert. Thus allowing concurrent inserts on the
+ // same cache key, as does Memcache / xcache.
$db->query("CREATE TABLE {caches} (
`id` int(9) NOT NULL auto_increment,
`key` varchar(255) NOT NULL,
@@ -39,6 +43,7 @@ class gallery_installer {
`expiration` int(9) NOT NULL,
`cache` longblob,
PRIMARY KEY (`id`),
+ KEY (`key`),
KEY (`tags`))
DEFAULT CHARSET=utf8;");
@@ -290,7 +295,7 @@ class gallery_installer {
module::set_var("gallery", "credits", (string) $powered_by_string);
module::set_var("gallery", "simultaneous_upload_limit", 5);
module::set_var("gallery", "admin_area_timeout", 90 * 60);
- module::set_version("gallery", 29);
+ module::set_version("gallery", 30);
}
static function upgrade($version) {
@@ -545,6 +550,11 @@ class gallery_installer {
module::set_var("gallery", "credits", "Powered by <a href=\"%url\">%gallery_version</a>");
module::set_version("gallery", $version = 29);
}
+
+ if ($version == 29) {
+ $db->query("ALTER TABLE {caches} ADD KEY (`key`);");
+ module::set_version("gallery", $version = 30);
+ }
}
static function uninstall() {
diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php
index 3e6278e5..617f7f48 100644
--- a/modules/gallery/helpers/gallery_task.php
+++ b/modules/gallery/helpers/gallery_task.php
@@ -201,6 +201,8 @@ class gallery_task_Core {
$total = $num_fetched + $num_remaining;
$task->percent_complete = 70 + 30 * ((float) $num_fetched / $total);
} else {
+ Gallery_I18n::clear_cache();
+
$task->done = true;
$task->state = "success";
$task->status = t("Translations installed/updated");
diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php
index e72d7ed9..62b08fb9 100644
--- a/modules/gallery/helpers/locales.php
+++ b/modules/gallery/helpers/locales.php
@@ -81,6 +81,7 @@ class locales_Core {
$l["eu_ES"] = "Euskara"; // Basque
$l["fa_IR"] = "فارس"; // Farsi
$l["fi_FI"] = "Suomi"; // Finnish
+ $l["fo_FO"] = "Føroyskt"; // Faroese
$l["fr_FR"] = "Français"; // French
$l["ga_IE"] = "Gaeilge"; // Irish
$l["he_IL"] = "עברית"; // Hebrew
diff --git a/modules/gallery/libraries/Gallery_I18n.php b/modules/gallery/libraries/Gallery_I18n.php
index ac0588e3..f1e77744 100644
--- a/modules/gallery/libraries/Gallery_I18n.php
+++ b/modules/gallery/libraries/Gallery_I18n.php
@@ -150,33 +150,44 @@ class Gallery_I18n_Core {
private function lookup($locale, $message) {
if (!isset($this->_cache[$locale])) {
- $this->_cache[$locale] = array();
- // TODO: Load data from locale file instead of the DB.
+ $this->_cache[$locale] = self::load_translations($locale);
+ }
+
+ $key = self::get_message_key($message);
+
+ if (isset($this->_cache[$locale][$key])) {
+ return $this->_cache[$locale][$key];
+ } else {
+ return null;
+ }
+ }
+
+ private static function load_translations($locale) {
+ $cache_key = "translation|" . $locale;
+ $cache = Cache::instance();
+ $translations = $cache->get($cache_key);
+ if (!isset($translations) || !is_array($translations)) {
+ $translations = array();
foreach (db::build()
->select("key", "translation")
->from("incoming_translations")
->where("locale", "=", $locale)
->execute() as $row) {
- $this->_cache[$locale][$row->key] = unserialize($row->translation);
+ $translations[$row->key] = unserialize($row->translation);
}
-
+
// Override incoming with outgoing...
foreach (db::build()
->select("key", "translation")
->from("outgoing_translations")
->where("locale", "=", $locale)
->execute() as $row) {
- $this->_cache[$locale][$row->key] = unserialize($row->translation);
+ $translations[$row->key] = unserialize($row->translation);
}
+
+ $cache->set($cache_key, $translations, array("translation"), 0);
}
-
- $key = self::get_message_key($message);
-
- if (isset($this->_cache[$locale][$key])) {
- return $this->_cache[$locale][$key];
- } else {
- return null;
- }
+ return $translations;
}
public function has_translation($message, $options=null) {
@@ -256,6 +267,15 @@ class Gallery_I18n_Core {
return $this->_call_log;
}
+ public static function clear_cache($locale=null) {
+ $cache = Cache::instance();
+ if ($locale) {
+ $cache->delete("translation|" . $locale);
+ } else {
+ $cache->delete_tag("translation");
+ }
+ }
+
private static function get_plural_key($locale, $count) {
$parts = explode('_', $locale);
$language = $parts[0];
diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php
index 7c76ab04..fef07916 100644
--- a/modules/gallery/libraries/Menu.php
+++ b/modules/gallery/libraries/Menu.php
@@ -184,7 +184,7 @@ class Menu_Core extends Menu_Element {
}
/**
- * Add a new element to this menu
+ * Add a new element to this menu, after the specific element
*/
public function add_after($target_id, $new_menu_element) {
$copy = array();
@@ -199,6 +199,21 @@ class Menu_Core extends Menu_Element {
}
/**
+ * Add a new element to this menu, before the specific element
+ */
+ public function add_before($target_id, $new_menu_element) {
+ $copy = array();
+ foreach ($this->elements as $id => $menu_element) {
+ if ($id == $target_id) {
+ $copy[$new_menu_element->id] = $new_menu_element;
+ }
+ $copy[$id] = $menu_element;
+ }
+ $this->elements = $copy;
+ return $this;
+ }
+
+ /**
* Remove an element from the menu
*/
public function remove($target_id) {
diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php
index 82a09ab9..ff982396 100644
--- a/modules/gallery/libraries/drivers/Cache/Database.php
+++ b/modules/gallery/libraries/drivers/Cache/Database.php
@@ -130,7 +130,7 @@ class Cache_Database_Driver extends Cache_Driver {
// Make sure the expiration is valid and that the hash matches
if ($cache->expiration != 0 && $cache->expiration <= time()) {
// Cache is not valid, delete it now
- $this->delete($cache->id);
+ $this->delete(array($cache->id));
} else {
// Disable notices for unserializing
$ER = error_reporting(~E_NOTICE);
@@ -153,15 +153,17 @@ class Cache_Database_Driver extends Cache_Driver {
* @param bool delete a tag
* @return bool
*/
- public function delete($id, $tag=false) {
+ public function delete($keys, $is_tag=false) {
$db = db::build()
->delete("caches");
- if ($id === true) {
+ if ($keys === true) {
// Delete all caches
- } else if ($tag === true) {
- $db->where("tags", "LIKE", "%<$id>%");
+ } else if ($is_tag === true) {
+ foreach ($keys as $tag) {
+ $db->where("tags", "LIKE", "%<$tag>%");
+ }
} else {
- $db->where("key", "=", $id);
+ $db->where("key", "IN", $keys);
}
$status = $db->execute();
diff --git a/modules/gallery/module.info b/modules/gallery/module.info
index 39615e1c..df2be978 100644
--- a/modules/gallery/module.info
+++ b/modules/gallery/module.info
@@ -1,3 +1,3 @@
name = "Gallery 3"
description = "Gallery core application"
-version = 29
+version = 30
diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php
index 5331117d..6eca396c 100644
--- a/modules/gallery/tests/Access_Helper_Test.php
+++ b/modules/gallery/tests/Access_Helper_Test.php
@@ -20,6 +20,10 @@
class Access_Helper_Test extends Gallery_Unit_Test_Case {
private $_group;
+ public function setup() {
+ identity::set_active_user(identity::guest());
+ }
+
public function teardown() {
try {
$group = identity::lookup_group_by_name("access_test");
@@ -41,10 +45,7 @@ class Access_Helper_Test extends Gallery_Unit_Test_Case {
// Reset some permissions that we mangle below
access::allow(identity::everybody(), "view", item::root());
- }
-
- public function setup() {
- identity::set_active_user(identity::guest());
+ identity::set_active_user(identity::admin_user());
}
public function groups_and_permissions_are_bound_to_columns_test() {
diff --git a/modules/gallery/tests/Cache_Test.php b/modules/gallery/tests/Cache_Test.php
index 1023568b..a942a292 100644
--- a/modules/gallery/tests/Cache_Test.php
+++ b/modules/gallery/tests/Cache_Test.php
@@ -118,7 +118,7 @@ class Cache_Test extends Gallery_Unit_Test_Case {
$value3 = array("field5" => "value5", "field6" => "value6");
$this->_driver->set(array($id3 => $value3), array("tag3", "tag4"), 84600);
- $this->_driver->delete($id1);
+ $this->_driver->delete(array($id1));
$this->assert_false($this->_driver->exists($id1), "$id1 should have been deleted");
$this->assert_true($this->_driver->exists($id2), "$id2 should not have been deleted");
@@ -138,7 +138,7 @@ class Cache_Test extends Gallery_Unit_Test_Case {
$value3 = array("field5" => "value5", "field6" => "value6");
$this->_driver->set(array($id3 => $value3), array("tag3", "tag4"), 84600);
- $data = $this->_driver->delete("tag3", true);
+ $data = $this->_driver->delete_tag(array("tag3"));
$this->assert_true($this->_driver->exists($id1), "$id1 should not have been deleted");
$this->assert_false($this->_driver->exists($id2), "$id2 should have been deleted");
diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php
index 50587702..90106562 100644
--- a/modules/gallery/tests/Item_Helper_Test.php
+++ b/modules/gallery/tests/Item_Helper_Test.php
@@ -18,8 +18,7 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Item_Helper_Test extends Gallery_Unit_Test_Case {
-
- public function setup() {
+ public function teardown() {
identity::set_active_user(identity::admin_user());
}
diff --git a/modules/gallery/tests/Item_Rest_Helper_Test.php b/modules/gallery/tests/Item_Rest_Helper_Test.php
index 6d1dd864..7b86c153 100644
--- a/modules/gallery/tests/Item_Rest_Helper_Test.php
+++ b/modules/gallery/tests/Item_Rest_Helper_Test.php
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case {
+ public function teardown() {
+ identity::set_active_user(identity::admin_user());
+ }
+
public function resolve_test() {
$album = test::random_album();
$resolved = rest::resolve(rest::url("item", $album));
diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt
index 44233459..a3ca31f4 100644
--- a/modules/gallery/tests/xss_data.txt
+++ b/modules/gallery/tests/xss_data.txt
@@ -218,8 +218,8 @@ modules/gallery/views/upgrader.html.php 77 DIRTY $modul
modules/gallery/views/upgrader.html.php 99 DIRTY_ATTR $done?"muted":""
modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $done?"muted":""
modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected)
-modules/gallery/views/user_profile.html.php 36 DIRTY_ATTR $user->avatar_url(40,$theme->url(,true))
-modules/gallery/views/user_profile.html.php 47 DIRTY $info->view
+modules/gallery/views/user_profile.html.php 34 DIRTY_ATTR $user->avatar_url(40,$theme->url(,true))
+modules/gallery/views/user_profile.html.php 43 DIRTY $info->view
modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url()
modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail"))
modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured)
@@ -250,11 +250,11 @@ modules/organize/views/organize_tree.html.php 2 DIRTY_ATTR acce
modules/organize/views/organize_tree.html.php 3 DIRTY_ATTR $album->id
modules/organize/views/organize_tree.html.php 6 DIRTY_ATTR $selected&&$album->id==$selected->id?"ui-state-focus":""
modules/organize/views/organize_tree.html.php 7 DIRTY_ATTR $album->id
-modules/organize/views/organize_tree.html.php 13 DIRTY View::factory("organize_tree.html",array("selected"=>$selected,"album"=>$child));
-modules/organize/views/organize_tree.html.php 15 DIRTY_ATTR access::can("edit",$child)?"":"g-view-only"
-modules/organize/views/organize_tree.html.php 16 DIRTY_ATTR $child->id
-modules/organize/views/organize_tree.html.php 18 DIRTY_ATTR $selected&&$child->id==$selected->id?"ui-state-focus":""
+modules/organize/views/organize_tree.html.php 15 DIRTY View::factory("organize_tree.html",array("selected"=>$selected,"album"=>$child));
+modules/organize/views/organize_tree.html.php 17 DIRTY_ATTR access::can("edit",$child)?"":"g-view-only"
modules/organize/views/organize_tree.html.php 18 DIRTY_ATTR $child->id
+modules/organize/views/organize_tree.html.php 20 DIRTY_ATTR $selected&&$child->id==$selected->id?"ui-state-focus":""
+modules/organize/views/organize_tree.html.php 20 DIRTY_ATTR $child->id
modules/recaptcha/views/admin_recaptcha.html.php 11 DIRTY $form
modules/recaptcha/views/admin_recaptcha.html.php 23 DIRTY_JS $public_key
modules/recaptcha/views/form_recaptcha.html.php 7 DIRTY_JS $public_key
@@ -274,21 +274,16 @@ modules/rss/views/feed.mrss.php 42 DIRTY_ATTR $chi
modules/rss/views/feed.mrss.php 48 DIRTY_ATTR $child->thumb_url(true)
modules/rss/views/feed.mrss.php 49 DIRTY_ATTR $child->thumb_height
modules/rss/views/feed.mrss.php 50 DIRTY_ATTR $child->thumb_width
-modules/rss/views/feed.mrss.php 54 DIRTY_ATTR $child->resize_url(true)
-modules/rss/views/feed.mrss.php 55 DIRTY_ATTR @filesize($child->resize_path())
-modules/rss/views/feed.mrss.php 56 DIRTY_ATTR $child->mime_type
-modules/rss/views/feed.mrss.php 57 DIRTY_ATTR $child->resize_height
-modules/rss/views/feed.mrss.php 58 DIRTY_ATTR $child->resize_width
-modules/rss/views/feed.mrss.php 61 DIRTY_ATTR $child->file_url(true)
-modules/rss/views/feed.mrss.php 62 DIRTY_ATTR @filesize($child->file_path())
-modules/rss/views/feed.mrss.php 63 DIRTY_ATTR $child->mime_type
-modules/rss/views/feed.mrss.php 64 DIRTY_ATTR $child->height
-modules/rss/views/feed.mrss.php 65 DIRTY_ATTR $child->width
-modules/rss/views/feed.mrss.php 70 DIRTY_ATTR $child->file_url(true)
-modules/rss/views/feed.mrss.php 71 DIRTY_ATTR @filesize($child->file_path())
-modules/rss/views/feed.mrss.php 72 DIRTY_ATTR $child->height
-modules/rss/views/feed.mrss.php 73 DIRTY_ATTR $child->width
-modules/rss/views/feed.mrss.php 74 DIRTY_ATTR $child->mime_type
+modules/rss/views/feed.mrss.php 57 DIRTY_ATTR $child->resize_url(true)
+modules/rss/views/feed.mrss.php 58 DIRTY_ATTR @filesize($child->resize_path())
+modules/rss/views/feed.mrss.php 59 DIRTY_ATTR $child->mime_type
+modules/rss/views/feed.mrss.php 60 DIRTY_ATTR $child->resize_height
+modules/rss/views/feed.mrss.php 61 DIRTY_ATTR $child->resize_width
+modules/rss/views/feed.mrss.php 65 DIRTY_ATTR $child->file_url(true)
+modules/rss/views/feed.mrss.php 66 DIRTY_ATTR @filesize($child->file_path())
+modules/rss/views/feed.mrss.php 67 DIRTY_ATTR $child->mime_type
+modules/rss/views/feed.mrss.php 68 DIRTY_ATTR $child->height
+modules/rss/views/feed.mrss.php 69 DIRTY_ATTR $child->width
modules/rss/views/rss_block.html.php 6 DIRTY_JS rss::url($url)
modules/search/views/search.html.php 27 DIRTY_ATTR $item_class
modules/search/views/search.html.php 28 DIRTY_JS $item->url()
@@ -320,8 +315,8 @@ modules/user/views/admin_users.html.php 87 DIRTY ($user
modules/user/views/admin_users.html.php 123 DIRTY_ATTR $group->id
modules/user/views/admin_users.html.php 123 DIRTY_ATTR ($group->special?"g-default-group":"")
modules/user/views/admin_users.html.php 125 DIRTY $v
-modules/user/views/admin_users_group.html.php 22 DIRTY_JS $user->id
-modules/user/views/admin_users_group.html.php 22 DIRTY_JS $group->id
+modules/user/views/admin_users_group.html.php 24 DIRTY_JS $user->id
+modules/user/views/admin_users_group.html.php 24 DIRTY_JS $group->id
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $width
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url
diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php
index 07134475..d4b7b0c1 100644
--- a/modules/gallery/views/admin_languages.html.php
+++ b/modules/gallery/views/admin_languages.html.php
@@ -49,13 +49,14 @@
</tr>
<? $i = 0 ?>
<? foreach ($available_locales as $code => $display_name): ?>
- <? if ($i == (count($available_locales)/2)): ?>
- <table>
- <tr>
- <th> <?= t("Installed") ?> </th>
- <th> <?= t("Language") ?> </th>
- <th> <?= t("Default language") ?> </th>
- </tr>
+ <? if ($i == (int) (count($available_locales)/2)): ?>
+ </table>
+ <table>
+ <tr>
+ <th> <?= t("Installed") ?> </th>
+ <th> <?= t("Language") ?> </th>
+ <th> <?= t("Default language") ?> </th>
+ </tr>
<? endif ?>
<tr class="<?= (isset($installed_locales[$code])) ? "g-available" : "" ?><?= ($default_locale == $code) ? " g-selected" : "" ?>">
<td> <?= form::checkbox("installed_locales[]", $code, isset($installed_locales[$code])) ?> </td>
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index 130c0f99..fcadeef9 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -277,7 +277,7 @@
if ($(event.currentTarget).hasClass("ui-state-focus")) {
return;
}
- var parent = $(event.currentTarget).parents(".g-organize-branch");
+ var parent = $(event.currentTarget).parents(".g-organize-album");
if ($(parent).hasClass("g-view-only")) {
return;
}
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php
index 7cdd97c9..b8d9a889 100644
--- a/modules/rest/controllers/rest.php
+++ b/modules/rest/controllers/rest.php
@@ -68,7 +68,7 @@ class Rest_Controller extends Controller {
}
try {
- print rest::reply(call_user_func(array($handler_class, $handler_method), $request));
+ rest::reply(call_user_func(array($handler_class, $handler_method), $request));
} catch (ORM_Validation_Exception $e) {
foreach ($e->validation->errors() as $key => $value) {
$msgs[] = "$key: $value";
diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php
index f68335df..4cdaa275 100644
--- a/modules/server_add/controllers/server_add.php
+++ b/modules/server_add/controllers/server_add.php
@@ -109,9 +109,11 @@ class Server_Add_Controller extends Admin_Controller {
}
$task = task::run($task_id);
+ // Prevent the JavaScript code from breaking by forcing a period as
+ // decimal separator for all locales with sprintf("%F", $value).
print json_encode(array("done" => (bool)$task->done,
"status" => $task->status,
- "percent_complete" => $task->percent_complete));
+ "percent_complete" => sprintf("%F", $task->percent_complete)));
}
/**
diff --git a/modules/server_add/views/admin_server_add.html.php b/modules/server_add/views/admin_server_add.html.php
index 6dbb8637..933ab7f8 100644
--- a/modules/server_add/views/admin_server_add.html.php
+++ b/modules/server_add/views/admin_server_add.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div class="g-block">
- <h1> <?= t("Add from server admininstration") ?> </h1>
+ <h1> <?= t("Add from server administration") ?> </h1>
<div class="g-block-content">
<?= $form ?>
<h2><?= t("Authorized paths") ?></h2>
diff --git a/modules/tag/tests/Tags_Rest_Helper_Test.php b/modules/tag/tests/Tags_Rest_Helper_Test.php
index cdf7bfdf..dbad0b02 100644
--- a/modules/tag/tests/Tags_Rest_Helper_Test.php
+++ b/modules/tag/tests/Tags_Rest_Helper_Test.php
@@ -26,6 +26,10 @@ class Tags_Rest_Helper_Test extends Gallery_Unit_Test_Case {
}
}
+ public function teardown() {
+ identity::set_active_user(identity::admin_user());
+ }
+
public function get_test() {
$t1 = tag::add(item::root(), "t1");
$t2 = tag::add(item::root(), "t2");