summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/g2_import/controllers/admin_g2_import.php3
-rw-r--r--modules/g2_import/controllers/g2.php3
-rw-r--r--modules/g2_import/helpers/g2_import.php4
-rw-r--r--modules/g2_import/helpers/g2_import_task.php5
-rw-r--r--modules/g2_import/views/admin_g2_import.html.php2
-rw-r--r--modules/gallery/helpers/locales.php88
-rw-r--r--modules/gallery/tests/File_Structure_Test.php2
-rw-r--r--modules/gallery/views/upgrader.html.php4
-rw-r--r--modules/tag/controllers/tags.php6
-rw-r--r--modules/tag/helpers/tag_event.php6
-rw-r--r--modules/tag/helpers/tag_item_rest.php2
-rw-r--r--modules/user/tests/No_Direct_ORM_Access_Test.php4
-rw-r--r--themes/wind/views/no_sidebar.html.php6
13 files changed, 72 insertions, 63 deletions
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php
index 6dd155b9..f216091a 100644
--- a/modules/g2_import/controllers/admin_g2_import.php
+++ b/modules/g2_import/controllers/admin_g2_import.php
@@ -32,13 +32,14 @@ class Admin_g2_import_Controller extends Admin_Controller {
$view = new Admin_View("admin.html");
$view->content = new View("admin_g2_import.html");
$view->content->form = $this->_get_import_form();
- $view->content->version = g2_import::version();
+ $view->content->version = '';
if (g2_import::is_initialized()) {
$view->content->g2_stats = $g2_stats;
$view->content->g2_sizes = $g2_sizes;
$view->content->thumb_size = module::get_var("gallery", "thumb_size");
$view->content->resize_size = module::get_var("gallery", "resize_size");
+ $view->content->version = g2_import::version();
}
g2_import::restore_error_reporting();
print $view;
diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php
index 5fd4400c..8260cf9f 100644
--- a/modules/g2_import/controllers/g2.php
+++ b/modules/g2_import/controllers/g2.php
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class G2_Controller extends Admin_Controller {
+class G2_Controller extends Controller {
/**
* Redirect Gallery 2 urls to their appropriate matching Gallery 3 url.
*
@@ -64,6 +64,7 @@ class G2_Controller extends Admin_Controller {
case "resize":
url::redirect($item->resize_url(true));
+ case "file":
case "full":
url::redirect($item->file_url(true));
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 0fcc0539..f13c63b1 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -541,6 +541,10 @@ class g2_import_Core {
$item->save();
self::set_map($g2_item_id, $item->id, "item", $g2_item_url);
+
+ self::set_map($g2_item_id, $item->id, "file",
+ self::g2_url(array("view" => "core.DownloadItem", "itemId" => $g2_item_id)));
+
$derivatives = g2(GalleryCoreApi::fetchDerivativesByItemIds(array($g2_item_id)));
if (!empty($derivatives[$g2_item_id])) {
foreach ($derivatives[$g2_item_id] as $derivative) {
diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php
index e0212b33..2e81adef 100644
--- a/modules/g2_import/helpers/g2_import_task.php
+++ b/modules/g2_import/helpers/g2_import_task.php
@@ -19,14 +19,15 @@
*/
class g2_import_task_Core {
static function available_tasks() {
+ $version = '';
g2_import::lower_error_reporting();
if (g2_import::is_configured()) {
g2_import::init();
+ $version = g2_import::version();
}
- $version = g2_import::version();
g2_import::restore_error_reporting();
- if (class_exists("GalleryCoreApi")) {
+ if (g2_import::is_initialized()) {
return array(Task_Definition::factory()
->callback("g2_import_task::import")
->name(t("Import from Gallery 2"))
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index 6a5214a3..41ef7f85 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -103,7 +103,7 @@
&lt;IfModule mod_rewrite.c&gt;<br/>
RewriteEngine On<br/>
RewriteBase <?= html::clean(g2_import::$g2_base_url) ?><br/>
- RewriteRule ^(.*)$ <?= url::site("g2/map?path=\$1") ?> [QSA,L]<br/>
+ RewriteRule ^(.*)$ <?= url::site("g2/map?path=\$1") ?> [QSA,L,R=301]<br/>
&lt;/IfModule&gt;<br/>
</code>
</div>
diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php
index dc32b12f..d209d414 100644
--- a/modules/gallery/helpers/locales.php
+++ b/modules/gallery/helpers/locales.php
@@ -63,50 +63,50 @@ class locales_Core {
// @todo Might want to add a localizable language name as well.
private static function _init_language_data() {
- $l["af_ZA"] = "Afrikaans"; // Afrikaans
- $l["ar_SA"] = "&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;"; // Arabic
- $l["be_BY"] = "&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1110;"; // Belarusian
- $l["bg_BG"] = "&#x0411;&#x044a;&#x043b;&#x0433;&#x0430;&#x0440;&#x0441;&#x043a;&#x0438;"; // Bulgarian
- $l["ca_ES"] = "Catalan"; // Catalan
- $l["cs_CZ"] = "&#x010c;esky"; // Czech
- $l["da_DK"] = "Dansk"; // Danish
- $l["de_DE"] = "Deutsch"; // German
- $l["el_GR"] = "Greek"; // Greek
- $l["en_GB"] = "English (UK)"; // English (UK)
- $l["en_US"] = "English (US)"; // English (US)
- $l["es_AR"] = "Espa&#241;ol (AR)"; // Spanish (AR)
- $l["es_ES"] = "Espa&#241;ol"; // Spanish (ES)
- $l["es_MX"] = "Espa&#241;ol (MX)"; // Spanish (MX)
- $l["et_EE"] = "Eesti"; // Estonian
- $l["eu_ES"] = "Euskara"; // Basque
- $l["fa_IR"] = "&#1601;&#1575;&#1585;&#1587;&#1610;"; // Farsi
- $l["fi_FI"] = "Suomi"; // Finnish
- $l["fr_FR"] = "Fran&#231;ais"; // French
- $l["ga_IE"] = "Gaeilge"; // Irish
- $l["he_IL"] = "&#1506;&#1489;&#1512;&#1497;&#1514;"; // Hebrew
- $l["hu_HU"] = "Magyar"; // Hungarian
- $l["is_IS"] = "Icelandic"; // Icelandic
- $l["it_IT"] = "Italiano"; // Italian
- $l["ja_JP"] = "&#x65e5;&#x672c;&#x8a9e;"; // Japanese
- $l["ko_KR"] = "&#xd55c;&#xad6d;&#xb9d0;"; // Korean
- $l["lt_LT"] = "Lietuvi&#371;"; // Lithuanian
- $l["lv_LV"] = "Latvie&#353;u"; // Latvian
- $l["nl_NL"] = "Nederlands"; // Dutch
- $l["no_NO"] = "Norsk bokm&#229;l"; // Norwegian
- $l["pl_PL"] = "Polski"; // Polish
- $l["pt_BR"] = "Portugu&#234;s Brasileiro"; // Portuguese (BR)
- $l["pt_PT"] = "Portugu&#234;s"; // Portuguese (PT)
- $l["ro_RO"] = "Rom&#226;n&#259;"; // Romanian
- $l["ru_RU"] = "&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;"; // Russian
- $l["sk_SK"] = "Sloven&#269;ina"; // Slovak
- $l["sl_SI"] = "Sloven&#353;&#269;ina"; // Slovenian
- $l["sr_CS"] = "Srpski"; // Serbian
- $l["sv_SE"] = "Svenska"; // Swedish
- $l["tr_TR"] = "T&#252;rk&#231;e"; // Turkish
- $l["uk_UA"] = "Українська"; // Ukrainian
- $l["vi_VN"] = "Ti&#7871;ng Vi&#7879;t"; // Vietnamese
- $l["zh_CN"] = "&#31616;&#20307;&#20013;&#25991;"; // Chinese (CN)
- $l["zh_TW"] = "&#32321;&#39636;&#20013;&#25991;"; // Chinese (TW)
+ $l["af_ZA"] = "Afrikaans"; // Afrikaans
+ $l["ar_SA"] = "العربي"; // Arabic
+ $l["be_BY"] = "Беларускі"; // Belarusian
+ $l["bg_BG"] = "български"; // Bulgarian
+ $l["ca_ES"] = "Catalan"; // Catalan
+ $l["cs_CZ"] = "čeština"; // Czech
+ $l["da_DK"] = "Dansk"; // Danish
+ $l["de_DE"] = "Deutsch"; // German
+ $l["el_GR"] = "Greek"; // Greek
+ $l["en_GB"] = "English (UK)"; // English (UK)
+ $l["en_US"] = "English (US)"; // English (US)
+ $l["es_AR"] = "Español (AR)"; // Spanish (AR)
+ $l["es_ES"] = "Español"; // Spanish (ES)
+ $l["es_MX"] = "Español (MX)"; // Spanish (MX)
+ $l["et_EE"] = "Eesti"; // Estonian
+ $l["eu_ES"] = "Euskara"; // Basque
+ $l["fa_IR"] = "فارس"; // Farsi
+ $l["fi_FI"] = "Suomi"; // Finnish
+ $l["fr_FR"] = "Français"; // French
+ $l["ga_IE"] = "Gaeilge"; // Irish
+ $l["he_IL"] = "עברית"; // Hebrew
+ $l["hu_HU"] = "Magyar"; // Hungarian
+ $l["is_IS"] = "Icelandic"; // Icelandic
+ $l["it_IT"] = "Italiano"; // Italian
+ $l["ja_JP"] = "日本語"; // Japanese
+ $l["ko_KR"] = "한국어"; // Korean
+ $l["lt_LT"] = "Lietuvių"; // Lithuanian
+ $l["lv_LV"] = "Latviešu"; // Latvian
+ $l["nl_NL"] = "Nederlands"; // Dutch
+ $l["no_NO"] = "Norsk bokmål"; // Norwegian
+ $l["pl_PL"] = "Polski"; // Polish
+ $l["pt_BR"] = "Português do Brasil"; // Portuguese (BR)
+ $l["pt_PT"] = "Português ibérico"; // Portuguese (PT)
+ $l["ro_RO"] = "Română"; // Romanian
+ $l["ru_RU"] = "Русский"; // Russian
+ $l["sk_SK"] = "Slovenčina"; // Slovak
+ $l["sl_SI"] = "Slovenščina"; // Slovenian
+ $l["sr_CS"] = "Srpski"; // Serbian
+ $l["sv_SE"] = "Svenska"; // Swedish
+ $l["tr_TR"] = "Türkçe"; // Turkish
+ $l["uk_UA"] = "українська"; // Ukrainian
+ $l["vi_VN"] = "Tiếng Việt"; // Vietnamese
+ $l["zh_CN"] = "简体中文"; // Chinese (CN)
+ $l["zh_TW"] = "繁體中文"; // Chinese (TW)
asort($l, SORT_LOCALE_STRING);
self::$locales = $l;
diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php
index 4590e95d..9b2b1480 100644
--- a/modules/gallery/tests/File_Structure_Test.php
+++ b/modules/gallery/tests/File_Structure_Test.php
@@ -195,7 +195,7 @@ class File_Structure_Test extends Gallery_Unit_Test_Case {
foreach ($dir as $file) {
$file_as_string = file_get_contents($file);
if (preg_match('/\t/', $file_as_string)) {
- foreach (split("\n", $file_as_string) as $l => $line) {
+ foreach (explode("\n", $file_as_string) as $l => $line) {
if (preg_match('/\t/', $line)) {
$errors[] = "$file:$l has tab(s) ($line)";
}
diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php
index 6cf0068d..4490557c 100644
--- a/modules/gallery/views/upgrader.html.php
+++ b/modules/gallery/views/upgrader.html.php
@@ -112,7 +112,9 @@
<? else: // can_upgrade ?>
<h1> <?= t("Who are you?") ?> </h1>
<p>
- <?= t("You're not logged in as an administrator, so we have to verify you to make sure it's ok for you to do an upgrade. To prove you can run an upgrade, create a file called <br/><b>%name</b> in your <b>gallery3/var/tmp</b> directory.", array("name" => "$upgrade_token")) ?>
+ <?= t("You're not logged in as an administrator, so we have to verify you to make sure it's ok for you to do an upgrade. To prove you can run an upgrade, create a file called <b>%name</b> in your <b>%tmp_dir_path</b> directory.",
+ array("name" => "$upgrade_token",
+ "tmp_dir_path" => "gallery3/var/tmp")) ?>
</p>
<a href="<?= url::site("upgrader?") ?>"><?= t("Ok, I've done that") ?></a>
<? endif // can_upgrade ?>
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index 1eede907..04400d73 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -60,7 +60,7 @@ class Tags_Controller extends Controller {
$form = tag::get_add_form($item);
if ($form->validate()) {
- foreach (split(",", $form->add_tag->inputs["name"]->value) as $tag_name) {
+ foreach (explode(",", $form->add_tag->inputs["name"]->value) as $tag_name) {
$tag_name = trim($tag_name);
if ($tag_name) {
$tag = tag::add($item, $tag_name);
@@ -77,9 +77,9 @@ class Tags_Controller extends Controller {
public function autocomplete() {
$tags = array();
- $tag_parts = preg_split("#,#", Input::instance()->get("q"));
+ $tag_parts = explode(",", Input::instance()->get("q"));
$limit = Input::instance()->get("limit");
- $tag_part = end($tag_parts);
+ $tag_part = ltrim(end($tag_parts));
$tag_list = ORM::factory("tag")
->where("name", "LIKE", "{$tag_part}%")
->order_by("name", "ASC")
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index 403ccd52..10075c02 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -34,7 +34,7 @@ class tag_event_Core {
if (!empty($iptc["2#025"])) {
foreach($iptc["2#025"] as $tag) {
$tag = str_replace("\0", "", $tag);
- foreach (preg_split("/,/", $tag) as $word) {
+ foreach (explode(",", $tag) as $word) {
$word = trim($word);
if (function_exists("mb_detect_encoding") && mb_detect_encoding($word) != "UTF-8") {
$word = utf8_encode($word);
@@ -82,7 +82,7 @@ class tag_event_Core {
static function item_edit_form_completed($item, $form) {
tag::clear_all($item);
- foreach (preg_split("/,/", $form->edit_item->tags->value) as $tag_name) {
+ foreach (explode(",", $form->edit_item->tags->value) as $tag_name) {
if ($tag_name) {
tag::add($item, trim($tag_name));
}
@@ -124,7 +124,7 @@ class tag_event_Core {
}
static function add_photos_form_completed($album, $form) {
- foreach (split(",", $form->add_photos->tags->value) as $tag_name) {
+ foreach (explode(",", $form->add_photos->tags->value) as $tag_name) {
$tag_name = trim($tag_name);
if ($tag_name) {
$tag = tag::add($album, $tag_name);
diff --git a/modules/tag/helpers/tag_item_rest.php b/modules/tag/helpers/tag_item_rest.php
index 672cec53..fe07fefb 100644
--- a/modules/tag/helpers/tag_item_rest.php
+++ b/modules/tag/helpers/tag_item_rest.php
@@ -34,7 +34,7 @@ class tag_item_rest_Core {
}
static function resolve($tuple) {
- list ($tag_id, $item_id) = split(",", $tuple);
+ list ($tag_id, $item_id) = explode(",", $tuple);
$tag = ORM::factory("tag", $tag_id);
$item = ORM::factory("item", $item_id);
if (!$tag->loaded() || !$item->loaded() || !$tag->has($item) || !access::can("view", $item)) {
diff --git a/modules/user/tests/No_Direct_ORM_Access_Test.php b/modules/user/tests/No_Direct_ORM_Access_Test.php
index c372258e..eb7f09b0 100644
--- a/modules/user/tests/No_Direct_ORM_Access_Test.php
+++ b/modules/user/tests/No_Direct_ORM_Access_Test.php
@@ -31,7 +31,7 @@ class No_Direct_ORM_Access_Test extends Gallery_Unit_Test_Case {
//if (basename(dirname($file)) == "helpers") {
$file_as_string = file_get_contents($file);
if (preg_match("/ORM::factory\\(\"user\"/", $file_as_string)) {
- foreach (split("\n", $file_as_string) as $l => $line) {
+ foreach (explode("\n", $file_as_string) as $l => $line) {
if (preg_match('/ORM::factory\\(\"user\"/', $line)) {
$errors[] = "$file($l) => $line";
}
@@ -54,7 +54,7 @@ class No_Direct_ORM_Access_Test extends Gallery_Unit_Test_Case {
foreach ($dir as $file) {
$file_as_string = file_get_contents($file);
if (preg_match("/ORM::factory\\(\"group\"/", $file_as_string)) {
- foreach (split("\n", $file_as_string) as $l => $line) {
+ foreach (explode("\n", $file_as_string) as $l => $line) {
if (preg_match('/ORM::factory\\(\"group\"/', $line)) {
$errors[] = "$file($l) => $line";
}
diff --git a/themes/wind/views/no_sidebar.html.php b/themes/wind/views/no_sidebar.html.php
index 378bd971..83686318 100644
--- a/themes/wind/views/no_sidebar.html.php
+++ b/themes/wind/views/no_sidebar.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul class="g-message-block">
- <li class="g-warning"><?= t("No active sidebar blocks.<br/>
- <a href=\"%url\">Add blocks</a>",
- array("url" => html::mark_clean(url::site("admin/sidebar")))) ?></li>
+ <li class="g-warning"><?= t("No active sidebar blocks." ?>
+ <br/><a href="<?= url::site("admin/sidebar") ?>"><?= t("Add blocks") ?></a>
+ </li>
</ul>