diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2009-10-18 20:22:10 -0600 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2009-10-18 20:22:10 -0600 |
commit | 5f56cbf997c12ab1aaf14403873fd9dfc33690ef (patch) | |
tree | 0120ffbad2e7ac728fd830ccbb9d71db28ca48b1 /modules/gallery/views/admin_languages.html.php | |
parent | 91ab6f161fa1e118418922fbf0a42f1924d7df0e (diff) |
Wrap all admin views in g-block and g-block content. This provides the means to visually separate the view's title and description from everything else. Primary admin view title should always be h1, and only one h1 per view. Removed some unused admin CSS id's.
Diffstat (limited to 'modules/gallery/views/admin_languages.html.php')
-rw-r--r-- | modules/gallery/views/admin_languages.html.php | 187 |
1 files changed, 98 insertions, 89 deletions
diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php index 74f48b76..311672de 100644 --- a/modules/gallery/views/admin_languages.html.php +++ b/modules/gallery/views/admin_languages.html.php @@ -1,103 +1,112 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<div id="g-languages"> - <h1> <?= t("Languages") ?> </h1> - <p> - <?= t("Install new languages, update installed ones and set the default language for your Gallery.") ?> - </p> +<script type="text/javascript"> + var old_default_locale = <?= html::js_string($default_locale) ?>; - <form id="g-languages-form" 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 ?> + $("input[name='installed_locales[]']").change(function (event) { + if (this.checked) { + $("input[type='radio'][value='" + this.value + "']").enable(); + } else { + if ($("input[type='radio'][value='" + this.value + "']").selected()) { // if you deselect your default language, switch to some other installed language + $("input[type='radio'][value='" + old_default_locale + "']").attr("checked", "checked"); + } + $("input[type='radio'][value='" + this.value + "']").attr("disabled", "disabled"); + } + }); - <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++ ?> + $("g-languages-form").ajaxForm({ + dataType: "json", + success: function(data) { + if (data.result == "success") { + 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'); + } + } + }); +</script> - <? endforeach ?> - </table> - <input type="submit" value="<?= t("Update languages")->for_html_attr() ?>" /> - </form> +<div class="g-block"> + <h1> <?= t("Languages and Translation") ?> </h1> - <script type="text/javascript"> - var old_default_locale = <?= html::js_string($default_locale) ?>; + <div class="g-block-content"> - $("input[name='installed_locales[]']").change(function (event) { - if (this.checked) { - $("input[type='radio'][value='" + this.value + "']").enable(); - } else { - if ($("input[type='radio'][value='" + this.value + "']").selected()) { // if you deselect your default language, switch to some other installed language - $("input[type='radio'][value='" + old_default_locale + "']").attr("checked", "checked"); - } - $("input[type='radio'][value='" + this.value + "']").attr("disabled", "disabled"); - } - }); - - $("g-languages-form").ajaxForm({ - dataType: "json", - success: function(data) { - if (data.result == "success") { - 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'); - } - } - }); - </script> -</div> - -<div id="g-translations"> - <h1> <?= t("Translations") ?> </h1> - <p> - <?= t("Create your own translations and share them with the rest of the Gallery community.") ?> - </p> + <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> - <h3><?= t("Translating Gallery") ?></h3> + <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-installed" : "" ?><?= ($default_locale == $code) ? " g-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> + </div> + </div> - <div class="g-block"> - <a href="http://codex.gallery2.org/Gallery3:Localization" target="_blank" - class="g-doc-link 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-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 1:</strong> Make sure the target language is installed and up to date (check above).") ?></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> - <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> + <h3><?= t("Translating Gallery") ?></h3> - <p><?= t("<strong>Step 3:</strong> Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?></p> + <p><?= t("Follow these steps to begin translating Gallery.") ?></p> - <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> -</div> + <ul> + <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> + </ul> + <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 ?> + <h3><?= t("Sharing your translations") ?></h3> + <?= $share_translations_form ?> + </div> + </div> + + </div> </div> |