summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/controllers/admin_languages.php6
-rw-r--r--modules/gallery/controllers/combined.php5
-rw-r--r--modules/gallery/helpers/l10n_client.php2
-rw-r--r--modules/gallery/helpers/locales.php (renamed from modules/gallery/helpers/locale.php)2
-rw-r--r--modules/gallery/libraries/Gallery_View.php9
-rw-r--r--modules/gallery/libraries/MY_View.php2
-rw-r--r--modules/gallery/views/l10n_client.html.php2
7 files changed, 18 insertions, 10 deletions
diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php
index d1b805da..ae90ad07 100644
--- a/modules/gallery/controllers/admin_languages.php
+++ b/modules/gallery/controllers/admin_languages.php
@@ -36,7 +36,7 @@ class Admin_Languages_Controller extends Admin_Controller {
$form = $this->_languages_form();
if ($form->validate()) {
module::set_var("gallery", "default_locale", $form->choose_language->locale->value);
- locale::update_installed($form->choose_language->installed_locales->value);
+ locales::update_installed($form->choose_language->installed_locales->value);
message::success(t("Settings saved"));
}
url::redirect("admin/languages");
@@ -89,8 +89,8 @@ class Admin_Languages_Controller extends Admin_Controller {
}
private function _languages_form() {
- $all_locales = locale::available();
- $installed_locales = locale::installed();
+ $all_locales = locales::available();
+ $installed_locales = locales::installed();
$form = new Forge("admin/languages/save", "", "post", array("id" => "gLanguageSettingsForm"));
$group = $form->group("choose_language")
->label(t("Language settings"));
diff --git a/modules/gallery/controllers/combined.php b/modules/gallery/controllers/combined.php
index 925d052d..9a790fdf 100644
--- a/modules/gallery/controllers/combined.php
+++ b/modules/gallery/controllers/combined.php
@@ -60,14 +60,15 @@ class Combined_Controller extends Controller {
$cache = Cache::instance();
$use_gzip = function_exists("gzencode") &&
- (strpos($input->server("HTTP_ACCEPT_ENCODING"), "gzip") !== false);
+ stripos($input->server("HTTP_ACCEPT_ENCODING"), "gzip") !== false &&
+ (int) ini_get("zlib.output_compression") === 0;
+
if ($use_gzip && $content = $cache->get("{$key}_gz")) {
header("Content-Encoding: gzip");
} else {
// Fall back to non-gzipped if we have to
$content = $cache->get($key);
}
-
if (empty($content)) {
Kohana::show_404();
}
diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php
index 6d4da0eb..b576b4e1 100644
--- a/modules/gallery/helpers/l10n_client.php
+++ b/modules/gallery/helpers/l10n_client.php
@@ -74,7 +74,7 @@ class l10n_client_Core {
$request->locales = array();
$request->messages = new stdClass();
- $locales = locale::installed();
+ $locales = locales::installed();
foreach ($locales as $locale => $locale_data) {
$request->locales[] = $locale;
}
diff --git a/modules/gallery/helpers/locale.php b/modules/gallery/helpers/locales.php
index 41b78834..3762b97b 100644
--- a/modules/gallery/helpers/locale.php
+++ b/modules/gallery/helpers/locales.php
@@ -21,7 +21,7 @@
/**
* This is the API for handling locales.
*/
-class locale_Core {
+class locales_Core {
private static $locales;
/**
diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php
index 133066d7..31231ca6 100644
--- a/modules/gallery/libraries/Gallery_View.php
+++ b/modules/gallery/libraries/Gallery_View.php
@@ -73,6 +73,10 @@ class Gallery_View_Core extends View {
protected function combine_files($files, $type) {
$links = array();
+ if (empty($files)) {
+ return;
+ }
+
// Include the url in the cache key so that if the Gallery moves, we don't use old cached
// entries.
$key = array(url::abs_file(""));
@@ -104,7 +108,10 @@ class Gallery_View_Core extends View {
}
$cache->set($key, $contents, array($type), 30 * 84600);
- if (function_exists("gzencode")) {
+
+ $use_gzip = function_exists("gzencode") &&
+ (int) ini_get("zlib.output_compression") === 0;
+ if ($use_gzip) {
$cache->set("{$key}_gz", gzencode($contents, 9, FORCE_GZIP),
array($type, "gzip"), 30 * 84600);
}
diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php
index 96dcc71b..84ee0892 100644
--- a/modules/gallery/libraries/MY_View.php
+++ b/modules/gallery/libraries/MY_View.php
@@ -45,7 +45,7 @@ class View extends View_Core {
}
public function body_attributes() {
- if (locale::is_rtl()) {
+ if (locales::is_rtl()) {
return 'class="rtl"';
}
return '';
diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php
index c0cbbfa2..c73719ca 100644
--- a/modules/gallery/views/l10n_client.html.php
+++ b/modules/gallery/views/l10n_client.html.php
@@ -9,7 +9,7 @@
</h2></div>
<div class="label source"><h2><?= t("Source") ?></div>
<div class="label translation"><h2><?= t("Translation to %language",
- array("language" => locale::display_name())) ?></h2></div>
+ array("language" => locales::display_name())) ?></h2></div>
</div>
<div id="l10n-client-string-select">
<ul class="string-list">