コード例 #1
1
ファイル: footer.php プロジェクト: fignew/xibo-cms
        <script src="theme/default/libraries/colors/colors.min.js"></script>
        <script src="theme/default/js/xibo-cms.js"></script>
    	<script src="theme/default/js/xibo-forms.js"></script>
    	<script src="theme/default/js/xibo-layout-designer.js"></script>
    	<script src="theme/default/js/xibo-preview-timeline.js"></script>
    	<script src="theme/default/js/xibo-calendar.js"></script>
    	<script src="theme/default/js/xibo-datasets.js"></script>
        <script type="text/javascript">
        var translations = <?php 
echo Theme::Get('translations') == '' ? '{}' : Theme::Get('translations');
?>
;
        var language = "<?php 
echo TranslationEngine::GetJsLocale();
?>
";
        var dateFormat = "<?php 
echo Config::GetSetting('DATE_FORMAT', 'Y-m-d h:i');
?>
";
        var calendarType = "<?php 
echo Config::GetSetting('CALENDAR_TYPE');
?>
";
        var calendarLanguage = "<?php 
echo strlen(TranslationEngine::GetJsLocale() <= 2) ? TranslationEngine::GetJsLocale() . '-' . strtoupper(TranslationEngine::GetJsLocale()) : TranslationEngine::GetJsLocale();
?>
";
        </script>
	</body>
