static function availableLanguages()
    {
        $langs = array();
        $lang_dir = ReporticoUtility::findBestLocationInIncludePath("language");
    //echo $lang_dir; die;
        if (is_dir($lang_dir)) {
            // Place english at the start
            if ($dh = opendir($lang_dir)) {
                while (($file = readdir($dh)) !== false) {
                    if ($file == "en_gb" || $file == "en_us") {
                        if (is_dir($lang_dir . "/" . $file)) {
                            $langs[] = array("label" => self::templateXlate($file), "value" => $file, "active" => ($file == ReporticoApp::getConfig("language")));
                        }
                    }

                }
                closedir($dh);
            }
            if ($dh = opendir($lang_dir)) {
                while (($file = readdir($dh)) !== false) {
                    if ($file != "." && $file != ".." && $file != "CVS" && $file != "packs" && $file != "en_us" && $file != "en_gb") {
                        if (is_dir($lang_dir . "/" . $file)) {
                            $langs[] = array("label" => self::templateXlate($file), "value" => $file, "active" => ($file == ReporticoApp::getConfig("language")));
                        }
                    }

                }
                closedir($dh);
            }
        }

        // No languages found at all - default to en_gb
        if (count($langs) == 0) {
            $langs[] = array("label" => self::templateXlate("en_gb"), "value" => "en_gb");
        }
        return $langs;
    }
static function availableLanguages()
    {
        $langs = array();
        $lang_dir = ReporticoUtility::findBestLocationInIncludePath("language");
    //echo $lang_dir; die;
        if (is_dir($lang_dir)) {
            // Place english at the start
            if ($dh = opendir($lang_dir)) {
                while (($file = readdir($dh)) !== false) {
                    if ($file == "en_gb" || $file == "en_us") {
                        if (is_dir($lang_dir . "/" . $file)) {
                            $langs[] = array("label" => self::templateXlate($file), "value" => $file, "active" => ($file == ReporticoApp::getConfig("language")));
                        }
                    }

                }
                closedir($dh);
            }
            if ($dh = opendir($lang_dir)) {
                while (($file = readdir($dh)) !== false) {
                    if ($file != "." && $file != ".." && $file != "CVS" && $file != "packs" && $file != "en_us" && $file != "en_gb") {
                        if (is_dir($lang_dir . "/" . $file)) {
                            $langs[] = array("label" => self::templateXlate($file), "value" => $file, "active" => ($file == ReporticoApp::getConfig("language")));
                        }
                    }

                }
                closedir($dh);
            }
        }

        // No languages found at all - default to en_gb
        if (count($langs) == 0) {
            $langs[] = array("label" => self::templateXlate("en_gb"), "value" => "en_gb");
        }
        return $langs;
    }
static function availableLanguages ( ) { $ langs = array ( ) ; $ lang_dir = ReporticoUtility :: findBestLocationInIncludePath ( "language" ) ; //echo $lang_dir; die; if ( is_dir ( $ lang_dir ) ) { // Place english at the start if ( $ dh = opendir ( $ lang_dir ) ) { while ( ( $ file = readdir ( $ dh ) ) !== false ) { if ( $ file == "en_gb" || $ file == "en_us" ) { if ( is_dir ( $ lang_dir . "/" . $ file ) ) { $ langs [ ] = array ( "label" => self :: templateXlate ( $ file ) , "value" => $ file , "active" => ( $ file == ReporticoApp :: getConfig ( "language" ) ) ) ; } } } closedir ( $ dh ) ; } if ( $ dh = opendir ( $ lang_dir ) ) { while ( ( $ file = readdir ( $ dh ) ) !== false ) { if ( $ file != "." && $ file != ".." && $ file != "CVS" && $ file != "packs" && $ file != "en_us" && $ file != "en_gb" ) { if ( is_dir ( $ lang_dir . "/" . $ file ) ) { $ langs [ ] = array ( "label" => self :: templateXlate ( $ file ) , "value" => $ file , "active" => ( $ file == ReporticoApp :: getConfig ( "language" ) ) ) ; } } } closedir ( $ dh ) ; } } // No languages found at all - default to en_gb if ( count ( $ langs ) == 0 ) { $ langs [ ] = array ( "label" => self :: templateXlate ( "en_gb" ) , "value" => "en_gb" ) ; } return $ langs ; }
Used to generate language selection box
Used to generate language selection box