<?php $registerHash = array('package_name' => 'languages', 'package_path' => dirname(__FILE__) . '/', 'service' => LIBERTY_SERVICE_TRANSLATION, 'required_package' => TRUE); $gBitSystem->registerPackage($registerHash); // ********** BABELFISH ************ if ($gBitSystem->isFeatureActive('babelfish')) { require_once LANGUAGES_PKG_PATH . 'Babelfish.php'; $gBitSmarty->assignByRef('babelfish_links', Babelfish::links($gBitSystem->getConfig('language', 'en'))); } if ($gBitSystem->isFeatureActive('babelfish_logo')) { require_once LANGUAGES_PKG_PATH . 'Babelfish.php'; $gBitSmarty->assign('babelfish_logo', Babelfish::logo($gBitLanguage->mLanguage)); } if ($gBitSystem->isPackageActive('languages') && $gBitUser->hasPermission('p_languages_edit')) { $menuHash = array('package_name' => LANGUAGES_PKG_NAME, 'index_url' => LANGUAGES_PKG_URL . 'edit_languages.php', 'menu_template' => 'bitpackage:languages/menu_languages.tpl'); $gBitSystem->registerAppMenu($menuHash); } if ($gBitSystem->isFeatureActive('users_preferences') && $gBitUser->isRegistered()) { if ($gBitSystem->isFeatureActive('users_change_language')) { if ($userLang = $gBitUser->getPreference('bitlanguage')) { $gBitLanguage->setLanguage($userLang); } } } // oe=XX global request parameter where XX is an enabled language code that overrides everything else // oe is Output Encoding, which is the var google uses if (!empty($_REQUEST['oe']) && !empty($gBitLanguage->mLanguageList[$_REQUEST['oe']])) { $gBitLanguage->setLanguage($_REQUEST['oe']); } $gBitSmarty->assignByRef('gBitLanguage', $gBitLanguage); $gBitSmarty->assign('bitlanguage', $gBitLanguage->mLanguage);
<?php // (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id: babelfish.php 40059 2012-03-07 06:25:54Z pkdille $ //this script may only be included - so its better to die if called directly. $access->check_script($_SERVER['SCRIPT_NAME'], basename(__FILE__)); if ($prefs['feature_babelfish'] == 'y') { require_once 'lib/Babelfish.php'; $smarty->assign('babelfish_links', Babelfish::links($prefs['language'])); } if ($prefs['feature_babelfish_logo'] == 'y') { require_once 'lib/Babelfish.php'; $smarty->assign('babelfish_logo', Babelfish::logo($prefs['language'])); }
function module_babelfish_links($mod_reference, $module_params) { global $smarty, $prefs; require_once('lib/Babelfish.php'); $smarty->assign('babelfish_logo', Babelfish::logo($prefs['language'])); }
// \todo if this page is not viewable by anonymous, then don't display the babelfish stuff /* this code following if (0) is never executed, right? if (0) { $feature_babelfish = 'n'; $feature_babelfish_logo = 'n'; } */ if ($feature_babelfish == 'y') { require_once 'lib/Babelfish.php'; $smarty->assign('babelfish_links', Babelfish::links($language)); } else { $smarty->assign('babelfish_links', ''); } if ($feature_babelfish_logo == 'y') { require_once 'lib/Babelfish.php'; $smarty->assign('babelfish_logo', Babelfish::logo($language)); } else { $smarty->assign('babelfish_logo', ''); } $smarty->assign('user_dbl', $user_dbl); $smarty->assign('user', $user); $smarty->assign('group', $group); $smarty->assign('lock', false); $smarty->assign('title', $title); $smarty->assign('maxRecords', $maxRecords); // If we are processing a login then do not generate the challenge // if we are in any other case then yes. if (!strstr($_SERVER["REQUEST_URI"], 'tiki-login')) { if ($feature_challenge == 'y') { $chall = $userlib->generate_challenge(); $_SESSION["challenge"] = $chall;