Skip to content

Commit

Permalink
Convert some database calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Dec 16, 2009
1 parent 064a24b commit 4566c29
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions modules/gallery/controllers/l10n_client.php
Expand Up @@ -113,12 +113,11 @@ private static function _l10n_client_search_form() {
public static function l10n_form() {
if (Input::instance()->get("show_all_l10n_messages")) {
$calls = array();
foreach (Database::instance()
foreach (db::build()
->select("key", "message")
->from("incoming_translations")
->where("locale", "=", "root"))
->get()
->as_array() as $row) {
->where("locale", "=", "root")
->execute() as $row) {
$calls[$row->key] = array(unserialize($row->message), array());
}
} else {
Expand All @@ -128,21 +127,19 @@ public static function l10n_form() {

if ($calls) {
$translations = array();
foreach (Database::instance()
foreach (db::build()
->select("key", "translation")
->from("incoming_translations")
->where("locale", "=", $locale)
->get()
->as_array() as $row) {
->execute() as $row) {
$translations[$row->key] = unserialize($row->translation);
}
// Override incoming with outgoing...
foreach (Database::instance()
foreach (db::build()
->select("key", "translation")
->from("outgoing_translations")
->where("locale", "=", $locale)
->get()
->as_array() as $row) {
->execute() as $row) {
$translations[$row->key] = unserialize($row->translation);
}

Expand Down

0 comments on commit 4566c29

Please sign in to comment.