diff options
Diffstat (limited to 'modules/gallery/views')
40 files changed, 985 insertions, 789 deletions
diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php index c3595da5..ff4843ab 100644 --- a/modules/gallery/views/admin_advanced_settings.html.php +++ b/modules/gallery/views/admin_advanced_settings.html.php @@ -1,38 +1,39 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="gAdminAdvancedSettings"> - <h1> <?= t("Advanced Settings") ?> </h1> +<div id="g-admin-advanced-settings" class="g-block"> + <h1> <?= t("Advanced settings") ?> </h1> <p> <?= t("Here are internal Gallery configuration settings. Most of these settings are accessible elsewhere in the administrative console.") ?> </p> - <ul id="gMessage"> - <li class="gWarning"> - <b><?= t("Change these values at your own risk!") ?></b> - </li> + + <ul id="g-action-status" class="g-message-block"> + <li class="g-warning"><?= t("Change these values at your own risk!") ?></li> </ul> - <table> - <tr> - <th> <?= t("Module") ?> </th> - <th> <?= t("Name") ?> </th> - <th> <?= t("Value") ?></th> - </tr> - <? foreach ($vars as $var): ?> - <? if ($var->module_name == "gallery" && $var->name == "_cache") continue ?> - <tr class="setting"> - <td> <?= $var->module_name ?> </td> - <td> <?= html::clean($var->name) ?> </td> - <td> - <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" => $var->name, "module_name" => $var->module_name))->for_html_attr() ?>"> - <? if ($var->value): ?> - <?= html::clean($var->value) ?> - <? else: ?> - <i> <?= t("empty") ?> </i> - <? endif ?> - </a> - </td> - </tr> - <? endforeach ?> - </table> + <div class="g-block-content"> + <table> + <tr> + <th> <?= t("Module") ?> </th> + <th> <?= t("Name") ?> </th> + <th> <?= t("Value") ?></th> + </tr> + <? foreach ($vars as $var): ?> + <? if ($var->module_name == "gallery" && $var->name == "_cache") continue ?> + <tr class="<?= text::alternate("g-odd", "g-even") ?>"> + <td> <?= $var->module_name ?> </td> + <td> <?= html::clean($var->name) ?> </td> + <td> + <a href="<?= url::site("admin/advanced_settings/edit/$var->module_name/" . html::clean($var->name)) ?>" + class="g-dialog-link" + title="<?= t("Edit %var (%module_name)", array("var" => $var->name, "module_name" => $var->module_name))->for_html_attr() ?>"> + <? if ($var->value): ?> + <?= html::clean($var->value) ?> + <? else: ?> + <i> <?= t("empty") ?> </i> + <? endif ?> + </a> + </td> + </tr> + <? endforeach ?> + </table> + </div> </div> diff --git a/modules/gallery/views/admin_block_photo_stream.html.php b/modules/gallery/views/admin_block_photo_stream.html.php index 4968c39b..f9725eee 100644 --- a/modules/gallery/views/admin_block_photo_stream.html.php +++ b/modules/gallery/views/admin_block_photo_stream.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <ul> <? foreach ($photos as $photo): ?> - <li class="gItem gPhoto"> + <li class="g-item g-photo"> <a href="<?= $photo->url() ?>" title="<?= html::purify($photo->title)->for_html_attr() ?>"> <img <?= photo::img_dimensions($photo->width, $photo->height, 72) ?> src="<?= $photo->thumb_url() ?>" alt="<?= html::purify($photo->title)->for_html_attr() ?>" /> diff --git a/modules/gallery/views/admin_block_platform.html.php b/modules/gallery/views/admin_block_platform.html.php index f27b9e7a..b1b8a2f9 100644 --- a/modules/gallery/views/admin_block_platform.html.php +++ b/modules/gallery/views/admin_block_platform.html.php @@ -4,7 +4,7 @@ <?= t("Host name: %host_name", array("host_name" => php_uname("n"))) ?> </li> <li> - <?= t("Operating System: %os %version", array("os" => php_uname("s"), "version" => php_uname("r"))) ?> + <?= t("Operating system: %os %version", array("os" => php_uname("s"), "version" => php_uname("r"))) ?> </li> <li> <?= t("Apache: %apache_version", array("apache_version" => function_exists("apache_get_version") ? apache_get_version() : t("Unknown"))) ?> diff --git a/modules/gallery/views/admin_dashboard.html.php b/modules/gallery/views/admin_dashboard.html.php index 148de65f..f391547e 100644 --- a/modules/gallery/views/admin_dashboard.html.php +++ b/modules/gallery/views/admin_dashboard.html.php @@ -3,34 +3,34 @@ update_blocks = function() { $.get(<?= html::js_string(url::site("admin/dashboard/reorder")) ?>, {"csrf": "<?= $csrf ?>", - "dashboard_center[]": $("#gAdminDashboard").sortable( + "dashboard_center[]": $("#g-admin-dashboard").sortable( "toArray", {attribute: "block_id"}), - "dashboard_sidebar[]": $("#gAdminDashboardSidebar").sortable( + "dashboard_sidebar[]": $("#g-admin-dashboard-sidebar").sortable( "toArray", {attribute: "block_id"})}); }; $(document).ready(function(){ - $("#gAdminDashboard .gBlock .ui-widget-header").addClass("gDraggable"); - $("#gAdminDashboard").sortable({ - connectWith: ["#gAdminDashboardSidebar"], + $("#g-admin-dashboard .g-block .ui-widget-header").addClass("g-draggable"); + $("#g-admin-dashboard").sortable({ + connectWith: ["#g-admin-dashboard-sidebar"], cursor: "move", handle: $(".ui-widget-header"), opacity: 0.6, - placeholder: "gDropTarget", + placeholder: "g-target", stop: update_blocks }); - $("#gAdminDashboardSidebar .gBlock .ui-widget-header").addClass("gDraggable"); - $("#gAdminDashboardSidebar").sortable({ - connectWith: ["#gAdminDashboard"], + $("#g-admin-dashboard-sidebar .g-block .ui-widget-header").addClass("g-draggable"); + $("#g-admin-dashboard-sidebar").sortable({ + connectWith: ["#g-admin-dashboard"], cursor: "move", handle: $(".ui-widget-header"), opacity: 0.6, - placeholder: "gDropTarget", + placeholder: "g-target", stop: update_blocks }); }); </script> -<div id="gAdminDashboard"> +<div id="g-admin-dashboard"> <?= $blocks ?> </div> diff --git a/modules/gallery/views/admin_graphics.html.php b/modules/gallery/views/admin_graphics.html.php index f64c7f80..3a48e087 100644 --- a/modules/gallery/views/admin_graphics.html.php +++ b/modules/gallery/views/admin_graphics.html.php @@ -1,36 +1,39 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <script type="text/javascript"> $(document).ready(function() { + $(".g-available .g-block").equal_heights(); select_toolkit = function(el) { - if (!$(this).hasClass("gUnavailable")) { + if (!$(this).hasClass("g-unavailable")) { window.location = <?= html::js_string(url::site("admin/graphics/choose/__TK__?csrf=$csrf")) ?> .replace("__TK__", $(this).attr("id")); } }; - $("#gAdminGraphics div.gAvailable .gBlock").click(select_toolkit); + $("#g-admin-graphics div.g-available .g-block").click(select_toolkit); }); </script> -<div id="gAdminGraphics"> - <h1> <?= t("Graphics Settings") ?> </h1> +<div id="g-admin-graphics" class="g-block ui-helper-clearfix"> + <h1> <?= t("Graphics settings") ?> </h1> <p> <?= t("Gallery needs a graphics toolkit in order to manipulate your photos. Please choose one from the list below.") ?> </p> - <h2> <?= t("Active Toolkit") ?> </h2> - <? if ($active == "none"): ?> - <?= new View("admin_graphics_none.html") ?> - <? else: ?> - <?= new View("admin_graphics_$active.html", array("tk" => $tk->$active, "is_active" => true)) ?> - <? endif ?> - - <div class="gAvailable"> - <h2> <?= t("Available Toolkits") ?> </h2> - <? foreach (array_keys((array)$tk) as $id): ?> - <? if ($id != $active): ?> - <?= new View("admin_graphics_$id.html", array("tk" => $tk->$id, "is_active" => false)) ?> + <div class="g-block-content"> + <h2> <?= t("Active toolkit") ?> </h2> + <? if ($active == "none"): ?> + <?= new View("admin_graphics_none.html") ?> + <? else: ?> + <?= new View("admin_graphics_$active.html", array("tk" => $tk->$active, "is_active" => true)) ?> <? endif ?> - <? endforeach ?> + + <div class="g-available"> + <h2> <?= t("Available toolkits") ?> </h2> + <? foreach (array_keys((array)$tk) as $id): ?> + <? if ($id != $active): ?> + <?= new View("admin_graphics_$id.html", array("tk" => $tk->$id, "is_active" => false)) ?> + <? endif ?> + <? endforeach ?> + </div> </div> </div> diff --git a/modules/gallery/views/admin_graphics_gd.html.php b/modules/gallery/views/admin_graphics_gd.html.php index 010a31b4..1cc9dc9e 100644 --- a/modules/gallery/views/admin_graphics_gd.html.php +++ b/modules/gallery/views/admin_graphics_gd.html.php @@ -1,5 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="gd" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->installed ? " gInstalledToolkit" : " gUnavailable" ?>"> +<div id="gd" class="g-block<?= $is_active ? " g-selected" : "" ?><?= $tk->installed ? " g-installed-toolkit" : " g-unavailable" ?>"> <img class="logo" width="170" height="110" src="<?= url::file("modules/gallery/images/gd.png"); ?>" alt="<? t("Visit the GD lib project site") ?>" /> <h3> <?= t("GD") ?> </h3> <p> @@ -7,23 +7,23 @@ array("url" => "http://www.boutell.com/gd")) ?> </p> <? if ($tk->installed && $tk->rotate): ?> - <div class="gModuleStatus gInfo"> + <div class="g-module-status g-info"> <?= t("You have GD version %version.", array("version" => $tk->version)) ?> </div> <p> - <a class="gButtonLink ui-state-default ui-corner-all"><?= t("Activate GD") ?></a> + <a class="g-button ui-state-default ui-corner-all"><?= t("Activate GD") ?></a> </p> <? elseif ($tk->installed): ?> <? if ($tk->error): ?> - <p class="gModuleStatus gWarning"> + <p class="g-module-status g-warning"> <?= $tk->error ?> </p> <? endif ?> <p> - <a class="gButtonLink ui-state-default ui-corner-all"><?= t("Activate GD") ?></a> + <a class="g-button ui-state-default ui-corner-all"><?= t("Activate GD") ?></a> </p> <? else: ?> - <div class="gModuleStatus gInfo"> + <div class="g-module-status g-info"> <?= t("You do not have GD installed.") ?> </div> <? endif ?> diff --git a/modules/gallery/views/admin_graphics_graphicsmagick.html.php b/modules/gallery/views/admin_graphics_graphicsmagick.html.php index 97624850..5dae1442 100644 --- a/modules/gallery/views/admin_graphics_graphicsmagick.html.php +++ b/modules/gallery/views/admin_graphics_graphicsmagick.html.php @@ -1,5 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="graphicsmagick" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->installed ? " gInstalledToolkit" : " gUnavailable" ?>"> +<div id="graphicsmagick" class="g-block<?= $is_active ? " g-selected" : "" ?><?= $tk->installed ? " g-installed-toolkit" : " g-unavailable" ?>"> <img class="logo" width="107" height="76" src="<?= url::file("modules/gallery/images/graphicsmagick.png"); ?>" alt="<? t("Visit the GraphicsMagick project site") ?>" /> <h3> <?= t("GraphicsMagick") ?> </h3> <p> @@ -7,14 +7,14 @@ array("url" => "http://www.graphicsmagick.org")) ?> </p> <? if ($tk->installed): ?> - <div class="gModuleStatus gInfo"> + <div class="g-module-status g-info"> <?= t("GraphicsMagick version %version is available in %dir", array("version" => $tk->version, "dir" => $tk->dir)) ?> </div> <p> - <a class="gButtonLink ui-state-default ui-corner-all"><?= t("Activate Graphics Magic") ?></a> + <a class="g-button ui-state-default ui-corner-all"><?= t("Activate Graphics Magic") ?></a> </p> <? else: ?> - <div class="gModuleStatus gWarning"> + <div class="g-module-status g-warning"> <?= $tk->error ?> </div> <? endif ?> diff --git a/modules/gallery/views/admin_graphics_imagemagick.html.php b/modules/gallery/views/admin_graphics_imagemagick.html.php index cdff7c2c..9c1a9909 100644 --- a/modules/gallery/views/admin_graphics_imagemagick.html.php +++ b/modules/gallery/views/admin_graphics_imagemagick.html.php @@ -1,5 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="imagemagick" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->installed ? " gInstalledToolkit" : " gUnavailable" ?>"> +<div id="imagemagick" class="g-block<?= $is_active ? " g-selected" : "" ?><?= $tk->installed ? " g-installed-toolkit" : " g-unavailable" ?>"> <img class="logo" width="114" height="118" src="<?= url::file("modules/gallery/images/imagemagick.jpg"); ?>" alt="<? t("Visit the ImageMagick project site") ?>" /> <h3> <?= t("ImageMagick") ?> </h3> <p> @@ -7,14 +7,14 @@ array("url" => "http://www.imagemagick.org")) ?> </p> <? if ($tk->installed): ?> - <div class="gModuleStatus gInfo"> + <div class="g-module-status g-info"> <?= t("ImageMagick version %version is available in %dir", array("version" => $tk->version, "dir" => $tk->dir)) ?> </div> <p> - <a class="gButtonLink ui-state-default ui-corner-all"><?= t("Activate ImageMagick") ?></a> + <a class="g-button ui-state-default ui-corner-all"><?= t("Activate ImageMagick") ?></a> </p> <? elseif ($tk->error): ?> - <div class="gModuleStatus gWarning"> + <div class="g-module-status g-warning"> <?= $tk->error ?> </div> <? endif ?> diff --git a/modules/gallery/views/admin_graphics_none.html.php b/modules/gallery/views/admin_graphics_none.html.php index e6923a5a..e0fc4170 100644 --- a/modules/gallery/views/admin_graphics_none.html.php +++ b/modules/gallery/views/admin_graphics_none.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="none" class="gModuleStatus gWarning gBlock"> - <h3> <?= t("No Active Toolkit") ?> </h3> +<div id="none" class="g-module-status g-warning g-block"> + <h3> <?= t("No active toolkit") ?> </h3> <p> <?= t("We were unable to detect a graphics program. You must install one of the toolkits below in order to use many Gallery features.") ?> </p> diff --git a/modules/gallery/views/admin_identity.html.php b/modules/gallery/views/admin_identity.html.php new file mode 100644 index 00000000..51eaa58a --- /dev/null +++ b/modules/gallery/views/admin_identity.html.php @@ -0,0 +1,59 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<script type="text/javascript"> + $(document).ready(function() { + $("#g-modules form").submit(function() { + var eDialog = '<div id="g-dialog"></div>'; + var params = $(this).serialize(); + var url = $(this).attr("action"); + $("body").append(eDialog); + $.post($(this).attr("action"), $(this).serialize(), function(data, textStatus) { + $("#g-dialog").html(data); + $("#g-dialog").dialog({ + bgiframe: true, + title: <?= t("Confirm identity provider change")->for_js() ?>, + resizable: false, + height:180, + modal: true, + overlay: { + backgroundColor: '#000', + opacity: 0.5 + }, + buttons: { + "Continue": function() { + $("#g-dialog form").submit(); + }, + Cancel: function() { + $(this).dialog('destroy').remove(); + } + } + }); + }); + return false; + }); + }); + +</script> +<div id="g-modules"> + <h1> <?= t("Manage identity providers") ?> </h1> + <p> + <?= t("Choose a different user/group management provider.") ?> + </p> + + <form method="post" action="<?= url::site("admin/identity/confirm") ?>"> + <?= access::csrf_form_field() ?> + <table> + <tr> + <th> <?= t("Active") ?> </th> + <th> <?= t("Description") ?> </th> + </tr> + <? foreach ($available as $module_name => $description): ?> + <tr class="<?= text::alternate("g-odd", "g-even") ?>"> + <? $data = array("name" => "provider"); ?> + <td> <?= form::radio($data, $module_name, $module_name == $active) ?> </td> + <td> <?= t($description) ?> </td> + </tr> + <? endforeach ?> + </table> + <input type="submit" value="<?= t("Change")->for_html_attr() ?>" /> + </form> +</div> diff --git a/modules/gallery/views/admin_identity_confirm.html.php b/modules/gallery/views/admin_identity_confirm.html.php new file mode 100644 index 00000000..54aae9c8 --- /dev/null +++ b/modules/gallery/views/admin_identity_confirm.html.php @@ -0,0 +1,10 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<form method="post" action="<?= url::site("admin/identity/change") ?>"> + <?= access::csrf_form_field() ?> + <?= form::hidden("provider", $new_provider) ?> + + <p><span class="ui-icon ui-icon-alert" style="float: left; margin:0 7px 20px 0;"></span> + <?= t("Are you sure you want to change your Identity Provider? Continuing will delete all existing users.") ?> + </p> +</form> + diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php index fb30c7ba..07134475 100644 --- a/modules/gallery/views/admin_languages.html.php +++ b/modules/gallery/views/admin_languages.html.php @@ -1,46 +1,8 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="gLanguages"> - <h1> <?= t("Languages") ?> </h1> - <p> - <?= t("Install new languages, update installed ones and set the default language for your Gallery.") ?> - </p> - - <form id="gLanguagesForm" method="post" action="<?= url::site("admin/languages/save") ?>"> - <?= access::csrf_form_field() ?> - <table> - <tr> - <th> <?= t("Installed") ?> </th> - <th> <?= t("Language") ?> </th> - <th> <?= t("Default language") ?> </th> - </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> - <? 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> - </tr> - <? $i++ ?> - - <? endforeach ?> - </table> - <input type="submit" value="<?= t("Update languages")->for_html_attr() ?>" /> - </form> - - <script type="text/javascript"> - var old_default_locale = <?= html::js_string($default_locale) ?>; +<script type="text/javascript"> + var old_default_locale = <?= html::js_string($default_locale) ?>; + $("#g-languages-form").ready(function() { $("input[name='installed_locales[]']").change(function (event) { if (this.checked) { $("input[type='radio'][value='" + this.value + "']").enable(); @@ -51,8 +13,8 @@ $("input[type='radio'][value='" + this.value + "']").attr("disabled", "disabled"); } }); - - $("#gLanguagesForm").ajaxForm({ + + $("#g-languages-form").ajaxForm({ dataType: "json", success: function(data) { if (data.result == "success") { @@ -62,42 +24,91 @@ } } }); - </script> -</div> + }); +</script> -<div id="gTranslations"> - <h1> <?= t("Translations") ?> </h1> - <p> - <?= t("Create your own translations and share them with the rest of the Gallery community.") ?> - </p> +<div class="g-block"> + <h1> <?= t("Languages and translation") ?> </h1> - <h3><?= t("Translating Gallery") ?></h3> + <div class="g-block-content"> - <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> + <div id="g-languages" class="g-block"> + <h2> <?= t("Languages") ?> </h2> + <p> + <?= t("Install new languages, update installed ones and set the default language for your Gallery.") ?> + </p> - <p><?= t("<strong>Step 1:</strong> Make sure the target language is installed and up to date (check above).") ?></p> + <div class="g-block-content ui-helper-clearfix"> + <form id="g-languages-form" method="post" action="<?= url::site("admin/languages/save") ?>"> + <?= access::csrf_form_field() ?> + <table class="g-left"> + <tr> + <th> <?= t("Installed") ?> </th> + <th> <?= t("Language") ?> </th> + <th> <?= t("Default language") ?> </th> + </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> + <? 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> + <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")->for_html_attr() ?>" /> + </form> + </div> + </div> - <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> + <div id="g-translations" class="g-block"> + <h2> <?= t("Translations") ?> </h2> + <p> + <?= t("Create your own translations and share them with the rest of the Gallery community.") ?> + </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> + <div class="g-block-content"> + <a href="http://codex.gallery2.org/Gallery3:Localization" target="_blank" + class="g-right ui-state-default ui-corner-all ui-icon ui-icon-help" + title="<?= t("Localization documentation")->for_html_attr() ?>"> + <?= t("Localization documentation") ?> + </a> - <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><?= t("Translating Gallery") ?></h3> + + <p><?= t("Follow these steps to begin translating Gallery.") ?></p> + + <ol> + <li><?= t("Make sure the target language is installed and up to date (check above).") ?></li> + <li><?= t("Make sure you have selected the right target language (currently %default_locale).", + array("default_locale" => locales::display_name())) ?></li> + <li><?= t("Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?></li> + </ol> + <a href="<?= url::site("l10n_client/toggle_l10n_mode?csrf=".access::csrf_token()) ?>" + class="g-button 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> + + <h3><?= t("Sharing your translations") ?></h3> + <?= $share_translations_form ?> + </div> + </div> -<h3><?= t("Sharing your translations") ?></h3> - <?= $share_translations_form ?> + </div> </div> diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index ce693d73..ac597715 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -1,193 +1,189 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="gAdminMaintenance"> - <h1> <?= t("Maintenance Tasks") ?> </h1> +<div id="g-admin-maintenance" class="g-block"> + <h1> <?= t("Maintenance tasks") ?> </h1> <p> <?= t("Occasionally your Gallery will require some maintenance. Here are some tasks you can use to keep it running smoothly.") ?> </p> - <div id="gAvailableTasks"> - <h2> <?= t("Available Tasks") ?> </h2> - <table> - <tr> - <th> - <?= t("Name") ?> - </th> - <th> - <?= t("Description") ?> - </th> - <th> - <?= t("Action") ?> - </th> - </tr> - <? $i = 0; ?> - <? foreach ($task_definitions as $task): ?> - <tr class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?> <?= log::severity_class($task->severity) ?>"> - <td class="<?= log::severity_class($task->severity) ?>"> - <?= $task->name ?> - </td> - <td> - <?= $task->description ?> - </td> - <td> - <a href="<?= url::site("admin/maintenance/start/$task->callback?csrf=$csrf") ?>" - class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"> - <?= t("run") ?> - </a> - </td> - </tr> - <? $i++ ?> - <? endforeach ?> - </table> - </div> + <div class="g-block-content"> + <div id="g-available-tasks"> + <h2> <?= t("Available tasks") ?> </h2> + <table> + <tr> + <th> + <?= t("Name") ?> + </th> + <th> + <?= t("Description") ?> + </th> + <th> + <?= t("Action") ?> + </th> + </tr> + <? foreach ($task_definitions as $task): ?> + <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= log::severity_class($task->severity) ?>"> + <td class="<?= log::severity_class($task->severity) ?>"> + <?= $task->name ?> + </td> + <td> + <?= $task->description ?> + </td> + <td> + <a href="<?= url::site("admin/maintenance/start/$task->callback?csrf=$csrf") ?>" + class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> + <?= t("run") ?> + </a> + </td> + </tr> + <? endforeach ?> + </table> + </div> - <? if ($running_tasks->count()): ?> - <div id="gRunningTasks"> - <h2> <?= t("Running Tasks") ?> </h2> - <table> - <tr> - <th> - <?= t("Last Updated") ?> - </th> - <th> - <?= t("Name") ?> - </th> - <th> - <?= t("Status") ?> - </th> - <th> - <?= t("Info") ?> - </th> - <th> - <?= t("Owner") ?> - </th> - <th> - <?= t("Action") ?> - <a href="<?= url::site("admin/maintenance/cancel_running_tasks?csrf=$csrf") ?>" - class="gButtonLink ui-icon-left ui-state-default ui-corner-all right"> - <?= t("cancel all") ?></a> - </th> - </tr> - <? $i = 0; ?> - <? foreach ($running_tasks as $task): ?> - <tr class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?> <?= $task->state == "stalled" ? "gWarning" : "" ?>"> - <td class="<?= $task->state == "stalled" ? "gWarning" : "" ?>"> - <?= gallery::date_time($task->updated) ?> - </td> - <td> - <?= $task->name ?> - </td> - <td> - <? if ($task->done): ?> - <? if ($task->state == "cancelled"): ?> - <?= t("Cancelled") ?> - <? endif ?> - <?= t("Close") ?> - <? elseif ($task->state == "stalled"): ?> - <?= t("Stalled") ?> - <? else: ?> - <?= t("%percent_complete% Complete", array("percent_complete" => $task->percent_complete)) ?> - <? endif ?> - </td> - <td> - <?= $task->status ?> - </td> - <td> - <?= html::clean($task->owner()->name) ?> - </td> - <td> - <? if ($task->state == "stalled"): ?> - <a class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all" - href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>"> - <?= t("resume") ?> - </a> - <? endif ?> - <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" - class="gButtonLink ui-icon-left ui-state-default ui-corner-all right"> - <?= t("cancel") ?> - </a> - </td> - </tr> - <? $i++ ?> - <? endforeach ?> - </table> - </div> - <? endif ?> + <? if ($running_tasks->count()): ?> + <div id="g-running-tasks"> + <h2> <?= t("Running tasks") ?> </h2> + <table> + <tr> + <th> + <?= t("Last updated") ?> + </th> + <th> + <?= t("Name") ?> + </th> + <th> + <?= t("Status") ?> + </th> + <th> + <?= t("Info") ?> + </th> + <th> + <?= t("Owner") ?> + </th> + <th> + <a href="<?= url::site("admin/maintenance/cancel_running_tasks?csrf=$csrf") ?>" + class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> + <?= t("cancel all") ?></a> + <?= t("Action") ?> + </th> + </tr> + <? foreach ($running_tasks as $task): ?> + <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= $task->state == "stalled" ? "g-warning" : "" ?>"> + <td class="<?= $task->state == "stalled" ? "g-warning" : "" ?>"> + <?= gallery::date_time($task->updated) ?> + </td> + <td> + <?= $task->name ?> + </td> + <td> + <? if ($task->done): ?> + <? if ($task->state == "cancelled"): ?> + <?= t("Cancelled") ?> + <? endif ?> + <?= t("Close") ?> + <? elseif ($task->state == "stalled"): ?> + <?= t("Stalled") ?> + <? else: ?> + <?= t("%percent_complete% Complete", array("percent_complete" => $task->percent_complete)) ?> + <? endif ?> + </td> + <td> + <?= $task->status ?> + </td> + <td> + <?= html::clean($task->owner()->name) ?> + </td> + <td> + <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" + class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> + <?= t("cancel") ?> + </a> + <? if ($task->state == "stalled"): ?> + <a class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all" + href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>"> + <?= t("resume") ?> + </a> + <? endif ?> + </td> + </tr> + <? endforeach ?> + </table> + </div> + <? endif ?> - <? if ($finished_tasks->count()): ?> - <div id="gFinishedTasks"> - <h2> <?= t("Finished Tasks") ?> </h2> - <table> - <tr> - <th> - <?= t("Last Updated") ?> - </th> - <th> - <?= t("Name") ?> - </th> - <th> - <?= t("Status") ?> - </th> - <th> - <?= t("Info") ?> - </th> - <th> - <?= t("Owner") ?> - </th> - <th> - <?= t("Action") ?> - <a href="<?= url::site("admin/maintenance/remove_finished_tasks?csrf=$csrf") ?>" - class="gButtonLink ui-icon-left ui-state-default ui-corner-all right"> - <span class="ui-icon ui-icon-trash"></span><?= t("remove all finished") ?></a> - </th> - </tr> - <? $i = 0; ?> - <? foreach ($finished_tasks as $task): ?> - <tr class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?> <?= $task->state == "success" ? "gSuccess" : "gError" ?>"> - <td class="<?= $task->state == "success" ? "gSuccess" : "gError" ?>"> - <?= gallery::date_time($task->updated) ?> - </td> - <td> - <?= $task->name ?> - </td> - <td> - <? if ($task->state == "success"): ?> - <?= t("Success") ?> - <? elseif ($task->state == "error"): ?> - <?= t("Failed") ?> - <? elseif ($task->state == "cancelled"): ?> - <?= t("Cancelled") ?> - <? endif ?> - </td> - <td> - <?= $task->status ?> - </td> - <td> - <?= html::clean($task->owner()->name) ?> - </td> - <td> - <? if ($task->done): ?> - <a href="<?= url::site("admin/maintenance/remove/$task->id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all"> - <?= t("remove") ?> - </a> - <? if ($task->get_log()): ?> - <a href="<?= url::site("admin/maintenance/show_log/$task->id?csrf=$csrf") ?>" class="gDialogLink gButtonLink ui-state-default ui-corner-all"> - <?= t("browse log") ?> - </a> - <? endif ?> - <? else: ?> - <a href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>" class="gDialogLink gButtonLink" ui-state-default ui-corner-all> - <?= t("resume") ?> - </a> - <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all"> - <?= t("cancel") ?> - </a> - <? endif ?> - </ul> - </td> - </tr> - <? endforeach ?> - <? $i++ ?> - </table> + <? if ($finished_tasks->count()): ?> + <div id="g-finished-tasks"> + <a href="<?= url::site("admin/maintenance/remove_finished_tasks?csrf=$csrf") ?>" + class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> + <span class="ui-icon ui-icon-trash"></span><?= t("remove all finished") ?></a> + <h2> <?= t("Finished tasks") ?> </h2> + <table> + <tr> + <th> + <?= t("Last updated") ?> + </th> + <th> + <?= t("Name") ?> + </th> + <th> + <?= t("Status") ?> + </th> + <th> + <?= t("Info") ?> + </th> + <th> + <?= t("Owner") ?> + </th> + <th> + <?= t("Action") ?> + </th> + </tr> + <? foreach ($finished_tasks as $task): ?> + <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= $task->state == "success" ? "g-success" : "g-error" ?>"> + <td class="<?= $task->state == "success" ? "g-success" : "g-error" ?>"> + <?= gallery::date_time($task->updated) ?> + </td> + <td> + <?= $task->name ?> + </td> + <td> + <? if ($task->state == "success"): ?> + <?= t("Success") ?> + <? elseif ($task->state == "error"): ?> + <?= t("Failed") ?> + <? elseif ($task->state == "cancelled"): ?> + <?= t("Cancelled") ?> + <? endif ?> + </td> + <td> + <?= $task->status ?> + </td> + <td> + <?= html::clean($task->owner()->name) ?> + </td> + <td> + <? if ($task->done): ?> + <a href="<?= url::site("admin/maintenance/remove/$task->id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all"> + <?= t("remove") ?> + </a> + <? if ($task->get_log()): ?> + <a href="<?= url::site("admin/maintenance/show_log/$task->id?csrf=$csrf") ?>" class="g-dialog-link g-button ui-state-default ui-corner-all"> + <?= t("browse log") ?> + </a> + <? endif ?> + <? else: ?> + <a href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>" class="g-dialog-link g-button" ui-state-default ui-corner-all> + <?= t("resume") ?> + </a> + <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all"> + <?= t("cancel") ?> + </a> + <? endif ?> + </ul> + </td> + </tr> + <? endforeach ?> + </table> + </div> + <? endif ?> </div> - <? endif ?> </div> diff --git a/modules/gallery/views/admin_maintenance_show_log.html.php b/modules/gallery/views/admin_maintenance_show_log.html.php index 8ea1beb6..d2472fdc 100644 --- a/modules/gallery/views/admin_maintenance_show_log.html.php +++ b/modules/gallery/views/admin_maintenance_show_log.html.php @@ -2,18 +2,18 @@ <script type="text/javascript"> dismiss = function() { window.location.reload(); - } - download = function(){ + }; + download = function() { // send request $('<form action="<?= url::site("admin/maintenance/save_log/$task->id?csrf=$csrf") ?>" method="post"></form>'). appendTo('body').submit().remove(); }; </script> -<div id="gTaskLogDialog"> +<div id="g-task-log-dialog"> <h1> <?= $task->name ?> </h1> - <div class="gTaskLog"> + <div class="g-task-log g-text-small"> <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> + <button id="g-close" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Close") ?></button> + <button id="g-save" class="ui-state-default ui-corner-all" onclick="download()"><?= t("Save") ?></button> </div> diff --git a/modules/gallery/views/admin_maintenance_task.html.php b/modules/gallery/views/admin_maintenance_task.html.php index ddd5bd17..76756b66 100644 --- a/modules/gallery/views/admin_maintenance_task.html.php +++ b/modules/gallery/views/admin_maintenance_task.html.php @@ -4,7 +4,7 @@ var animation = null; var delta = 1; animate_progress_bar = function() { - var current_value = parseInt($(".gProgressBar div").css("width").replace("%", "")); + var current_value = parseInt($(".g-progress-bar div").css("width").replace("%", "")); if (target_value > current_value) { // speed up delta = Math.min(delta + 0.04, 3); @@ -14,10 +14,10 @@ } if (target_value == 100) { - $(".gProgressBar").progressbar("value", 100); + $(".g-progress-bar").progressbar("value", 100); } else if (current_value != target_value || delta != 1) { var new_value = Math.min(current_value + delta, target_value); - $(".gProgressBar").progressbar("value", new_value); + $(".g-progress-bar").progressbar("value", new_value); animation = setTimeout(function() { animate_progress_bar(target_value); }, 100); } else { animation = null; @@ -35,30 +35,30 @@ if (!animation) { animate_progress_bar(); } - $("#gStatus").html("" + data.task.status); + $("#g-status").html("" + data.task.status); if (data.task.done) { - $("#gPauseButton").hide(); - $("#gDoneButton").show(); + $("#g-pause-button").hide(); + $("#g-done-button").show(); } else { setTimeout(update, 100); } } }); } - $(".gProgressBar").progressbar({value: 0}); + $(".g-progress-bar").progressbar({value: 0}); update(); dismiss = function() { window.location.reload(); } </script> -<div id="gProgress"> +<div id="g-progress"> <h1> <?= $task->name ?> </h1> - <div class="gProgressBar"></div> - <div id="gStatus"> + <div class="g-progress-bar"></div> + <div id="g-status"> <?= t("Starting up...") ?> </div> - <div class="txtright"> - <button id="gPauseButton" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Pause") ?></button> - <button id="gDoneButton" class="ui-state-default ui-corner-all" style="display: none" onclick="dismiss()"><?= t("Close") ?></button> + <div class="g-text-right"> + <button id="g-pause-button" class="ui-state-default ui-corner-all" onclick="dismiss()"><?= t("Pause") ?></button> + <button id="g-done-button" class="ui-state-default ui-corner-all" style="display: none" onclick="dismiss()"><?= t("Close") ?></button> </div> </div> diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 9cf03cb3..aebedf09 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -1,32 +1,32 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="gModules"> +<div class="g-block ui-helper-clearfix"> <h1> <?= t("Gallery Modules") ?> </h1> <p> <?= t("Power up your Gallery by adding more modules! Each module provides new cool features.") ?> </p> - <form method="post" action="<?= url::site("admin/modules/save") ?>"> - <?= access::csrf_form_field() ?> - <table> - <tr> - <th> <?= t("Installed") ?> </th> - <th> <?= t("Name") ?> </th> - <th> <?= t("Version") ?> </th> - <th> <?= t("Description") ?> </th> - </tr> - <? $i = 0 ?> - <? foreach ($available as $module_name => $module_info): ?> - <tr class="<?= ($i % 2 == 0) ? "gOddRow" : "gEvenRow" ?>"> - <? $data = array("name" => $module_name); ?> - <? if ($module_info->locked) $data["disabled"] = 1; ?> - <td> <?= form::checkbox($data, '1', module::is_active($module_name)) ?> </td> - <td> <?= t($module_info->name) ?> </td> - <td> <?= $module_info->version ?> </td> - <td> <?= t($module_info->description) ?> </td> - </tr> - <? $i++ ?> - <? endforeach ?> - </table> - <input type="submit" value="<?= t("Update")->for_html_attr() ?>"/> - </form> + <div class="g-block-content"> + <form method="post" action="<?= url::site("admin/modules/save") ?>"> + <?= access::csrf_form_field() ?> + <table> + <tr> + <th> <?= t("Installed") ?> </th> + <th> <?= t("Name") ?> </th> + <th> <?= t("Version") ?> </th> + <th> <?= t("Description") ?> </th> + </tr> + <? foreach ($available as $module_name => $module_info): ?> + <tr class="<?= text::alternate("g-odd", "g-even") ?>"> + <? $data = array("name" => $module_name); ?> + <? if ($module_info->locked) $data["disabled"] = 1; ?> + <td> <?= form::checkbox($data, '1', module::is_active($module_name)) ?> </td> + <td> <?= t($module_info->name) ?> </td> + <td> <?= $module_info->version ?> </td> + <td> <?= t($module_info->description) ?> </td> + </tr> + <? endforeach ?> + </table> + <input type="submit" value="<?= t("Update")->for_html_attr() ?>" /> + </form> + </div> </div> diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php new file mode 100644 index 00000000..b394aa19 --- /dev/null +++ b/modules/gallery/views/admin_sidebar.html.php @@ -0,0 +1,64 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<script type="text/javascript"> + $(document).ready(function(){ + $(".g-admin-blocks-list").equal_heights(); + var extra_ht = $(".g-admin-blocks-list li").length * $(".g-admin-blocks-list li:first").height(); + $(".g-admin-blocks-list").height($(".g-admin-blocks-list").height() + extra_ht); + }); + + $(function() { + $(".g-admin-blocks-list ul").sortable({ + connectWith: ".g-sortable-blocks", + opacity: .7, + placeholder: "g-target", + update: function(event,ui) { + if ($(this).attr("id") == "g-active-blocks") { + var active_blocks = ""; + $("ul#g-active-blocks li").each(function(i) { + active_blocks += "&block["+i+"]="+$(this).attr("ref"); + }); + $.getJSON($("#g-site-blocks").attr("ref").replace("__ACTIVE__", active_blocks), function(data) { + if (data.result == "success") { + $("ul#g-available-blocks").html(data.available); + $("ul#g-active-blocks").html(data.active); + $("#g-action-status").remove(); + var message = "<ul id=\"g-action-status\" class=\"g-message-block\">"; + message += "<li class=\"g-success\">" + data.message + "</li>"; + message += "</ul>"; + $("#g-block-admin").before(message); + $("#g-action-status li").gallery_show_message(); + } + }); + } + } + }).disableSelection(); + }); +</script> + +<div id="g-block-admin" class="g-block ui-helper-clearfix"> + <h1> <?= t("Manage sidebar") ?> </h1> + <p> + <?= t("Select and drag blocks from the available column to the active column to add to the sidebar; remove by dragging the other way.") ?> + </p> + + <div class="g-block-content"> + <div id="g-site-blocks" ref="<?= url::site("admin/sidebar/update?csrf={$csrf}__ACTIVE__") ?>"> + <div class="g-admin-blocks-list"> + <div><h3><?= t("Available blocks") ?></h3></div> + <div> + <ul id="g-available-blocks" class="g-sortable-blocks"> + <?= $available ?> + </ul> + </div> + </div> + <div class="g-admin-blocks-list"> + <div><h3><?= t("Active blocks") ?></h3></div> + <div> + <ul id="g-active-blocks" class="g-sortable-blocks"> + <?= $active ?> + </ul> + </div> + </div> + </div> + </div> +</div> diff --git a/modules/gallery/views/admin_sidebar_blocks.html.php b/modules/gallery/views/admin_sidebar_blocks.html.php new file mode 100644 index 00000000..48aa3f05 --- /dev/null +++ b/modules/gallery/views/admin_sidebar_blocks.html.php @@ -0,0 +1,5 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> + +<? foreach ($blocks as $ref => $text): ?> +<li class="g-draggable" ref="<?= $ref ?>"><?= $text ?></li> +<? endforeach ?> diff --git a/modules/gallery/views/admin_theme_options.html.php b/modules/gallery/views/admin_theme_options.html.php index 724e6438..a4bf1c4e 100644 --- a/modules/gallery/views/admin_theme_options.html.php +++ b/modules/gallery/views/admin_theme_options.html.php @@ -1,6 +1,8 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="gAdminThemeOptions"> +<div class="g-block"> <h1> <?= t("Theme Options") ?> </h1> + <div class="g-block-content"> <?= $form ?> + </div> </div> diff --git a/modules/gallery/views/admin_themes.html.php b/modules/gallery/views/admin_themes.html.php index 0aac4717..d14e8bd4 100644 --- a/modules/gallery/views/admin_themes.html.php +++ b/modules/gallery/views/admin_themes.html.php @@ -7,83 +7,88 @@ } </script> -<h1> <?= t("Theme Choice") ?> </h1> -<p> - <?= t("Gallery allows you to choose a theme for browsing your Gallery, as well as a special theme for the administration interface. Click a theme to preview and activate it.") ?> -</p> +<div class="g-block ui-helper-clearfix"> + <h1> <?= t("Theme choice") ?> </h1> + <p> + <?= t("Gallery allows you to choose a theme for browsing your Gallery, as well as a special theme for the administration interface. Click a theme to preview and activate it.") ?> + </p> -<div id="gSiteTheme"> - <h2> <?= t("Gallery theme") ?> </h2> - <div class="gBlock gSelected"> - <img src="<?= url::file("themes/{$site}/thumbnail.png") ?>" - alt="<?= html::clean_attribute($themes[$site]->name) ?>" /> - <h3> <?= $themes[$site]->name ?> </h3> - <p> - <?= $themes[$site]->description ?> - </p> - </div> + <div class="g-block-content"> + <div id="g-site-theme"> + <h2> <?= t("Gallery theme") ?> </h2> + <div class="g-block g-selected ui-helper-clearfix"> + <img src="<?= url::file("themes/{$site}/thumbnail.png") ?>" + alt="<?= html::clean_attribute($themes[$site]->name) ?>" /> + <h3> <?= $themes[$site]->name ?> </h3> + <p> + <?= $themes[$site]->description ?> + </p> + </div> + + <h2> <?= t("Available Gallery themes") ?> </h2> + <div class="g-available"> + <? $count = 0 ?> + <? foreach ($themes as $id => $info): ?> + <? if (!$info->site) continue ?> + <? if ($id == $site) continue ?> + <div class="g-block ui-helper-clearfix"> + <a href="<?= url::site("admin/themes/preview/site/$id") ?>" class="g-dialog-link" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>"> + <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>" + alt="<?= html::clean_attribute($info->name) ?>" /> + <h3> <?= $info->name ?> </h3> + <p> + <?= $info->description ?> + </p> + </a> + </div> + <? $count++ ?> + <? endforeach ?> - <h2> <?= t("Available Gallery themes") ?> </h2> - <div class="gAvailable"> - <? $count = 0 ?> - <? foreach ($themes as $id => $info): ?> - <? if (!$info->site) continue ?> - <? if ($id == $site) continue ?> - <div class="gBlock"> - <a href="<?= url::site("admin/themes/preview/site/$id") ?>" class="gDialogLink" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>"> - <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>" - alt="<?= html::clean_attribute($info->name) ?>" /> - <h3> <?= $info->name ?> </h3> + <? if (!$count): ?> <p> - <?= $info->description ?> + <?= t("There are no other site themes available.") ?> </p> - </a> + <? endif ?> + </div> </div> - <? $count++ ?> - <? endforeach ?> - <? if (!$count): ?> - <p> - <?= t("There are no other site themes available.") ?> - </p> - <? endif ?> - </div> -</div> + <div id="g-admin-theme"> + <h2> <?= t("Admin theme") ?> </h2> + <div class="g-block g-selected ui-helper-clearfix"> + <img src="<?= url::file("themes/{$admin}/thumbnail.png") ?>" + alt="<?= html::clean_attribute($themes[$admin]->name) ?>" /> + <h3> <?= $themes[$admin]->name ?> </h3> + <p> + <?= $themes[$admin]->description ?> + </p> + </div> -<div id="gAdminTheme"> - <h2> <?= t("Admin theme") ?> </h2> - <div class="gBlock gSelected"> - <img src="<?= url::file("themes/{$admin}/thumbnail.png") ?>" - alt="<?= html::clean_attribute($themes[$admin]->name) ?>" /> - <h3> <?= $themes[$admin]->name ?> </h3> - <p> - <?= $themes[$admin]->description ?> - </p> - </div> + <h2> <?= t("Available admin themes") ?> </h2> + <div class="g-available"> + <? $count = 0 ?> + <? foreach ($themes as $id => $info): ?> + <? if (!$info->admin) continue ?> + <? if ($id == $admin) continue ?> + <div class="g-block ui-helper-clearfix"> + <a href="<?= url::site("admin/themes/preview/admin/$id") ?>" class="g-dialog-link" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>"> + <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>" + alt="<?= html::clean_attribute($info->name) ?>" /> + <h3> <?= $info->name ?> </h3> + <p> + <?= $info->description ?> + </p> + </a> + </div> + <? $count++ ?> + <? endforeach ?> - <h2> <?= t("Available admin themes") ?> </h2> - <div class="gAvailable"> - <? $count = 0 ?> - <? foreach ($themes as $id => $info): ?> - <? if (!$info->admin) continue ?> - <? if ($id == $admin) continue ?> - <div class="gBlock"> - <a href="<?= url::site("admin/themes/preview/admin/$id") ?>" class="gDialogLink" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>"> - <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>" - alt="<?= html::clean_attribute($info->name) ?>" /> - <h3> <?= $info->name ?> </h3> + <? if (!$count): ?> <p> - <?= $info->description ?> + <?= t("There are no other admin themes available.") ?> </p> - </a> + <? endif ?> + </div> </div> - <? $count++ ?> - <? endforeach ?> - <? if (!$count): ?> - <p> - <?= t("There are no other admin themes available.") ?> - </p> - <? endif ?> </div> </div>
\ No newline at end of file diff --git a/modules/gallery/views/form.html.php b/modules/gallery/views/form.html.php index 730d77cb..abc32164 100644 --- a/modules/gallery/views/form.html.php +++ b/modules/gallery/views/form.html.php @@ -44,7 +44,7 @@ if (!function_exists("DrawForm")) { print $input->render(); } else { if ($input->error_messages()) { - print "$prefix<li class=\"gError\">\n"; + print "$prefix<li class=\"g-error\">\n"; } else { print "$prefix<li>\n"; } @@ -58,7 +58,7 @@ if (!function_exists("DrawForm")) { } if ($input->error_messages()) { foreach ($input->error_messages() as $error_message) { - print "$prefix <p class=\"gError\">\n"; + print "$prefix <p class=\"g-message g-error\">\n"; print "$prefix $error_message\n"; print "$prefix </p>\n"; } diff --git a/modules/gallery/views/in_place_edit.html.php b/modules/gallery/views/in_place_edit.html.php new file mode 100644 index 00000000..03cbdc69 --- /dev/null +++ b/modules/gallery/views/in_place_edit.html.php @@ -0,0 +1,16 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<?= form::open($action, array("method" => "post", "id" => "g-in-place-edit-form", "class" => "g-short-form"), $hidden) ?> + <ul> + <li <? if (!empty($errors["input"])): ?> class="g-error"<? endif ?>> + <?= form::input("input", $form["input"], " class='textbox'") ?> + </li> + <li> + <?= form::submit(array("class" => "submit ui-state-default"), t("Save")) ?> + </li> + <li><a href="#" class="g-cancel"><?= t("Cancel") ?></a></li> + </ul> +<?= form::close() ?> +<? if (!empty($errors["input"])): ?> +<div id="g-in-place-edit-message" class="g-error"><?= $errors["input"] ?></div> +<? endif ?> + diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php index 9361514d..0d8801e5 100644 --- a/modules/gallery/views/kohana_error_page.php +++ b/modules/gallery/views/kohana_error_page.php @@ -57,7 +57,7 @@ <title><?= t("Something went wrong!") ?></title> </head> <body> - <? try { $user = user::active(); } catch (Exception $e) { } ?> + <? try { $user = identity::active_user(); } catch (Exception $e) { } ?> <? $admin = php_sapi_name() == "cli" || isset($user) && $user->admin ?> <div class="big_box" id="framework_error"> <h1> @@ -117,6 +117,11 @@ <? endif ?> </div> </div> + <? else: ?> + <? $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTraceAsString(); ?> + <? if (!empty($trace)): ?> + <? Kohana::Log("error", print_r($trace, 1)); ?> + <? endif ?> <? endif ?> </body> </html> diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php index b0f424be..9d14bbb2 100644 --- a/modules/gallery/views/l10n_client.html.php +++ b/modules/gallery/views/l10n_client.html.php @@ -2,13 +2,13 @@ <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")->for_html_attr() ?>" + <a id="g-minimize-l10n">_</a> + <a id="g-close-l10n" 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") ?> + <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> + <a style="background-color:#fff" href="<?= url::site("admin/languages?show_all_l10n_messages=1") ?>"><?= t("(Show all)") ?></a> <? endif; ?> </h2></div> <div class="label source"><h2><?= t("Source") ?></div> @@ -37,7 +37,7 @@ <p id="source-text-tmp-space" style="display:none"></p> </div> <div class="translation"> - <form method="post" action="<?= url::site("l10n_client/save") ?>" id="gL10nClientSaveForm"> + <form method="post" action="<?= url::site("l10n_client/save") ?>" id="g-l10n-client-save-form"> <?= access::csrf_form_field() ?> <?= form::hidden("l10n-message-key") ?> <?= form::textarea("l10n-edit-translation", "", ' rows="5" class="translationField"') ?> @@ -68,12 +68,12 @@ </div> <input type="submit" name="l10n-edit-save" value="<?= t("Save translation")->for_html_attr() ?>"/> <a href="javascript: Gallery.l10nClient.copySourceText()" - class="gButtonLink ui-state-default ui-corner-all"><?= t("Copy source text") ?></a> + class="g-button ui-state-default ui-corner-all"><?= t("Copy source text") ?></a> </form> </div> </div> <script type="text/javascript"> - var MSG_TRANSLATE_TEXT = <?= t("Translate Text")->for_js() ?>; + var MSG_TRANSLATE_TEXT = <?= t("Translate text")->for_js() ?>; var l10n_client_data = <?= json_encode($string_list) ?>; var plural_forms = <?= json_encode($plural_forms) ?>; var toggle_l10n_mode_url = <?= html::js_string(url::site("l10n_client/toggle_l10n_mode")) ?>; diff --git a/modules/gallery/views/login_ajax.html.php b/modules/gallery/views/login_ajax.html.php new file mode 100644 index 00000000..36647f9d --- /dev/null +++ b/modules/gallery/views/login_ajax.html.php @@ -0,0 +1,45 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<script type="text/javascript"> + $("#g-login-form").ready(function() { + $("#g-password-reset").click(function() { + $.ajax({ + url: "<?= url::site("password/reset") ?>", + success: function(data) { + $("#g-login").html(data); + $("#ui-dialog-title-g-dialog").html(<?= t("Reset password")->for_js() ?>); + $(".submit").addClass("g-button ui-state-default ui-corner-all"); + $(".submit").gallery_hover_init(); + ajaxify_login_reset_form(); + } + }); + }); + }); + + function ajaxify_login_reset_form() { + $("#g-login form").ajaxForm({ + dataType: "json", + success: function(data) { + if (data.form) { + $("#g-login form").replaceWith(data.form); + ajaxify_login_reset_form(); + } + if (data.result == "success") { + $("#g-dialog").dialog("close"); + window.location.reload(); + } + } + }); + }; +</script> +<div id="g-login"> + <ul> + <li id="g-login-form"> + <?= $form ?> + </li> + <? if (identity::is_writable()): ?> + <li> + <a href="#" id="g-password-reset" class="g-right g-text-small"><?= t("Forgot your password?") ?></a> + </li> + <? endif ?> + </ul> +</div> diff --git a/modules/gallery/views/login_current_user.html.php b/modules/gallery/views/login_current_user.html.php new file mode 100644 index 00000000..e3b3688f --- /dev/null +++ b/modules/gallery/views/login_current_user.html.php @@ -0,0 +1,11 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<li> + <? $name = $menu->label->for_html() ?> + <? if (identity::is_writable()): ?> + <?= t("Logged in as %name", array("name" => html::mark_clean( + "<a href='$menu->url' title='" . t("Edit your profile")->for_html_attr() . + "' id='$menu->id' class='g-dialog-link'>{$name}</a>"))) ?> + <? else: ?> + <?= t("Logged in as %name", array("name" => $name)) ?> + <? endif ?> +</li> diff --git a/modules/gallery/views/maintenance.html.php b/modules/gallery/views/maintenance.html.php index f80b6e7a..6351b6ab 100644 --- a/modules/gallery/views/maintenance.html.php +++ b/modules/gallery/views/maintenance.html.php @@ -2,7 +2,7 @@ <html> <head> <title> - <?= t("Gallery - Maintenance Mode") ?> + <?= t("Gallery - maintenance mode") ?> </title> <style> body { @@ -38,12 +38,12 @@ </head> <body> <h1> - <?= t("Gallery - Maintenance Mode") ?> + <?= t("Gallery - maintenance mode") ?> </h1> <p> <?= t("This site is currently only accessible by site administrators.") ?> </p> - <?= user::get_login_form("login/auth_html") ?> + <?= auth::get_login_form("login/auth_html") ?> </body> </html> diff --git a/modules/gallery/views/menu.html.php b/modules/gallery/views/menu.html.php new file mode 100644 index 00000000..cb49bcdf --- /dev/null +++ b/modules/gallery/views/menu.html.php @@ -0,0 +1,24 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<? if ($menu->elements): // Don't show the menu if it has no choices ?> +<? if ($menu->is_root): ?> +<ul <?= isset($menu->css_id) ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>"> + <? foreach ($menu->elements as $element): ?> + <?= $element->render() ?> + <? endforeach ?> +</ul> + +<? else: ?> + +<li title="<?= $menu->label->for_html_attr() ?>"> + <a href="#"> + <?= $menu->label->for_html() ?> + </a> + <ul> + <? foreach ($menu->elements as $element): ?> + <?= $element->render() ?> + <? endforeach ?> + </ul> +</li> + +<? endif ?> +<? endif ?> diff --git a/modules/gallery/views/menu_ajax_link.html.php b/modules/gallery/views/menu_ajax_link.html.php new file mode 100644 index 00000000..00a394bc --- /dev/null +++ b/modules/gallery/views/menu_ajax_link.html.php @@ -0,0 +1,10 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<li> + <a id="<?= $menu->css_id ?>" + class="g-ajax-link <?= $menu->css_class ?>" + href="<?= $menu->url ?>" + title="<?= $menu->label->for_html_attr() ?>" + ajax_handler="<?= $menu->ajax_handler ?>"> + <?= $menu->label->for_html() ?> + </a> +</li> diff --git a/modules/gallery/views/menu_dialog.html.php b/modules/gallery/views/menu_dialog.html.php new file mode 100644 index 00000000..99b1b013 --- /dev/null +++ b/modules/gallery/views/menu_dialog.html.php @@ -0,0 +1,9 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<li> + <a id="<?= $menu->css_id ?>" + class="g-dialog-link <?= $menu->css_class ?>" + href="<?= $menu->url ?>" + title="<?= $menu->label->for_html_attr() ?>"> + <?= $menu->label->for_html() ?> + </a> +</li> diff --git a/modules/gallery/views/menu_link.html.php b/modules/gallery/views/menu_link.html.php new file mode 100644 index 00000000..8e4cdb95 --- /dev/null +++ b/modules/gallery/views/menu_link.html.php @@ -0,0 +1,9 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<li> + <a id="<?= $menu->css_id ?>" + class="g-menu-link <?= $menu->css_class ?>" + href="<?= $menu->url ?>" + title="<?= $menu->label->for_html_attr() ?>"> + <?= $menu->label->for_html() ?> + </a> +</li> diff --git a/modules/gallery/views/move_browse.html.php b/modules/gallery/views/move_browse.html.php index 99728ecc..ce3fc2fd 100644 --- a/modules/gallery/views/move_browse.html.php +++ b/modules/gallery/views/move_browse.html.php @@ -3,14 +3,14 @@ var load_tree = function(target_id, locked) { var load_url = "<?= url::site("move/show_sub_tree/{$source->id}/__TARGETID__") ?>"; var node = $("#node_" + target_id); - $("#gMove .node a").removeClass("selected"); + $("#g-move .node a").removeClass("selected"); node.find("a:first").addClass("selected"); if (locked) { - $("#gMoveButton").attr("disabled", "disabled"); - $("#gMove form input[name=target_id]").attr("value", ""); + $("#g-move-button").attr("disabled", "disabled"); + $("#g-move form input[name=target_id]").attr("value", ""); } else { - $("#gMoveButton").removeAttr("disabled"); - $("#gMove form input[name=target_id]").attr("value", target_id); + $("#g-move-button").removeAttr("disabled"); + $("#g-move form input[name=target_id]").attr("value", target_id); } var sub_tree = $("#tree_" + target_id); if (sub_tree.length) { @@ -33,7 +33,7 @@ <? t("Move this album to a new album") ?> <? endif ?> </h1> -<div id="gMove"> +<div id="g-move"> <ul id="tree_0"> <li id="node_1" class="node"> <?= $tree ?> @@ -42,6 +42,6 @@ <form method="post" action="<?= url::site("move/save/$source->id") ?>"> <?= access::csrf_form_field() ?> <input type="hidden" name="target_id" value="" /> - <input type="submit" id="gMoveButton" value="<?= t("Move")->for_html_attr() ?>" disabled="disabled"/> + <input type="submit" id="g-move-button" value="<?= t("Move")->for_html_attr() ?>" disabled="disabled"/> </form> </div> diff --git a/modules/gallery/views/movieplayer.html.php b/modules/gallery/views/movieplayer.html.php index e9783eb8..f7af8d93 100644 --- a/modules/gallery/views/movieplayer.html.php +++ b/modules/gallery/views/movieplayer.html.php @@ -1,6 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <?= html::anchor($item->file_url(true), "", $attrs) ?> -<script> +<script type="text/javascript"> flowplayer( "<?= $attrs["id"] ?>", { diff --git a/modules/gallery/views/permissions_browse.html.php b/modules/gallery/views/permissions_browse.html.php index 519734d6..0b27336e 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"); + $("#g-edit-permissions-form").html(data); + $(".g-active").removeClass("g-active"); + $("#item-" + id).addClass("g-active"); } }); } @@ -19,15 +19,15 @@ url: action_url.replace("__CMD__", cmd).replace("__GROUP__", group_id). replace("__PERM__", perm_id).replace("__ITEM__", item_id), success: function(data) { - $("#gEditPermissionForm").load(form_url.replace("__ITEM__", item_id)); + $("#g-edit-permissions-form").load(form_url.replace("__ITEM__", item_id)); } }); } </script> -<div id="gPermissions"> +<div id="g-permissions"> <? if (!$htaccess_works): ?> - <ul id="gMessage"> - <li class="gError"> + <ul id="g-action-status" class="g-message-block"> + <li class="g-error"> <?= 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_clean('href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank"'), "apache_attrs" => html::mark_clean('href="http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride" target="_blank"'))) ?> @@ -37,26 +37,26 @@ <p><?= t("Edit permissions for album:") ?></p> - <ul class="gBreadcrumbs"> + <ul class="g-breadcrumbs"> + <? $i = 0 ?> <? foreach ($parents as $parent): ?> - <li id="item-<?= $parent->id ?>"> + <li id="item-<?= $parent->id ?>"<? if ($i == 0) print " class=\"g-first\"" ?>> <? if (access::can("edit", $parent)): ?> - <a href="javascript:show(<?= $parent->id ?>)"> - <?= html::purify($parent->title) ?> - </a> + <a href="javascript:show(<?= $parent->id ?>)"> <?= html::purify($parent->title) ?> </a> <? else: ?> <?= html::purify($parent->title) ?> <? endif ?> </li> + <? $i++ ?> <? endforeach ?> - <li class="active" id="item-<?= $item->id ?>"> + <li class="g-active" id="item-<?= $item->id ?>"> <a href="javascript:show(<?= $item->id ?>)"> <?= html::purify($item->title) ?> </a> </li> </ul> - <div id="gEditPermissionForm"> + <div id="g-edit-permissions-form"> <?= $form ?> </div> </div> diff --git a/modules/gallery/views/permissions_form.html.php b/modules/gallery/views/permissions_form.html.php index a0bb35f2..f1714119 100644 --- a/modules/gallery/views/permissions_form.html.php +++ b/modules/gallery/views/permissions_form.html.php @@ -1,7 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <fieldset> <legend> <?= t('Edit Permissions') ?> </legend> - <table> <tr> <th> </th> @@ -12,73 +11,75 @@ <? foreach ($permissions as $permission): ?> <tr> - <td> <?= t($permission->display_name) ?> </td> + <td> <?= t($permission->display_name) ?> + </td> <? foreach ($groups as $group): ?> <? $intent = access::group_intent($group, $permission->name, $item) ?> <? $allowed = access::group_can($group, $permission->name, $item) ?> <? $lock = access::locked_by($group, $permission->name, $item) ?> <? if ($lock): ?> - <td class="gDenied"> - <img src="<?= url::file('themes/default/images/ico-denied.png') ?>" title="<?= t('denied and locked through parent album')->for_html_attr() ?>" alt="<?= t('denied icon')->for_html_attr() ?>" /> + <td class="g-denied"> + <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>" + title="<?= t('denied and locked through parent album')->for_html_attr() ?>" + alt="<?= t('denied icon')->for_html_attr() ?>" /> <a href="javascript:show(<?= $lock->id ?>)" title="<?= t('click to go to parent album')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-lock.png') ?>" alt="<?= t('locked icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-lock.png")) ?>" alt="<?= t('locked icon')->for_html_attr() ?>" /> </a> </td> <? else: ?> <? if ($intent === access::INHERIT): ?> <? if ($allowed): ?> - <td class="gAllowed"> - <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" - title="<?= t('allowed through parent album, click to allow explicitly')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-success-pale.png') ?>" alt="<?= t('passive allowed icon')->for_html_attr() ?>" /> + <td class="g-allowed"> + <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('allowed through parent album, click to allow explicitly')->for_html_attr() ?>"> + <img src="<?= url::file(gallery::find_file("images", "ico-success-passive.png")) ?>" alt="<?= t('passive allowed icon')->for_html_attr() ?>" /> </a> <a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('click to deny')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-denied-gray.png') ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-denied-inactive.png")) ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" /> </a> </td> <? else: ?> - <td class="gDenied"> + <td class="g-denied"> <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('click to allow')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-success-gray.png') ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success-inactive.png")) ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" /> </a> <a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('denied through parent album, click to deny explicitly')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-denied-pale.png') ?>" alt="<?= t('passive denied icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-denied-passive.png")) ?>" alt="<?= t('passive denied icon')->for_html_attr() ?>" /> </a> </td> <? endif ?> <? elseif ($intent === access::DENY): ?> - <td class="gDenied"> + <td class="g-denied"> <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('click to allow')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-success-gray.png') ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success-inactive.png")) ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" /> </a> <? if ($item->id == 1): ?> - <img src="<?= url::file('themes/default/images/ico-denied.png') ?>" alt="<?= t('denied icon')->for_html_attr() ?>" title="<?= t('denied')->for_html_attr() ?>"/> + <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>" alt="<?= t('denied icon')->for_html_attr() ?>" title="<?= t('denied')->for_html_attr() ?>"/> <? else: ?> <a href="javascript:set('reset',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('denied, click to reset')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-denied.png') ?>" alt="<?= t('denied icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>" alt="<?= t('denied icon')->for_html_attr() ?>" /> </a> <? endif ?> </td> <? elseif ($intent === access::ALLOW): ?> - <td class="gAllowed"> + <td class="g-allowed"> <? if ($item->id == 1): ?> - <img src="<?= url::file('themes/default/images/ico-success.png') ?>" title="<?= t("allowed")->for_html_attr() ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success.png")) ?>" title="<?= t("allowed")->for_html_attr() ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" /> <? else: ?> <a href="javascript:set('reset',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('allowed, click to reset')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-success.png') ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success.png")) ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" /> </a> <? endif ?> <a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('click to deny')->for_html_attr() ?>"> - <img src="<?= url::file('themes/default/images/ico-denied-gray.png') ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-denied-inactive.png")) ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" /> </a> </td> <? endif ?> diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index 7f8a96df..10e748b6 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -1,274 +1,134 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<script type="text/javascript" src="<?= url::file("lib/swfupload/swfupload.js") ?>"></script> -<script type="text/javascript" src="<?= url::file("lib/swfupload/swfupload.queue.js") ?>"></script> -<script type="text/javascript" src="<?= url::file("lib/jquery.scrollTo.js") ?>"></script> - -<!-- 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" => html::purify($item->title))) ?> </legend> - </fieldset> -</form> - -<div id="gAddPhotos"> - <? if (ini_get("suhosin.session.encrypt")): ?> - <ul id="gMessage"> - <li class="gError"> - <?= t("Error: your server is configured to use the <a href=\"%encrypt_url\"><code>suhosin.session.encrypt</code></a> setting from <a href=\"%suhosin_url\">Suhosin</a>. You must disable this setting to upload photos.", - array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt", - "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?> - </li> - </ul> - <? endif ?> - - <p> - <?= t("Photos will be uploaded to album: ") ?> - </p> - <ul class="gBreadcrumbs"> - <? foreach ($item->parents() as $parent): ?> - <li> <?= html::clean($parent->title) ?> </li> - <? endforeach ?> - <li class="active"> <?= html::purify($item->title) ?> </li> - </ul> - - <p> - <span id="gUploadQueueInfo"> - <?= t("Upload Queue") ?> - </span> - <a id="gUploadCancel" title="<?= t("Cancel all the pending uploads")->for_html_attr() ?>" onclick="swfu.cancelQueue();"><?= t("cancel") ?></a> - </p> - <div id="gAddPhotosCanvas" style="text-align: center;"> - <div id="gAddPhotosQueue"></div> - <div id="gEditPhotosQueue"></div> - <span id="gChooseFilesButtonPlaceholder"></span> - </div> - <!-- - <button id="gUploadCancel" class="ui-state-default ui-corner-all" type="button" - onclick="swfu.cancelQueue();" - disabled="disabled"> - <?= t("Cancel all") ?> - </button> - --> - - <!-- Proxy the done request back to our form, since its been ajaxified --> - <button class="ui-state-default ui-corner-all" onclick="$('#gAddPhotosForm').submit()"> - <?= t("Close") ?> - </button> -</div> - -<style> - #SWFUpload_0 { - margin-top: 100px; - } - #gAddPhotos .gBreadcrumbs { - border: 0; - margin: 0; - padding-left:10px; - } - #gAddPhotosCanvas { - border: 1px solid #CCCCCC; - margin: .5em 0 .5em 0; - width: 469px; - } - #gAddPhotos button { - margin-bottom: .5em; - float: right; - } - #gAddPhotos #gUploadCancel { - display: none; - cursor: pointer; - } -</style> - +<script type="text/javascript" src="<?= url::file("lib/swfobject.js") ?>"></script> +<script type="text/javascript" src="<?= url::file("lib/uploadify/jquery.uploadify.min.js") ?>"></script> <script type="text/javascript"> - var swfu = new SWFUpload({ - 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")->for_js() ?>, - file_upload_limit: 1000, - file_queue_limit: 0, - custom_settings: { }, - debug: false, - - // Button settings - 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: <?= 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, - - // The event handler functions are defined in handlers.js - file_queued_handler: file_queued, - file_queue_error_handler: file_queue_error, - file_dialog_complete_handler: file_dialog_complete, - upload_start_handler: upload_start, - upload_progress_handler: upload_progress, - upload_error_handler: upload_error, - upload_success_handler: upload_success, - upload_complete_handler: upload_complete, - queue_complete_handler: queue_complete - }); - - // @todo add support for cancelling individual uploads - function File_Progress(file) { - this.box = $("#" + file.id); - if (!this.box.length) { - $("#gAddPhotosQueue").append( - "<div class=\"box\" id=\"" + file.id + "\">" + - "<div class=\"title\"></div>" + - "<div class=\"status\"></div>" + - "<div class=\"progressbar\"></div>" + - "</div>"); - this.box = $("#" + file.id); - } - this.title = this.box.find(".title"); - this.status = this.box.find(".status"); - this.progress_bar = this.box.find(".progressbar"); - this.progress_bar.progressbar(); - this.progress_bar.css("visibility", "hidden"); - } + $("#g-add-photos-canvas").ready(function () { + $("#g-uploadify").uploadify({ + uploader: "<?= url::file("lib/uploadify/uploadify.swf") ?>", + script: "<?= url::site("simple_uploader/add_photo/{$item->id}") ?>", + scriptData: <?= json_encode(array( + "g3sid" => Session::instance()->id(), + "user_agent" => Input::instance()->server("HTTP_USER_AGENT"), + "csrf" => $csrf)) ?>, + fileExt: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4", + fileDesc: <?= t("Photos and movies")->for_js() ?>, + cancelImg: "<?= url::file("lib/uploadify/cancel.png") ?>", + buttonText: <?= t("Select Photos ...")->for_js() ?>, + simUploadLimit: 10, + //wmode: "transparent", + hideButton: false, /* should be true */ + auto: true, + multi: true, + onAllComplete: function(filesUploaded, errors, allbytesLoaded, speed) { + $("#g-upload-cancel-all") + .addClass("ui-state-disabled") + .attr("disabled", "disabled"); + return true; + }, + onClearQueue: function(event) { + $("#g-upload-cancel-all") + .addClass("ui-state-disabled") + .attr("disabled", "disabled"); + return true; + }, + onComplete: function(event, queueID, fileObj, response, data) { + // @todo handle a response of "Error: xxxx" as an error + var re = /^error: (.*)$/i; + var msg = re.exec(response); + if (msg) { + $("#g-add-photos-status ul").append( + "<li class=\"g-error\">" + fileObj.name + " - " + msg[1] + "</li>"); + } else { + $("#g-add-photos-status ul").append( + "<li class=\"g-success\">" + fileObj.name + " - <?= t("Completed") ?></li>"); + } + return true; + }, - File_Progress.prototype.set_status = function(status_class, msg) { - this.box.removeClass("pending error uploading complete").addClass(status_class); - this.status.html(msg); - } - - function file_queued(file) { - var fp = new File_Progress(file); - fp.title.html(file.name); - 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.")->for_js() ?>); - return; - } - - var fp = new File_Progress(file); - 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")))->for_js() ?>); - break; - case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: - fp.title.html(file.name); - 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.")->for_js() ?>); - break; - default: - if (file !== null) { - fp.title.html(file.name); - fp.set_status("error", <?= t("Unknown error")->for_js() ?>); + onError: function(event, queueID, fileObj, errorObj) { + var msg = " - "; + if (errorObj.type == "HTTP") { + if (errorObj.info == "500") { + msg += "Error occurred processing the file"; + // Server error - check server logs + } else if (errorObj.info == "404") { + msg += "The upload script was not found."; + // Server script not found + } else { + // Server Error: status: errorObj.info + msg += "Error occurred communication with the server, status: " + errorObj.info; + } + } else if (errorObj.type == "File Size") { + var sizelimit = $("#g-uploadify").uploadifySettings(sizeLimit); + msg += fileObj.name+' '+errorObj.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB'; + } else { + msg += "Error occurred communication with the server, error " + errorObj.type + ": " + errorObj.info; + } + $("#g-add-photos-status ul").append( + "<li class=\"g-error\">" + fileObj.name + msg + "</li>"); + $("#g-uploadify" + queueID).remove(); + //return false; + }, + onSelect: function(event) { + if ($("#g-upload-cancel-all").hasClass("ui-state-disabled")) { + $("#g-upload-cancel-all") + .removeClass("ui-state-disabled") + .attr("disabled", null); + } + return true; } - break; - } - } - - function file_dialog_complete(num_files_selected, num_files_queued) { - if (num_files_selected > 0) { - $("#gUploadCancel").show(); - $("#gUploadQueueInfo").text(get_completed_status_msg(this.getStats())); - } + }); - // Auto start the upload - this.startUpload(); - } - - function upload_start(file) { - // Do all file validation on the server side. Update the UI here because in Linux - // 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...")->for_js() ?>); - $("#gAddPhotosCanvas").scrollTo(fp.box, 1000); - return true; - // @todo add cancel button to call this.cancelUpload(file.id) - } - - 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...")->for_js() ?>); - fp.progress_bar.css("visibility", "visible"); - fp.progress_bar.progressbar("value", percent); - } + // @todo figure out how to actually get the offset or why it comes back 0 0 + var offset = $("#g-add-photos-button").offset(); + //$("#g-uploadifyUploader").css({top: "97px", position: "absolute", left: "198px"}); + //$("#g-add-photos-button").height("40px").width("120px"); + }); +</script> - function upload_success(file, serverData) { - var fp = new File_Progress(file); - fp.progress_bar.progressbar("value", 100); - fp.set_status("complete", <?= t("Complete.")->for_js() ?>); - } +<form id="g-add-photos-form" action="<?= url::site("simple_uploader/finish?csrf=$csrf") ?>"> + <fieldset> + <legend> <?= t("Add photos to %album_title", array("album_title" => html::purify($item->title))) ?> </legend> - 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")->for_js() ?>); - break; - case SWFUpload.UPLOAD_ERROR.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")->for_js() ?>); - break; - case SWFUpload.UPLOAD_ERROR.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")->for_js() ?>); - break; - case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED: - 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")->for_js() ?>); - break; - case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED: - fp.set_status("error", <?= t("Stopped")->for_js() ?>); - break; - default: - fp.set_status("error", <?= t("Unknown error: ")->for_js() ?> + error_code); - break; - } - } + </fieldset> + <div id="g-add-photos"> + <? if (ini_get("suhosin.session.encrypt")): ?> + <ul id="g-action-status" class="g-message-block"> + <li class="g-error"> + <?= t("Error: your server is configured to use the <a href=\"%encrypt_url\"><code>suhosin.session.encrypt</code></a> setting from <a href=\"%suhosin_url\">Suhosin</a>. You must disable this setting to upload photos.", + array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt", + "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?> + </li> + </ul> + <? endif ?> - function upload_complete(file) { - var stats = this.getStats(); - $("#gUploadQueueInfo").text(get_completed_status_msg(stats)); - if (stats.files_queued === 0) { - $("#gUploadCancel").hide(); - } - } + <div> + <p> + <?= t("Photos will be uploaded to album: ") ?> + </p> + <ul class="g-breadcrumbs"> + <? foreach ($item->parents() as $i => $parent): ?> + <li<? if ($i == 0) print " class=\"g-first\"" ?>> <?= html::clean($parent->title) ?> </li> + <? endforeach ?> + <li class="g-active"> <?= html::purify($item->title) ?> </li> + </ul> + </div> - function get_completed_status_msg(stats) { - 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); - return msg; - } + <div id="g-add-photos-canvas" style="text-align: center;"> + <!-- a id="g-add-photos-button" class="ui-corner-all" style="padding-bottom: 1em;" href="#"><?= t("Select Photos...") ?></a --> + <span id="g-uploadify"></span> + </div> + <div id="g-add-photos-status" style="text-align: center;"> + <ul> + </ul> + </div> - // This event comes from the Queue Plugin - function queue_complete(num_files_uploaded) { - var status_msg = <?= t("Uploaded: __COUNT__")->for_js() ?>; - $("#gUploadStatus").html(status_msg.replace("__COUNT__", num_files_uploaded)); - } -</script> + <!-- Proxy the done request back to our form, since its been ajaxified --> + <button id="g-upload-done" class="ui-state-default ui-corner-all" onclick="$('#g-add-photos-form').submit();return false;"> + <?= t("Done") ?> + </button> + <button id="g-upload-cancel-all" class="ui-state-default ui-corner-all ui-state-disabled" onclick="$('#g-uploadify').uploadifyClearQueue();return false;" disabled="disabled"> + <?= t("Cancel All") ?> + </button> + </div> +</form> diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 8a01cd29..5cd1cd77 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <html> <head> - <title><?= t("Gallery 3 Upgrader") ?></title> + <title><?= t("Gallery 3 upgrader") ?></title> <link rel="stylesheet" type="text/css" href="<?= url::file("modules/gallery/css/upgrader.css") ?>" media="screen,print,projection" /> <script src="<?= url::file("lib/jquery.js") ?>" type="text/javascript"></script> @@ -11,29 +11,54 @@ <img src="<?= url::file("modules/gallery/images/gallery.png") ?>" /> <div id="inner"> <? if ($can_upgrade): ?> - <? if ($done): ?> - <div id="confirmation"> - <a onclick="$('#confirmation').slideUp(); return false;" href="#" class="close">[x]</a> - <div> + <div id="dialog" style="visibility: hidden"> + <a id="dialog_close_link" style="display: none" onclick="$('#dialog').fadeOut(); return false;" href="#" class="close">[x]</a> + <div id="busy" style="display: none"> + <h1> + <img width="16" height="16" src="<?= url::file("lib/images/loading-small.gif") ?>"/> + <?= t("Upgrade in progress!") ?> + </h1> + <p> + <?= t("Please don't refresh or leave the page.") ?> + </p> + </div> + <div id="done" style="display: none"> <h1> <?= t("That's it!") ?> </h1> <p> <?= t("Your <a href=\"%url\">Gallery</a> is up to date.", - array("url" => html::mark_clean(item::root()->url()))) ?> + array("url" => html::mark_clean(item::root()->url()))) ?> </p> </div> </div> <script type="text/javascript"> $(document).ready(function() { - $("#confirmation").css("left", Math.round(($(window).width() - $("#confirmation").width()) / 2)); - $("#confirmation").css("top", Math.round(($(window).height() - $("#confirmation").height()) / 2)); + $("#dialog").css("left", Math.round(($(window).width() - $("#dialog").width()) / 2)); + $("#dialog").css("top", Math.round(($(window).height() - $("#dialog").height()) / 2)); + $("#upgrade_link").click(function(event) { show_busy() }); + + <? if ($done): ?> + show_done(); + <? endif ?> }); + + var show_busy = function() { + $("#dialog").css("visibility", "visible"); + $("#busy").show(); + $("#upgrade_link").parent().removeClass("button-active"); + $("#upgrade_link").replaceWith($("#upgrade_link").html()) + } + + var show_done = function() { + $("#dialog").css("visibility", "visible"); + $("#done").show(); + $("#dialog_close_link").show(); + } </script> - <? endif ?> - <p class="gray_on_done"> + <p class="<?= $done ? "muted" : "" ?>"> <?= t("Welcome to the Gallery upgrader. One click and you're done!") ?> </p> <table> - <tr class="gray_on_done"> + <tr class="<?= $done ? "muted" : "" ?>"> <th> <?= t("Module name") ?> </th> <th> <?= t("Installed version") ?> </th> <th> <?= t("Available version") ?> </th> @@ -58,17 +83,23 @@ <? endforeach ?> </table> - <div class="button gray_on_done"> - <a href="<?= url::site("upgrader/upgrade") ?>"> + <? if ($done): ?> + <div class="button muted"> + <?= t("Upgrade all") ?> + </div> + <? else: ?> + <div class="button button-active"> + <a id="upgrade_link" href="<?= url::site("upgrader/upgrade") ?>"> <?= t("Upgrade all") ?> </a> </div> + <? endif ?> <? if (@$inactive): ?> - <p class="gray_on_done"> + <p class="<?= $done ? "muted" : "" ?>"> <?= t("The following modules are inactive and don't require an upgrade.") ?> </p> - <ul class="gray_on_done"> + <ul class="<?= $done ? "muted" : "" ?>"> <? foreach ($available as $module): ?> <? if (!$module->active): ?> <li> diff --git a/modules/gallery/views/user_languages_block.html.php b/modules/gallery/views/user_languages_block.html.php new file mode 100644 index 00000000..89185967 --- /dev/null +++ b/modules/gallery/views/user_languages_block.html.php @@ -0,0 +1,19 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<?= form::dropdown("g-select-session-locale", $installed_locales, $selected) ?> +<script type="text/javascript"> + $("#g-select-session-locale").change(function() { + var old_locale_preference = <?= html::js_string($selected) ?>; + var locale = $(this).val(); + if (old_locale_preference == locale) { + return; + } + + var expires = -1; + if (locale) { + expires = 365; + } + $.cookie("g_locale", locale, {"expires": expires, "path": "/"}); + window.location.reload(true); + }); +</script> + diff --git a/modules/gallery/views/welcome_message.html.php b/modules/gallery/views/welcome_message.html.php index 5515c3dc..24d01bab 100644 --- a/modules/gallery/views/welcome_message.html.php +++ b/modules/gallery/views/welcome_message.html.php @@ -1,5 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="gWelcomeMessage"> +<div id="g-welcome-message"> <h1 style="display: none"> <?= t("Welcome to Gallery 3!") ?> </h1> @@ -16,13 +16,13 @@ <p> <a href="<?= url::site("form/edit/users/{$user->id}") ?>" - title="<?= t("Edit Your Profile")->for_html_attr() ?>" - id="gAfterInstallChangePasswordLink" - class="gButtonLink ui-state-default ui-corners-all"> - <?= t("Change Password Now") ?> + title="<?= t("Edit your profile")->for_html_attr() ?>" + id="g-after-install-change-password-link" + class="g-button ui-state-default ui-corners-all"> + <?= t("Change password now") ?> </a> - <script> - $("#gAfterInstallChangePasswordLink").gallery_dialog(); + <script type="text/javascript"> + $("#g-after-install-change-password-link").gallery_dialog(); </script> </p> diff --git a/modules/gallery/views/welcome_message_loader.html.php b/modules/gallery/views/welcome_message_loader.html.php index 2c6bffca..d1ff2f3f 100644 --- a/modules/gallery/views/welcome_message_loader.html.php +++ b/modules/gallery/views/welcome_message_loader.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<span id="gWelcomeMessageLink" +<span id="g-welcome-message-link" title="<?= t("Welcome to Gallery 3")->for_html_attr() ?>" href="<?= url::site("welcome_message") ?>"/> <script type="text/javascript"> - $(document).ready(function(){$("#gWelcomeMessageLink").gallery_dialog({immediate: true});}); + $(document).ready(function(){$("#g-welcome-message-link").gallery_dialog({immediate: true});}); </script> |
