summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-07-20 12:45:04 -0700
committerBharat Mediratta <bharat@menalto.com>2010-07-20 12:45:04 -0700
commit6899af367b7766a6c7afa0f3e551b8d82230fd3f (patch)
tree0deaf12b3a857bf9f3894df7742aa869f41c48d6
parent9db310186a276f4cd2d07534a7184a801ae4f167 (diff)
Cleanup on the Admin > Languages page.
Hide the fieldset and legend in the theme, since they don't add any value. Change l10n_client::_server_url() to use the short style GMC urls and make the API a little tighter.
-rw-r--r--modules/gallery/controllers/admin_languages.php2
-rw-r--r--modules/gallery/helpers/l10n_client.php13
-rw-r--r--modules/gallery/views/admin_languages.html.php3
-rw-r--r--themes/admin_wind/css/screen.css11
4 files changed, 21 insertions, 8 deletions
diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php
index 0f134fcd..2e993816 100644
--- a/modules/gallery/controllers/admin_languages.php
+++ b/modules/gallery/controllers/admin_languages.php
@@ -109,7 +109,7 @@ class Admin_Languages_Controller extends Admin_Controller {
private function _share_translations_form() {
$form = new Forge("admin/languages/share", "", "post", array("id" => "g-share-translations-form"));
$group = $form->group("sharing")
- ->label(t("Sharing your own translations with the Gallery community is easy. Please do!"));
+ ->label("Translations API Key");
$api_key = l10n_client::api_key();
$server_link = l10n_client::server_api_key_url();
$group->input("api_key")
diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php
index f45f502d..52c13c78 100644
--- a/modules/gallery/helpers/l10n_client.php
+++ b/modules/gallery/helpers/l10n_client.php
@@ -20,13 +20,12 @@
class l10n_client_Core {
- private static function _server_url() {
- return "http://gallery.menalto.com/index.php";
+ private static function _server_url($path) {
+ return "http://gallery.menalto.com/translations/$path";
}
static function server_api_key_url() {
- return self::_server_url() . "?q=translations/userkey/" .
- self::client_token();
+ return self::_server_url("userkey/" . self::client_token());
}
static function client_token() {
@@ -53,7 +52,7 @@ class l10n_client_Core {
static function validate_api_key($api_key) {
$version = "1.0";
- $url = self::_server_url() . "?q=translations/status";
+ $url = self::_server_url("status");
$signature = self::_sign($version, $api_key);
list ($response_data, $response_status) = remote::post(
@@ -123,7 +122,7 @@ class l10n_client_Core {
}
$request_data = json_encode($request);
- $url = self::_server_url() . "?q=translations/fetch";
+ $url = self::_server_url("fetch");
list ($response_data, $response_status) = remote::post($url, array("data" => $request_data));
if (!remote::success($response_status)) {
throw new Exception("@todo TRANSLATIONS_FETCH_REQUEST_FAILED " . $response_status);
@@ -208,7 +207,7 @@ class l10n_client_Core {
// @todo reduce memory consumption, e.g. free $request
$request_data = json_encode($request);
- $url = self::_server_url() . "?q=translations/submit";
+ $url = self::_server_url("submit");
$signature = self::_sign($request_data);
list ($response_data, $response_status) = remote::post(
diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php
index d4b7b0c1..01d1ce3f 100644
--- a/modules/gallery/views/admin_languages.html.php
+++ b/modules/gallery/views/admin_languages.html.php
@@ -107,6 +107,9 @@
</a>
<h3><?= t("Sharing your translations") ?></h3>
+ <p>
+ <?= t("Sharing your own translations with the Gallery community is easy. Please do!") ?>
+ </p>
<?= $share_translations_form ?>
</div>
</div>
diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css
index 937c4d15..2ea60402 100644
--- a/themes/admin_wind/css/screen.css
+++ b/themes/admin_wind/css/screen.css
@@ -419,6 +419,17 @@ th {
color: #FF0000 !important;
}
+/* Language options ~~~~~~~~~~~~~~~~~~~~~~~~ */
+#g-share-translations-form fieldset {
+ border: 0px;
+ margin: 0px;
+ padding: 0px;
+}
+
+#g-share-translations-form fieldset legend {
+ display: none;
+}
+
/** *******************************************************************
* 5) Navigation and menus
*********************************************************************/