static function buildLanguageSelector() { $localeManager = LocaleManager::getInstance(); $html = '<div id="langHolder"><form id="langSelectorForm" method="get" action="' . $_SERVER['PHP_SELF'] . '"><p>'; $html .= '<select id="lang" name="lang">' . PHP_EOL; foreach ($localeManager->getLocales() as $langId => $lang) { $html .= '<option value="' . $langId . '"'; if ($langId == $localeManager->getSelectedLanaguageId()) { $html .= ' selected="selected"'; } $html .= '>' . _($lang['Name']) . '</option>'; } $html .= '</select><input type="submit" class="hidden" /></p></form></div>'; return $html; }
} else { $availableCities = $db->getAvailableCities('Dest', $currentRegion); } $availableDestCities =& $availableCities; $availableSrcCities =& $availableCities; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="css/reset-fonts.css"> <link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap_custom.min.css"> <link rel="stylesheet" type="text/css" href="css/common.css"> <link rel="stylesheet" type="text/css" href="css/index.css"> <?php if (LocaleManager::getInstance()->isRtl()) { ?> <link rel="stylesheet" type="text/css" href="css/common_rtl.css"> <?php } ?> <title>Carpool</title> </head> <body> <div id="bd"> <?php echo View_Navbar::buildNavbar(); echo View_Header::render(_('Welcome To The Carpool'), _('The colleagues, listed below, may be able to provide a ride both to and from the listed locations')); ?> <div id="content"> <div id="searchFormHolder">
function getQuestionsAnswersByLang($lang) { debug(__METHOD__ . "({$lang})"); assert(array_key_exists($lang, LocaleManager::getInstance()->getLocales())); try { $stmt = $this->_db->prepare('SELECT Id, Question, Answer FROM QuestionsAnswers WHERE Lang = :lang'); $stmt->bindParam(':lang', $lang); $stmt->execute(); return $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { logException($e); return false; } }
<table style="width: 100%" summary="<?php echo _('Edit existing translations'); ?> "> <tr> <th> <span><?php echo _('Language'); ?> </span> </th> <th></th> <th></th> </tr> <?php $locales = LocaleManager::getInstance()->getLocales(); $currentQuestions = DatabaseHelper::getInstance()->getQuestionsAnswers(); foreach ($currentQuestions as $questionAnswerAllLangs) { $id = $questionAnswerAllLangs[LocaleManager::getDefaultLocale()]['Id']; $first = true; foreach ($locales as $lang => $locale) { $questionAnswer = isset($questionAnswerAllLangs[$lang]) ? $questionAnswerAllLangs[$lang] : null; ?> <tr> <td> <span><?php echo $locales[$lang]['Name']; ?> </span> </td> <td>