summaryrefslogtreecommitdiff
path: root/modules/gallery/views
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/views')
-rw-r--r--modules/gallery/views/admin_advanced_settings.html.php8
-rw-r--r--modules/gallery/views/admin_block_log_entries.html.php2
-rw-r--r--modules/gallery/views/admin_block_photo_stream.html.php4
-rw-r--r--modules/gallery/views/admin_block_welcome.html.php10
-rw-r--r--modules/gallery/views/admin_languages.html.php81
-rw-r--r--modules/gallery/views/admin_maintenance.html.php4
-rw-r--r--modules/gallery/views/admin_maintenance_show_log.html.php2
-rw-r--r--modules/gallery/views/after_install.html.php2
-rw-r--r--modules/gallery/views/l10n_client.html.php16
-rw-r--r--modules/gallery/views/move_tree.html.php8
-rw-r--r--modules/gallery/views/permissions_browse.html.php25
-rw-r--r--modules/gallery/views/permissions_form.html.php2
-rw-r--r--modules/gallery/views/simple_uploader.html.php67
-rw-r--r--modules/gallery/views/upgrader.html.php2
14 files changed, 118 insertions, 115 deletions
diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php
index b37c1c73..4235e8f8 100644
--- a/modules/gallery/views/admin_advanced_settings.html.php
+++ b/modules/gallery/views/admin_advanced_settings.html.php
@@ -20,13 +20,13 @@
<? if ($var->module_name == "gallery" && $var->name == "_cache") continue ?>
<tr class="setting">
<td> <?= $var->module_name ?> </td>
- <td> <?= p::clean($var->name) ?> </td>
+ <td> <?= html::clean($var->name) ?> </td>
<td>
- <a href="<?= url::site("admin/advanced_settings/edit/$var->module_name/" . p::clean($var->name)) ?>"
+ <a href="<?= url::site("admin/advanced_settings/edit/$var->module_name/" . html::clean($var->name)) ?>"
class="gDialogLink"
- title="<?= t("Edit %var (%module_name)", array("var" => p::clean($var->name), "module_name" => $var->module_name)) ?>">
+ title="<?= t("Edit %var (%module_name)", array("var" => $var->name, "module_name" => $var->module_name)) ?>">
<? if ($var->value): ?>
- <?= p::clean($var->value) ?>
+ <?= html::clean($var->value) ?>
<? else: ?>
<i> <?= t("empty") ?> </i>
<? endif ?>
diff --git a/modules/gallery/views/admin_block_log_entries.html.php b/modules/gallery/views/admin_block_log_entries.html.php
index 44c1657f..780ff2d0 100644
--- a/modules/gallery/views/admin_block_log_entries.html.php
+++ b/modules/gallery/views/admin_block_log_entries.html.php
@@ -2,7 +2,7 @@
<ul>
<? foreach ($entries as $entry): ?>
<li class="<?= log::severity_class($entry->severity) ?>" style="direction: ltr">
- <a href="<?= url::site("user/$entry->user_id") ?>"><?= p::clean($entry->user->name) ?></a>
+ <a href="<?= url::site("user/$entry->user_id") ?>"><?= html::clean($entry->user->name) ?></a>
<?= gallery::date_time($entry->timestamp) ?>
<?= $entry->message ?>
<?= $entry->html ?>
diff --git a/modules/gallery/views/admin_block_photo_stream.html.php b/modules/gallery/views/admin_block_photo_stream.html.php
index 1e1329d1..a50836ad 100644
--- a/modules/gallery/views/admin_block_photo_stream.html.php
+++ b/modules/gallery/views/admin_block_photo_stream.html.php
@@ -2,9 +2,9 @@
<ul>
<? foreach ($photos as $photo): ?>
<li class="gItem gPhoto">
- <a href="<?= url::site("photos/$photo->id") ?>" title="<?= p::clean($photo->title) ?>">
+ <a href="<?= url::site("photos/$photo->id") ?>" title="<?= html::clean($photo->title) ?>">
<img <?= photo::img_dimensions($photo->width, $photo->height, 72) ?>
- src="<?= $photo->thumb_url() ?>" alt="<?= p::clean($photo->title) ?>" />
+ src="<?= $photo->thumb_url() ?>" alt="<?= html::clean($photo->title) ?>" />
</a>
</li>
<? endforeach ?>
diff --git a/modules/gallery/views/admin_block_welcome.html.php b/modules/gallery/views/admin_block_welcome.html.php
index 38d2bd56..71ef4368 100644
--- a/modules/gallery/views/admin_block_welcome.html.php
+++ b/modules/gallery/views/admin_block_welcome.html.php
@@ -5,16 +5,16 @@
<ul>
<li>
<?= t("General Settings - choose your <a href=\"%graphics_url\">graphics</a> and <a href=\"%language_url\">language</a> settings.",
- array("graphics_url" => url::site("admin/graphics"),
- "language_url" => url::site("admin/languages"))) ?>
+ array("graphics_url" => html::mark_safe(url::site("admin/graphics")),
+ "language_url" => html::mark_safe(url::site("admin/languages")))) ?>
</li>
<li>
<?= t("Appearance - <a href=\"%theme_url\">choose a theme</a>, or <a href=\"%theme_options_url\">customize the way it looks</a>.",
- array("theme_url" => url::site("admin/themes"),
- "theme_options_url" => url::site("admin/theme_options"))) ?>
+ array("theme_url" => html::mark_safe(url::site("admin/themes")),
+ "theme_options_url" => html::mark_safe(url::site("admin/theme_options")))) ?>
</li>
<li>
<?= t("Customize - <a href=\"%modules_url\">install modules</a> to add cool features!",
- array("modules_url" => url::site("admin/modules"))) ?>
+ array("modules_url" => html::mark_safe(url::site("admin/modules")))) ?>
</li>
</ul>
diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php
index 4025437a..fa97d299 100644
--- a/modules/gallery/views/admin_languages.html.php
+++ b/modules/gallery/views/admin_languages.html.php
@@ -11,12 +11,11 @@
<tr>
<th> <?= t("Installed") ?> </th>
<th> <?= t("Language") ?> </th>
- <th> <?= t("Default language") ?> </th>
+ <th> <?= t("Default language") ?> </th>
</tr>
<? $i = 0 ?>
<? foreach ($available_locales as $code => $display_name): ?>
-
- <? if ($i == (count($available_locales)/2)): ?>
+ <? if ($i == (count($available_locales)/2)): ?>
<table>
<tr>
<th> <?= t("Installed") ?> </th>
@@ -24,24 +23,24 @@
<th> <?= t("Default language") ?> </th>
</tr>
<? endif ?>
-
+
<tr class="<?= (isset($installed_locales[$code])) ? "installed" : "" ?><?= ($default_locale == $code) ? " default" : "" ?>">
<td> <?= form::checkbox("installed_locales[]", $code, isset($installed_locales[$code])) ?> </td>
- <td> <?= $display_name ?> </td>
- <td>
- <?= form::radio("default_locale", $code, ($default_locale == $code), ((isset($installed_locales[$code]))?'':'disabled="disabled"') ) ?>
- </td>
+ <td> <?= $display_name ?> </td>
+ <td>
+ <?= form::radio("default_locale", $code, ($default_locale == $code), ((isset($installed_locales[$code]))?'':'disabled="disabled"') ) ?>
+ </td>
</tr>
<? $i++ ?>
-
+
<? endforeach ?>
</table>
- <input type="submit" value="<?= t("Update languages") ?>" />
+ <input type="submit" value="<?= t("Update languages")->for_html_attr() ?>" />
</form>
-
- <script type="text/javascript">
- var old_default_locale = "<?= $default_locale ?>";
-
+
+ <script type="text/javascript">
+ var old_default_locale = <?= html::js_string($default_locale) ?>;
+
$("input[name='installed_locales[]']").change(function (event) {
if (this.checked) {
$("input[type='radio'][value='" + this.value + "']").enable();
@@ -57,7 +56,7 @@
dataType: "json",
success: function(data) {
if (data.result == "success") {
- el = $('<a href="<?= url::site("admin/maintenance/start/gallery_task::update_l10n?csrf=$csrf") ?>"></a>'); // this is a little hack to trigger the update_l10n task in a dialog
+ el = $('<a href="' + <?= html::js_string(url::site("admin/maintenance/start/gallery_task::update_l10n?csrf=$csrf")) ?> + '"></a>'); // this is a little hack to trigger the update_l10n task in a dialog
el.gallery_dialog();
el.trigger('click');
}
@@ -68,33 +67,37 @@
<div id="gTranslations">
<h1> <?= t("Translations") ?> </h1>
- <p>
+ <p>
<?= t("Create your own translations and share them with the rest of the Gallery community.") ?>
</p>
-
- <h3><?= t("Translating Gallery") ?></h3>
-
- <div class="gBlock">
- <a href="http://codex.gallery2.org/Gallery3:Localization" target="_blank"
- class="gDocLink ui-state-default ui-corner-all ui-icon ui-icon-help"
- title="<?= t("Localization documentation") ?>">
+
+ <h3><?= t("Translating Gallery") ?></h3>
+
+ <div class="gBlock">
+ <a href="http://codex.gallery2.org/Gallery3:Localization" target="_blank"
+ class="gDocLink ui-state-default ui-corner-all ui-icon ui-icon-help"
+ title="<?= t("Localization documentation")->for_html_attr() ?>">
<?= t("Localization documentation") ?>
</a>
-
- <p><strong><?= t("Step 1") ?>:</strong> <?= t("Make sure the target language is installed and updated (check above).") ?></p>
-
- <p><strong><?= t("Step 2") ?>:</strong> <?= t("Make sure the target language is the active one (currently '").locales::display_name()."')." ?></p>
-
- <p><strong><?= t("Step 3") ?>:</strong> <?= t("Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?></p>
-
- <a href="<?= url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token()) ?>"
- class="gButtonLink ui-state-default ui-corner-all ui-icon-left">
- <span class="ui-icon ui-icon-power"></span>
- <?= t((Session::instance()->get("l10n_mode", false)) ? "Stop translation mode" : "Start translation mode") ?>
- </a>
- </div>
-
- <h3>Sharing your translations</h3>
-
+
+ <p><?= t("<strong>Step 1:</strong> Make sure the target language is installed and up to date (check above).") ?></p>
+
+ <p><?= t("<strong>Step 2:</strong> Make sure you have selected the right target language (currently %default_locale).",
+ array("default_locale" => locales::display_name())) ?></p>
+
+ <p><?= t("<strong>Step 3:</strong> Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?></p>
+
+ <a href="<?= url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token()) ?>"
+ class="gButtonLink ui-state-default ui-corner-all ui-icon-left">
+ <span class="ui-icon ui-icon-power"></span>
+ <? if (Session::instance()->get("l10n_mode", false)): ?>
+ <?= t("Stop translation mode") ?>
+ <? else: ?>
+ <?= t("Start translation mode") ?>
+ <? endif ?>
+ </a>
+</div>
+
+<h3>Sharing your translations</h3>
<?= $share_translations_form ?>
</div>
diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php
index 3649ea58..05bc0923 100644
--- a/modules/gallery/views/admin_maintenance.html.php
+++ b/modules/gallery/views/admin_maintenance.html.php
@@ -93,7 +93,7 @@
<?= $task->status ?>
</td>
<td>
- <?= p::clean($task->owner()->name) ?>
+ <?= html::clean($task->owner()->name) ?>
</td>
<td>
<? if ($task->state == "stalled"): ?>
@@ -164,7 +164,7 @@
<?= $task->status ?>
</td>
<td>
- <?= $task->owner()->name ?>
+ <?= html::clean($task->owner()->name) ?>
</td>
<td>
<? if ($task->done): ?>
diff --git a/modules/gallery/views/admin_maintenance_show_log.html.php b/modules/gallery/views/admin_maintenance_show_log.html.php
index 9d850986..8ea1beb6 100644
--- a/modules/gallery/views/admin_maintenance_show_log.html.php
+++ b/modules/gallery/views/admin_maintenance_show_log.html.php
@@ -12,7 +12,7 @@ appendTo('body').submit().remove();
<div id="gTaskLogDialog">
<h1> <?= $task->name ?> </h1>
<div class="gTaskLog">
- <pre><?= p::purify($task->get_log()) ?></pre>
+ <pre><?= html::purify($task->get_log()) ?></pre>
</div>
<button id="gCloseButton" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Close") ?></button>
<button id="gSaveButton" class="ui-state-default ui-corner-all" onclick="download()"><?= t("Save") ?></button>
diff --git a/modules/gallery/views/after_install.html.php b/modules/gallery/views/after_install.html.php
index bfce46f0..b77a1707 100644
--- a/modules/gallery/views/after_install.html.php
+++ b/modules/gallery/views/after_install.html.php
@@ -8,7 +8,7 @@
</p>
<p>
- <?= t("You're logged in to the <b>%user_name</b> account. The very first thing you should do is to change your password to something that you'll remember.", array("user_name" => p::clean($user->name))) ?>
+ <?= t("You're logged in to the <b>%user_name</b> account. The very first thing you should do is to change your password to something that you'll remember.", array("user_name" => $user->name)) ?>
</p>
<p>
diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php
index 6c440b68..c68a63c8 100644
--- a/modules/gallery/views/l10n_client.html.php
+++ b/modules/gallery/views/l10n_client.html.php
@@ -2,10 +2,10 @@
<div id="l10n-client" class="hidden">
<div class="labels">
<span id="l10n-client-toggler">
- <a id="gMinimizeL10n">_</a>
- <a id="gCloseL10n" title="<?= t("Stop the translation mode") ?>"
- href="<?= url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token()) ?>">X</a>
- </span>
+ <a id="gMinimizeL10n">_</a>
+ <a id="gCloseL10n" title="<?= t("Stop the translation mode")->for_html_attr() ?>"
+ href="<?= html::clean_attribute(url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token())) ?>">X</a>
+ </span>
<div class="label strings"><h2><?= t("Page Text") ?>
<? if (!Input::instance()->get('show_all_l10n_messages')): ?>
<a style="background-color:#fff" href="<?= url::site("admin/languages?show_all_l10n_messages=1") ?>"><?= t("(Show All)") ?></a>
@@ -73,11 +73,11 @@
</div>
</div>
<script type="text/javascript">
- var MSG_TRANSLATE_TEXT = "<?= t("Translate Text") ?>";
- var MSG_CLOSE_X = "<?= t("X") ?>";
+ var MSG_TRANSLATE_TEXT = <?= t("Translate Text")->for_js() ?>;
+ var MSG_CLOSE_X = <?= t("X")->for_js() ?>;
var l10n_client_data = <?= json_encode($string_list) ?>;
var plural_forms = <?= json_encode($plural_forms) ?>;
- var toggle_l10n_mode_url = "<?= url::site("l10n_client/toggle_l10n_mode") ?>";
- var csrf = "<?= access::csrf_token() ?>";
+ var toggle_l10n_mode_url = <?= html::js_string(url::site("l10n_client/toggle_l10n_mode")) ?>;
+ var csrf = <?= html::js_string(access::csrf_token()) ?>;
</script>
</div>
diff --git a/modules/gallery/views/move_tree.html.php b/modules/gallery/views/move_tree.html.php
index 5f70cf67..623f80ee 100644
--- a/modules/gallery/views/move_tree.html.php
+++ b/modules/gallery/views/move_tree.html.php
@@ -1,18 +1,18 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?= $parent->thumb_img(array(), 25); ?>
<? if (!access::can("edit", $parent) || $source->is_descendant($parent)): ?>
-<a href="javascript:load_tree('<?= $parent->id ?>',1)"> <?= p::clean($parent->title) ?> <?= t("(locked)") ?> </a>
+<a href="javascript:load_tree('<?= $parent->id ?>',1)"> <?= html::clean($parent->title) ?> <?= t("(locked)") ?> </a>
<? else: ?>
-<a href="javascript:load_tree('<?= $parent->id ?>',0)"> <?= p::clean($parent->title) ?></a>
+<a href="javascript:load_tree('<?= $parent->id ?>',0)"> <?= html::clean($parent->title) ?></a>
<? endif ?>
<ul id="tree_<?= $parent->id ?>">
<? foreach ($children as $child): ?>
<li id="node_<?= $child->id ?>" class="node">
<?= $child->thumb_img(array(), 25); ?>
<? if (!access::can("edit", $child) || $source->is_descendant($child)): ?>
- <a href="javascript:load_tree('<?= $child->id ?>',1)"> <?= p::clean($child->title) ?> <?= t("(locked)") ?></a>
+ <a href="javascript:load_tree('<?= $child->id ?>',1)"> <?= html::clean($child->title) ?> <?= t("(locked)") ?></a>
<? else: ?>
- <a href="javascript:load_tree('<?= $child->id ?>',0)"> <?= p::clean($child->title) ?> </a>
+ <a href="javascript:load_tree('<?= $child->id ?>',0)"> <?= html::clean($child->title) ?> </a>
<? endif ?>
</li>
<? endforeach ?>
diff --git a/modules/gallery/views/permissions_browse.html.php b/modules/gallery/views/permissions_browse.html.php
index f990896c..231daa04 100644
--- a/modules/gallery/views/permissions_browse.html.php
+++ b/modules/gallery/views/permissions_browse.html.php
@@ -5,9 +5,9 @@
$.ajax({
url: form_url.replace("__ITEM__", id),
success: function(data) {
- $("#gEditPermissionForm").html(data);
- $(".active").removeClass("active");
- $("#item-" + id).addClass("active");
+ $("#gEditPermissionForm").html(data);
+ $(".active").removeClass("active");
+ $("#item-" + id).addClass("active");
}
});
}
@@ -28,28 +28,29 @@
<? if (!$htaccess_works): ?>
<ul id="gMessage">
<li class="gError">
- <?= t("Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable <a %mod_rewrite_attrs>mod_rewrite</a> and set <a %apache_attrs><i>AllowOverride FileInfo Options</i></a> to fix this.", array("mod_rewrite_attrs" => "href=\"http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html\" target=\"_blank\"", "apache_attrs" => "href=\"http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride\" target=\"_blank\"")) ?>
+ <?= t("Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable <a %mod_rewrite_attrs>mod_rewrite</a> and set <a %apache_attrs><i>AllowOverride FileInfo Options</i></a> to fix this.",
+ array("mod_rewrite_attrs" => html::mark_safe("href=\"http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html\" target=\"_blank\"", "apache_attrs" => "href=\"http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride\" target=\"_blank\""))) ?>
</li>
</ul>
<? endif ?>
-
- <p>Edit permissions for album:</p>
-
+
+ <p><?= t("Edit permissions for album:") ?></p>
+
<ul class="gBreadcrumbs">
<? foreach ($parents as $parent): ?>
<li id="item-<?= $parent->id ?>">
<a href="javascript:show(<?= $parent->id ?>)">
- <?= p::purify($parent->title) ?>
+ <?= html::purify($parent->title) ?>
</a>
</li>
<? endforeach ?>
<li class="active" id="item-<?= $item->id ?>">
<a href="javascript:show(<?= $item->id ?>)">
- <?= p::purify($item->title) ?></li>
- </a>
- </li>
+ <?= html::purify($item->title) ?>
+ </a>
+ </li>
</ul>
-
+
<div id="gEditPermissionForm">
<?= $form ?>
</div>
diff --git a/modules/gallery/views/permissions_form.html.php b/modules/gallery/views/permissions_form.html.php
index ee5e3a24..e6b217c5 100644
--- a/modules/gallery/views/permissions_form.html.php
+++ b/modules/gallery/views/permissions_form.html.php
@@ -6,7 +6,7 @@
<tr>
<th> </th>
<? foreach ($groups as $group): ?>
- <th> <?= p::clean($group->name) ?> </th>
+ <th> <?= html::clean($group->name) ?> </th>
<? endforeach ?>
</tr>
diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php
index 29a0dfe8..9cf554ec 100644
--- a/modules/gallery/views/simple_uploader.html.php
+++ b/modules/gallery/views/simple_uploader.html.php
@@ -6,7 +6,7 @@
<!-- hack to set the title for the dialog -->
<form id="gAddPhotosForm" action="<?= url::site("simple_uploader/finish?csrf=$csrf") ?>">
<fieldset>
- <legend> <?= t("Add photos to %album_title", array("album_title" => p::purify($item->title))) ?> </legend>
+ <legend> <?= t("Add photos to %album_title", array("album_title" => html::purify($item->title))) ?> </legend>
</fieldset>
</form>
@@ -26,9 +26,9 @@
</p>
<ul class="gBreadcrumbs">
<? foreach ($item->parents() as $parent): ?>
- <li> <?= p::clean($parent->title) ?> </li>
+ <li> <?= html::clean($parent->title) ?> </li>
<? endforeach ?>
- <li class="active"> <?= p::purify($item->title) ?> </li>
+ <li class="active"> <?= html::purify($item->title) ?> </li>
</ul>
<p>
@@ -82,27 +82,26 @@
<script type="text/javascript">
var swfu = new SWFUpload({
- flash_url: "<?= url::file("lib/swfupload/swfupload.swf") ?>",
- upload_url: "<?= url::site("simple_uploader/add_photo/$item->id") ?>",
- post_params: {
- "g3sid": "<?= Session::instance()->id() ?>",
- "user_agent": "<?= Input::instance()->server("HTTP_USER_AGENT") ?>",
- "csrf": "<?= $csrf ?>"
- },
- file_size_limit: "<?= ini_get("upload_max_filesize") ? num::convert_to_bytes(ini_get("upload_max_filesize"))."B" : "100MB" ?>",
+ flash_url: <?= html::js_string(url::file("lib/swfupload/swfupload.swf")) ?>,
+ upload_url: <?= html::js_string(url::site("simple_uploader/add_photo/$item->id")) ?>,
+ post_params: <?= json_encode(array(
+ "g3sid" => Session::instance()->id(),
+ "user_agent" => Input::instance()->server("HTTP_USER_AGENT"),
+ "csrf" => $csrf)) ?>,
+ file_size_limit: <?= html::js_string(ini_get("upload_max_filesize") ? num::convert_to_bytes(ini_get("upload_max_filesize"))."B" : "100MB") ?>,
file_types: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4",
- file_types_description: "<?= t("Photos and Movies") ?>",
+ file_types_description: <?= t("Photos and Movies")->for_js() ?>,
file_upload_limit: 1000,
file_queue_limit: 0,
custom_settings: { },
debug: false,
// Button settings
- button_image_url: "<?= url::file("themes/default/images/select-photos-backg.png") ?>",
+ button_image_url: <?= html::js_string(url::file("themes/default/images/select-photos-backg.png")) ?>,
button_width: "202",
button_height: "45",
button_placeholder_id: "gChooseFilesButtonPlaceholder",
- button_text: '<span class="swfUploadFont"><?= t("Select photos...") ?></span>',
+ button_text: <?= json_encode('<span class="swfUploadFont">' . t("Select photos...") . '</span>') ?>,
button_text_style: ".swfUploadFont { color: #2E6E9E; font-size: 16px; font-family: Lucida Grande,Lucida Sans,Arial,sans-serif; font-weight: bold; }",
button_text_left_padding: 30,
button_text_top_padding: 10,
@@ -146,13 +145,13 @@
function file_queued(file) {
var fp = new File_Progress(file);
fp.title.html(file.name);
- fp.set_status("pending", "<?= t("Pending...") ?>");
+ fp.set_status("pending", <?= t("Pending...")->for_js() ?>);
// @todo add cancel button to call this.cancelUpload(file.id)
}
function file_queue_error(file, error_code, message) {
if (error_code === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
- alert("<?= t("You have attempted to queue too many files.") ?>");
+ alert(<?= t("You have attempted to queue too many files.")->for_js() ?>);
return;
}
@@ -160,20 +159,20 @@
switch (error_code) {
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
fp.title.html(file.name);
- fp.set_status("error", "<?= t("<strong>File is too big.</strong> A likely error source is a too low value for <em>upload_max_filesize</em> (%upload_max_filesize) in your <em>php.ini</em>.", array("upload_max_filesize" => ini_get("upload_max_filesize"))) ?>");
+ fp.set_status("error", <?= t("<strong>File is too big.</strong> A likely error source is a too low value for <em>upload_max_filesize</em> (%upload_max_filesize) in your <em>php.ini</em>.", array("upload_max_filesize" => ini_get("upload_max_filesize")))->for_js() ?>);
break;
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
fp.title.html(file.name);
- fp.set_status("error", "<?= t("Cannot upload empty files.") ?>");
+ fp.set_status("error", <?= t("Cannot upload empty files.")->for_js() ?>);
break;
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
fp.title.html(file.name);
- fp.set_status("error", "<?= t("Invalid file type.") ?>");
+ fp.set_status("error", <?= t("Invalid file type.")->for_js() ?>);
break;
default:
if (file !== null) {
fp.title.html(file.name);
- fp.set_status("error", "<?= t("Unknown error") ?>");
+ fp.set_status("error", <?= t("Unknown error")->for_js() ?>);
}
break;
}
@@ -194,7 +193,7 @@
// no uploadProgress events are called (limitation in the Linux Flash VM).
var fp = new File_Progress(file);
fp.title.html(file.name);
- fp.set_status("uploading", "<?= t("Uploading...") ?>");
+ fp.set_status("uploading", <?= t("Uploading...")->for_js() ?>);
$("#gAddPhotosCanvas").scrollTo(fp.box, 1000);
return true;
// @todo add cancel button to call this.cancelUpload(file.id)
@@ -203,7 +202,7 @@
function upload_progress(file, bytes_loaded, bytes_total) {
var percent = Math.ceil((bytes_loaded / bytes_total) * 100);
var fp = new File_Progress(file);
- fp.set_status("uploading", "<?= t("Uploading...") ?>");
+ fp.set_status("uploading", <?= t("Uploading...")->for_js() ?>);
fp.progress_bar.css("visibility", "visible");
fp.progress_bar.progressbar("value", percent);
}
@@ -211,42 +210,42 @@
function upload_success(file, serverData) {
var fp = new File_Progress(file);
fp.progress_bar.progressbar("value", 100);
- fp.set_status("complete", "<?= t("Complete.") ?>");
+ fp.set_status("complete", <?= t("Complete.")->for_js() ?>);
}
function upload_error(file, error_code, message) {
var fp = new File_Progress(file);
switch (error_code) {
case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
- fp.set_status("error", "<?= t("Upload error: bad image file") ?>");
+ fp.set_status("error", <?= t("Upload error: bad image file")->for_js() ?>);
break;
case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
- fp.set_status("error", "<?= t("Upload failed") ?>");
+ fp.set_status("error", <?= t("Upload failed")->for_js() ?>);
break;
case SWFUpload.UPLOAD_ERROR.IO_ERROR:
- fp.set_status("error", "<?= t("Server error") ?>");
+ fp.set_status("error", <?= t("Server error")->for_js() ?>);
break;
case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
- fp.set_status("error", "<?= t("Security error") ?>");
+ fp.set_status("error", <?= t("Security error")->for_js() ?>);
break;
case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
- fp.set_status("error", "<?= t("Upload limit exceeded") ?>");
+ fp.set_status("error", <?= t("Upload limit exceeded")->for_js() ?>);
break;
case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
- fp.set_status("error", "<?= t("Failed validation. File skipped") ?>");
+ fp.set_status("error", <?= t("Failed validation. File skipped")->for_js() ?>);
break;
case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
// If there aren't any files left (they were all cancelled) disable the cancel button
if (this.getStats().files_queued === 0) {
$("#gUploadCancel").hide();
}
- fp.set_status("error", "<?= t("Cancelled") ?>");
+ fp.set_status("error", <?= t("Cancelled")->for_js() ?>);
break;
case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
- fp.set_status("error", "<?= t("Stopped") ?>");
+ fp.set_status("error", <?= t("Stopped")->for_js() ?>);
break;
default:
- fp.set_status("error", "<?= t("Unknown error: ") ?>" + error_code);
+ fp.set_status("error", <?= t("Unknown error: ")->for_js() ?> + error_code);
break;
}
}
@@ -260,7 +259,7 @@
}
function get_completed_status_msg(stats) {
- var msg = "<?= t("Upload Queue (completed %completed of %total)", array("completed" => "__COMPLETED__", "total" => "__TOTAL__")) ?>";
+ var msg = <?= t("Upload Queue (completed %completed of %total)", array("completed" => "__COMPLETED__", "total" => "__TOTAL__"))->for_js() ?>;
msg = msg.replace("__COMPLETED__", stats.successful_uploads);
msg = msg.replace("__TOTAL__", stats.files_queued + stats.successful_uploads +
stats.upload_errors + stats.upload_cancelled + stats.queue_errors);
@@ -269,7 +268,7 @@
// This event comes from the Queue Plugin
function queue_complete(num_files_uploaded) {
- var status_msg = "<?= t("Uploaded: __COUNT__") ?>";
+ var status_msg = <?= t("Uploaded: __COUNT__")->for_js() ?>;
$("#gUploadStatus").html(status_msg.replace("__COUNT__", num_files_uploaded));
}
</script>
diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php
index 37578855..de6ce0e7 100644
--- a/modules/gallery/views/upgrader.html.php
+++ b/modules/gallery/views/upgrader.html.php
@@ -18,7 +18,7 @@
<h1> <?= t("That's it!") ?> </h1>
<p>
<?= t("Your <a href=\"%url\">Gallery</a> is up to date.",
- array("url" => url::site("albums/1"))) ?>
+ array("url" => html::mark_safe(url::site("albums/1")))) ?>
</p>
</div>
</div>