<div class="box"> <?php if (!array_key_exists('token', $_REQUEST)) { throw new TokenIsMissingException(); } $token = $_REQUEST['token']; if (!Utilities::isValidUID($token)) { throw new TokenHasBadFormatException($token); } $lang = array_key_exists('lang', $_REQUEST) ? $_REQUEST['lang'] : null; $available = Lang::getAvailableLanguages(); if (!array_key_exists($lang, $available)) { $lang = Lang::getCode(); } $url = '?s=translate_email&token=' . $token . '&lang='; if (count($available) > 1) { echo '<div class="buttons">'; foreach ($available as $id => $dfn) { if ($id == $lang) { echo '<span class="selected">' . Utilities::sanitizeOutput($dfn['name']) . '</span>'; } else { echo '<a href="' . $url . $id . '">' . Utilities::sanitizeOutput($dfn['name']) . '</a>'; } } echo '</div>'; } $translatable = TranslatableEmail::fromToken($token); $translation = $translatable->translate($lang); /* * Do not call Template::sanitizeOutput on email contents after that because * TranslatableEmail::translate calls Translation::replace which itself calls
?> " data-lang="<?php echo $lang; ?> " title="<?php echo $content['name']; ?> "> <img src="{img:core/<?php echo $lang; ?> .png}" /> <label><?php echo $content['name']; ?> </label> <?php if ($lang == Lang::getCode()) { ?> <span class="fa fa-check"></span> <?php } ?> </a> </li> <?php } ?> </ul> </li> <?php }
/** * Allows to show the lang selector button */ private function showLangSelector() { echo "<li class='has-dropdown' id='li_lang'>"; echo " <a href='#' title='Choisissez votre langue'><i class='fa fa-language'></i><label>" . lang::tr('Language') . "</label></a>"; echo " <ul class='dropdown'>"; $langs = Lang::getAvailableLanguages(); $currentLang = Lang::getCode(); foreach ($langs as $lang => $content) { echo "<li>"; echo "<a class='lang" . ($lang == $currentLang ? ' nocursor' : '') . "' data-lang='" . $lang . "' title='" . $content['name'] . "'>"; echo "<img src='" . Config::get('site_url') . ('/lib/images/' . $lang . '.png') . "'/> <label>" . $content['name'] . "</label>"; if ($lang == $currentLang) { echo " <i class='fa fa-check'></i>"; } echo "</a>"; echo "</li>"; } echo "</ul>"; echo "</li>"; }
<script src="<?php echo Config::get('site_url') . '/lib/foundation/js/vendor/modernizr.js'; ?> "></script> <script type="text/javascript"> notes.php_lang = <?php echo "'" . Lang::getCode() . "'"; ?> ; </script> <?php $currentLanguage = Lang::getCode(); if ($currentLanguage == 'en') { $currentLanguage = 'en-gb'; } echo "<script type='text/javascript' src='" . Config::get('site_url') . "/lib/fullcalendar/lang/" . $currentLanguage . ".js' ></script>"; ?> <!-- COMMON --> <script type="text/javascript" src="./js/common/utilities.js"></script> <script type="text/javascript" src="./js/common/constants.js"></script> <script type="text/javascript" src="./js/common/exceptions.js"></script>
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo Lang::getCode(); ?> " xml:lang="<?php echo Lang::getCode(); ?> "> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>{cfg:application_name}</title> <?php GUI::includeStylesheets(); ?> <?php GUI::includeFavicon(); ?> <script type="text/javascript" src="{path:app-config.js.php}"></script> <?php GUI::includeScripts(); ?> <meta name="robots" content="noindex, nofollow" /> <meta name="auth" content="noindex, nofollow" /> </head>