</html>
コード例 #2
0
ファイル: include.php プロジェクト: fignew/xibo-cms
    if (Config::GetSetting('FORCE_HTTPS', 0) == 1) {
        $redirect = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        header("Location: {$redirect}");
        exit;
    }
}
// What is the production mode of the server?
if (Config::GetSetting('SERVER_MODE') == 'Test') {
    ini_set('display_errors', 1);
}
// Debugging?
if (Debug::getLevel(Config::GetSetting('audit')) == 10) {
    error_reporting(E_ALL);
}
// Setup the translations for gettext
TranslationEngine::InitLocale();
// Create login control system
require_once 'modules/' . Config::GetSetting("userModule");
// Page variable set? Otherwise default to index
$page = Kit::GetParam('p', _REQUEST, _WORD, 'index');
$function = Kit::GetParam('q', _REQUEST, _WORD);
// Does the version in the DB match the version of the code?
// If not then we need to run an upgrade. Change the page variable to upgrade
if (DBVERSION != WEBSITE_VERSION && !($page == 'index' && $function == 'login' || $page == 'error')) {
    require_once 'install/upgradestep.class.php';
    $page = 'upgrade';
    if (Kit::GetParam('includes', _POST, _BOOL)) {
        $upgradeFrom = Kit::GetParam('upgradeFrom', _POST, _INT);
        $upgradeTo = Kit::GetParam('upgradeTo', _POST, _INT);
        for ($i = $upgradeFrom + 1; $i <= $upgradeTo; $i++) {
            if (file_exists('install/database/' . $i . '.php')) {
コード例 #3
0
ファイル: index.php プロジェクト: esokullu/grou.ps
 */
$access_isAuthenticated = isAuthenticated();
$access_name = '';
// name and surname of the user
$access_isGroupMember = false;
// is he/she a group member
$access_isGroupAdmin = false;
// is he/she admin of the group
/**
 * Create a new Group object with a single parameter;
 * $group_name
 */
$group = new Group();
// turn on the translation engine
$grouplang = $group_language;
$treng = new TranslationEngine($grouplang);
/* Get the group template
* and set the templating engine
*/
$group_template = $group_template;
/*
* assign the group keywords
*/
$tpl->assign('group_keywords', $group_keywords);
error_log("istanbul guzeldir - 1");
/*
* Set the authentication variables if this is an
* authenticated user
*/
if ($access_isAuthenticated) {
    // $access_name = $access->getName(); // put user name if he/she is auth'd
コード例 #4
0
 /**
  * Return the Edit Form as HTML
  * @return
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     // Edit calls are the same as add calls, except you will to check the user has permissions to do the edit
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this assignment.');
         $this->response->keepOpen = false;
         return $this->response;
     }
     // All forms should set some meta data about the form.
     // Usually, you would want this meta data to remain the same.
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $this->layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $this->regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $this->mediaid . '">');
     // Augment settings with templates
     $this->loadTemplates();
     // Two tabs
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'));
     $tabs[] = FormManager::AddTab('advanced', __('Appearance'));
     $tabs[] = FormManager::AddTab('forecast', __('Forecast'));
     Theme::Set('form_tabs', $tabs);
     $formFields['general'][] = FormManager::AddText('name', __('Name'), $this->GetOption('name'), __('An optional name for this media'), 'n');
     $formFields['general'][] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this item should be displayed.'), 'd', 'required');
     $formFields['general'][] = FormManager::AddCheckbox('useDisplayLocation', __('Use the Display Location'), $this->GetOption('useDisplayLocation'), __('Use the location configured on the display'), 'd');
     // Any values for the form fields should be added to the theme here.
     $formFields['general'][] = FormManager::AddNumber('latitude', __('Latitude'), $this->GetOption('latitude'), __('The Latitude for this weather module'), 'l', '', 'locationControls');
     $formFields['general'][] = FormManager::AddNumber('longitude', __('Longitude'), $this->GetOption('longitude'), __('The Longitude for this weather module'), 'g', '', 'locationControls');
     $formFields['advanced'][] = FormManager::AddCombo('templateId', __('Weather Template'), $this->GetOption('templateId'), $this->settings['templates'], 'id', 'value', __('Select the template you would like to apply. This can be overridden using the check box below.'), 't', 'template-selector-control');
     $formFields['advanced'][] = FormManager::AddCombo('icons', __('Icons'), $this->GetOption('icons'), $this->iconsAvailable(), 'id', 'value', __('Select the icon set you would like to use.'), 't', 'icon-controls');
     $formFields['advanced'][] = FormManager::AddNumber('size', __('Size'), $this->GetOption('size', 1), __('Set the size. Start at 1 and work up until the widget fits your region appropriately.'), 's', 'number', 'template-selector-control');
     $formFields['advanced'][] = FormManager::AddCombo('units', __('Units'), $this->GetOption('units'), $this->unitsAvailable(), 'id', 'value', __('Select the units you would like to use.'), 'u');
     $formFields['advanced'][] = FormManager::AddCombo('lang', __('Language'), $this->GetOption('lang', TranslationEngine::GetLocale(2)), $this->supportedLanguages(), 'id', 'value', __('Select the language you would like to use.'), 'l');
     $formFields['advanced'][] = FormManager::AddNumber('updateInterval', __('Update Interval (mins)'), $this->GetOption('updateInterval', 60), __('Please enter the update interval in minutes. This should be kept as high as possible. For example, if the data will only change once per hour this could be set to 60.'), 'n', 'required');
     $formFields['advanced'][] = FormManager::AddCheckbox('dayConditionsOnly', __('Only show Daytime weather conditions'), $this->GetOption('dayConditionsOnly', 1), __('Tick if you would like to only show the Daytime weather conditions.'), 'd');
     $formFields['general'][] = FormManager::AddText('color', __('Colour'), $this->GetOption('color', '000'), __('Please select a colour for the foreground text.'), 'c', 'required');
     $formFields['advanced'][] = FormManager::AddCheckbox('overrideTemplate', __('Override the template?'), $this->GetOption('overrideTemplate'), __('Tick if you would like to override the template.'), 'o');
     $formFields['advanced'][] = FormManager::AddMultiText('currentTemplate', __('Template for Current Forecast'), $this->GetRawNode('currentTemplate'), __('Enter the template for the current forecast. For a list of substitutions click "Request Forecast" below.'), 't', 10, 'required', 'template-override-controls');
     $formFields['advanced'][] = FormManager::AddMultiText('dailyTemplate', __('Template for Daily Forecast'), $this->GetRawNode('dailyTemplate'), __('Enter the template for the current forecast. Replaces [dailyForecast] in main template.'), 't', 10, NULL, 'template-override-controls');
     $formFields['advanced'][] = FormManager::AddMultiText('styleSheet', __('CSS Style Sheet'), $this->GetRawNode('styleSheet'), __('Enter a CSS style sheet to style the weather widget'), 'c', 10, 'required', 'template-override-controls');
     $formFields['forecast'][] = FormManager::AddMessage(__('Please press Request Forecast to show the current forecast and all available substitutions.'));
     // Encode up the template
     if (Config::GetSetting('SERVER_MODE') == 'Test' && $this->user->usertypeid == 1) {
         $formFields['forecast'][] = FormManager::AddMessage('<pre>' . htmlentities(json_encode(array('id' => 'ID', 'value' => 'TITLE', 'main' => $this->GetRawNode('currentTemplate'), 'daily' => $this->GetRawNode('dailyTemplate'), 'css' => $this->GetRawNode('styleSheet')))) . '</pre>');
     }
     // Configure the field dependencies
     $this->SetFieldDepencencies();
     // Append the Templates to the response
     $this->response->extra = $this->settings['templates'];
     // Modules should be rendered using the theme engine.
     Theme::Set('form_fields_general', $formFields['general']);
     Theme::Set('form_fields_advanced', $formFields['advanced']);
     Theme::Set('form_fields_forecast', $formFields['forecast']);
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->dialogTitle = __('Forecast IO');
     $this->response->callBack = 'forecastIoFormSetup';
     // The response object outputs the required JSON object to the browser
     // which is then processed by the CMS JavaScript library (xibo-cms.js).
     $this->response->AddButton(__('Request Forecast'), 'requestTab("forecast", "index.php?p=module&q=exec&mod=' . $this->type . '&method=requestTab&layoutid=' . $this->layoutid . '&regionid=' . $this->regionid . '&mediaid=' . $this->mediaid . '")');
     $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $this->layoutid . '&regionid=' . $this->regionid . '&q=RegionOptions")');
     $this->response->AddButton(__('Apply'), 'XiboDialogApply("#ModuleForm")');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     // The response must be returned.
     return $this->response;
 }
コード例 #5
0
ファイル: clock.module.php プロジェクト: fignew/xibo-cms
    /**
     * GetResource
     *     Return the rendered resource to be used by the client (or a preview)
     *     for displaying this content.
     * @param integer $displayId If this comes from a real client, this will be the display id.
     */
    public function GetResource($displayId = 0)
    {
        // Clock Type
        switch ($this->GetOption('clockTypeId', 1)) {
            case 1:
                // Analogue
                $template = file_get_contents('modules/theme/HtmlTemplateForClock.html');
                // Render our clock face
                $theme = $this->GetOption('theme') == 1 ? 'light' : 'dark';
                $theme_face = $this->GetOption('theme') == 1 ? 'clock_bg_modern_light.png' : 'clock_bg_modern_dark.png';
                $template = str_replace('<!--[[[CLOCK_FACE]]]-->', base64_encode(file_get_contents('modules/theme/' . $theme_face)), $template);
                // Light or dark?
                $template = str_replace('<!--[[[CLOCK_THEME]]]-->', $theme, $template);
                $template = str_replace('<!--[[[OFFSET]]]-->', $this->GetOption('offset', 0), $template);
                // After body content
                $isPreview = Kit::GetParam('preview', _REQUEST, _WORD, 'false') == 'true';
                $javaScriptContent = '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'jquery-1.11.1.min.js"></script>';
                $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'moment.js"></script>';
                // Replace the After body Content
                $template = str_replace('<!--[[[JAVASCRIPTCONTENT]]]-->', $javaScriptContent, $template);
                break;
            case 2:
                // Digital
                // Digital clock is essentially a cut down text module which always fits to the region
                $template = file_get_contents('modules/preview/HtmlTemplate.html');
                // Extract the format from the raw node in the XLF
                $rawXml = new DOMDocument();
                $rawXml->loadXML($this->GetRaw());
                $formatNodes = $rawXml->getElementsByTagName('format');
                $formatNode = $formatNodes->item(0);
                $format = $formatNode->nodeValue;
                // Strip out the bit between the [] brackets and use that as the format mask for moment.
                $matches = '';
                preg_match_all('/\\[.*?\\]/', $format, $matches);
                foreach ($matches[0] as $subs) {
                    $format = str_replace($subs, '<span class="clock" format="' . str_replace('[', '', str_replace(']', '', $subs)) . '"></span>', $format);
                }
                // Replace all the subs
                $template = str_replace('<!--[[[BODYCONTENT]]]-->', $format, $template);
                // After body content
                $options = array('previewWidth' => Kit::GetParam('width', _GET, _DOUBLE, 0), 'previewHeight' => Kit::GetParam('height', _GET, _DOUBLE, 0), 'originalWidth' => $this->width, 'originalHeight' => $this->height, 'scaleOverride' => Kit::GetParam('scale_override', _GET, _DOUBLE, 0));
                $isPreview = Kit::GetParam('preview', _REQUEST, _WORD, 'false') == 'true';
                $javaScriptContent = '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'jquery-1.11.1.min.js"></script>';
                $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'moment.js"></script>';
                $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/' : '') . 'xibo-layout-scaler.js"></script>';
                $javaScriptContent .= '<script type="text/javascript">
                    var locale = "' . TranslationEngine::GetJsLocale() . '";
                    var options = ' . json_encode($options) . ';

                    function updateClock() {
                        $(".clock").each(function() {
                            $(this).html(moment().add(' . $this->GetOption('offset', 0) . ', "m").format($(this).attr("format")));
                        });
                    }

                    $(document).ready(function() {
                        moment.locale(locale);
                        updateClock();
                        setInterval(updateClock, 1000);
                        $("body").xiboLayoutScaler(options);
                    });
                </script>';
                // Replace the After body Content
                $template = str_replace('<!--[[[JAVASCRIPTCONTENT]]]-->', $javaScriptContent, $template);
                // Add our fonts.css file
                $headContent = '<link href="' . ($isPreview ? 'modules/preview/' : '') . 'fonts.css" rel="stylesheet" media="screen">';
                $headContent .= '<style type="text/css">' . file_get_contents(Theme::ItemPath('css/client.css')) . '</style>';
                $template = str_replace('<!--[[[HEADCONTENT]]]-->', $headContent, $template);
                break;
            case 3:
                // Flip Clock
                $template = file_get_contents('modules/theme/HtmlTemplateForFlipClock.html');
                // Head Content (CSS for flip clock)
                $template = str_replace('<!--[[[HEADCONTENT]]]-->', '<style type="text/css">' . file_get_contents('modules/preview/vendor/flipclock.css') . '</style>', $template);
                $template = str_replace('<!--[[[OFFSET]]]-->', $this->GetOption('offset', 0), $template);
                // After body content
                $isPreview = Kit::GetParam('preview', _REQUEST, _WORD, 'false') == 'true';
                $javaScriptContent = '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'jquery-1.11.1.min.js"></script>';
                $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'flipclock.min.js"></script>';
                // Replace the After body Content
                $template = str_replace('<!--[[[JAVASCRIPTCONTENT]]]-->', $javaScriptContent, $template);
                break;
        }
        // If we are a preview, then pass in the width and height
        $template = str_replace('<!--[[[PREVIEW_WIDTH]]]-->', Kit::GetParam('width', _GET, _DOUBLE, 0), $template);
        $template = str_replace('<!--[[[PREVIEW_HEIGHT]]]-->', Kit::GetParam('height', _GET, _DOUBLE, 0), $template);
        // Replace the View Port Width?
        if (isset($_GET['preview'])) {
            $template = str_replace('[[ViewPortWidth]]', $this->width, $template);
        }
        // Return that content.
        return $template;
    }
コード例 #6
0
ファイル: text.module.php プロジェクト: taphier/xibo-cms
 /**
  * Raw Preview
  */
 public function GetResource($displayId = 0)
 {
     // Load in the template
     if ($this->layoutSchemaVersion == 1) {
         $template = file_get_contents('modules/preview/Html4TransitionalTemplate.html');
     } else {
         $template = file_get_contents('modules/preview/HtmlTemplate.html');
     }
     // Replace the View Port Width?
     if (isset($_GET['preview'])) {
         $template = str_replace('[[ViewPortWidth]]', $this->width, $template);
     }
     $width = Kit::GetParam('width', _REQUEST, _DOUBLE);
     $height = Kit::GetParam('height', _REQUEST, _DOUBLE);
     $duration = $this->duration;
     // Get the text out of RAW
     $rawXml = new DOMDocument();
     $rawXml->loadXML($this->GetRaw());
     // Get the Text Node
     $textNodes = $rawXml->getElementsByTagName('text');
     $textNode = $textNodes->item(0);
     $text = $textNode->nodeValue;
     // Handle older layouts that have a direction node but no effect node
     $oldDirection = $this->GetOption('direction', 'none');
     if ($oldDirection != 'none') {
         $oldDirection = 'marquee' . ucfirst($oldDirection);
     }
     $effect = $this->GetOption('effect', $oldDirection);
     // Set some options
     $options = array('type' => $this->type, 'fx' => $effect, 'duration' => $duration, 'durationIsPerItem' => false, 'numItems' => 1, 'takeItemsFrom' => 'start', 'itemsPerPage' => 0, 'speed' => $this->GetOption('speed', 0), 'originalWidth' => $this->width, 'originalHeight' => $this->height, 'previewWidth' => Kit::GetParam('width', _GET, _DOUBLE, 0), 'previewHeight' => Kit::GetParam('height', _GET, _DOUBLE, 0), 'scaleOverride' => Kit::GetParam('scale_override', _GET, _DOUBLE, 0));
     // See if we need to replace out any [clock] or [date] tags
     $clock = false;
     if (stripos($text, '[Clock]')) {
         $clock = true;
         $text = str_replace('[Clock]', '[HH:mm]', $text);
     }
     if (stripos($text, '[Clock|')) {
         $clock = true;
         $text = str_replace('[Clock|', '[', $text);
     }
     if (stripos($text, '[Date]')) {
         $clock = true;
         $text = str_replace('[Date]', '[DD/MM/YYYY]', $text);
     }
     if ($clock) {
         // Strip out the bit between the [] brackets and use that as the format mask for moment.
         $matches = '';
         preg_match_all('/\\[.*?\\]/', $text, $matches);
         foreach ($matches[0] as $subs) {
             $text = str_replace($subs, '<span class="clock" format="' . str_replace('[', '', str_replace(']', '', $subs)) . '"></span>', $text);
         }
     }
     // Generate a JSON string of substituted items.
     $items[] = $text;
     // Replace the head content
     $isPreview = Kit::GetParam('preview', _REQUEST, _WORD, 'false') == 'true';
     $javaScriptContent = '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'jquery-1.11.1.min.js"></script>';
     // Need the marquee plugin?
     if (stripos($effect, 'marquee') !== false) {
         $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'jquery.marquee.min.js"></script>';
     }
     // Need the cycle plugin?
     if ($effect != 'none') {
         $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'jquery-cycle-2.1.6.min.js"></script>';
     }
     $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/' : '') . 'xibo-layout-scaler.js"></script>';
     $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/' : '') . 'xibo-text-render.js"></script>';
     // Do we need to include moment?
     if ($clock) {
         $javaScriptContent .= '<script type="text/javascript" src="' . ($isPreview ? 'modules/preview/vendor/' : '') . 'moment.js"></script>';
     }
     $javaScriptContent .= '<script type="text/javascript">';
     $javaScriptContent .= '   var options = ' . json_encode($options) . ';';
     $javaScriptContent .= '   var items = ' . json_encode($items) . ';';
     $javaScriptContent .= '   $(document).ready(function() { ';
     $javaScriptContent .= '       $("#content").xiboTextRender(options, items); $("body").xiboLayoutScaler(options);';
     if ($clock) {
         $javaScriptContent .= ' updateClock(); setInterval(updateClock, 1000); moment.locale("' . TranslationEngine::GetJsLocale() . '"); ';
     }
     $javaScriptContent .= '   }); ';
     if ($clock) {
         $javaScriptContent .= '
             function updateClock() {
                 $(".clock").each(function() {
                     $(this).html(moment().format($(this).attr("format")));
                 });
             }
         ';
     }
     $javaScriptContent .= '</script>';
     // Replace the Head Content with our generated javascript
     $template = str_replace('<!--[[[JAVASCRIPTCONTENT]]]-->', $javaScriptContent, $template);
     // Add our fonts.css file
     $headContent = '<link href="' . ($isPreview ? 'modules/preview/' : '') . 'fonts.css" rel="stylesheet" media="screen">';
     $headContent .= '<style type="text/css">' . file_get_contents(Theme::ItemPath('css/client.css')) . '</style>';
     $template = str_replace('<!--[[[HEADCONTENT]]]-->', $headContent, $template);
     // Replace the Body Content with our generated text
     $template = str_replace('<!--[[[BODYCONTENT]]]-->', '', $template);
     return $template;
 }
コード例 #7
0
 /**
  * Gets and Sets the Locale
  * @param $language string[optional] The Language to Load
  */
 public static function InitLocale($language = NULL)
 {
     $localeDir = 'locale';
     $default = $language == NULL ? Config::GetSetting('DEFAULT_LANGUAGE') : $language;
     global $transEngine;
     global $stream;
     // Build an array of supported languages
     $supportedLanguages = scandir($localeDir);
     // Try to get the local firstly from _REQUEST (post then get)
     $requestedLanguage = Kit::GetParam('lang', _REQUEST, _WORD, '');
     $foundLanguage = '';
     if ($requestedLanguage != '') {
         // Serve only the requested language
         // Firstly, Sanitize it
         $requestedLanguage = str_replace('-', '_', $requestedLanguage);
         // Check its valid
         if (in_array($requestedLanguage . '.mo', $supportedLanguages)) {
             $foundLanguage = $requestedLanguage;
         }
     } else {
         if (Config::GetSetting('DETECT_LANGUAGE') == 1) {
             // Detect the language, try from HTTP accept
             // Parse the language header and build a preference array
             $languagePreferenceArray = TranslationEngine::parseHttpAcceptLanguageHeader();
             if (count($languagePreferenceArray) > 0) {
                 // Go through the list until we have a match
                 foreach ($languagePreferenceArray as $languagePreference => $preferenceRating) {
                     // We don't ship an en.mo, so fudge in a case where we automatically convert that to en_GB
                     if ($languagePreference == 'en') {
                         $languagePreference = 'en_GB';
                     }
                     // Sanitize
                     $languagePreference = str_replace('-', '_', $languagePreference);
                     // Check it is valid
                     if (in_array($languagePreference . '.mo', $supportedLanguages)) {
                         $foundLanguage = $languagePreference;
                         break;
                     }
                 }
             }
         }
     }
     // Are we still empty, then default language from settings
     if ($foundLanguage == '') {
         // Check the default
         if (!in_array($default . '.mo', $supportedLanguages)) {
             Debug::Info('Resolved language ' . $default . ' not available.');
             return;
         }
         // The default is valid
         $foundLanguage = $default;
     }
     // Debug::LogEntry('audit', 'Creating new file streamer for '. $localeDir . '/' . $foundLanguage . '.mo', 'TranslationEngine', 'InitLocal');
     if (!($stream = new CachedFileReader($localeDir . '/' . $foundLanguage . '.mo'))) {
         Debug::Info('Resolved language ' . $foundLanguage . ' not available.');
         $transEngine = false;
         return;
     }
     $transEngine = new gettext_reader($stream);
     self::$locale = $foundLanguage;
     self::$jsLocale = str_replace('_', '-', $foundLanguage);
 }