if (!defined('IS_VALID_PHPMYFAQ')) { $protocol = 'http'; if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { $protocol = 'https'; } header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } clearstatcache(); if (isset($_SESSION['trans'])) { unset($_SESSION['trans']); } $langDir = PMF_ROOT_DIR . DIRECTORY_SEPARATOR . "lang"; $transDir = new DirectoryIterator($langDir); $isTransDirWritable = is_writable($langDir); $tt = new PMF_TransTool(); ?> <header> <h2> <i class="icon-wrench"></i> <?php echo $PMF_LANG['ad_menu_translations']; ?> <?php if ($permission["addtranslation"] && $isTransDirWritable) { ?> <div class="pull-right"> <a class="btn btn-success" href="?action=transadd"> <i class="icon-plus"></i> <?php echo $PMF_LANG['msgTransToolAddNewTranslation']; ?> </a>
*/ if (!defined('IS_VALID_PHPMYFAQ_ADMIN')) { header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } if (!$permission["edittranslation"]) { print $PMF_LANG['err_NotAuth']; return; } $translateLang = PMF_Filter::filterInput(INPUT_GET, 'translang', FILTER_SANITIZE_STRING); $page = PMF_Filter::filterInput(INPUT_GET, 'page', FILTER_VALIDATE_INT); $page = 1 > $page ? 1 : $page; if (empty($translateLang) || !file_exists(PMF_ROOT_DIR . "/lang/language_{$translateLang}.php")) { header("Location: ?action=translist"); } $tt = new PMF_TransTool(); /** * There are meanwhile over 600 language * vars and we won't to show them all * at once, so let's paginate. */ $itemsPerPage = 32; if (!isset($_SESSION['trans'])) { /** * English is our exemplary language */ $_SESSION['trans']['leftVarsOnly'] = $tt->getVars(PMF_ROOT_DIR . "/lang/language_en.php"); $_SESSION['trans']['rightVarsOnly'] = $tt->getVars(PMF_ROOT_DIR . "/lang/language_{$translateLang}.php"); } $leftVarsOnly = array_slice($_SESSION['trans']['leftVarsOnly'], ($page - 1) * $itemsPerPage, $itemsPerPage); $rightVarsOnly =& $_SESSION['trans']['rightVarsOnly'];