class user_parseTSConsts { var $cObj; function main($content,$conf){ // Konstanten-Ordner wählen (absoluter Pfad) // wird in der Konfiguration kein Pfad übergeben wird der relative (relativ zur Script-Datei) Pfad '../../../ts/constants/' gewählt $const_root = (($conf['root'] != '') ? $conf['root'] : dirname(__FILE__).'/../../../ts/constants/'); // Leere Variable für die Ausgabe $content = ""; // Wenn das Verzeichnis nicht existiert wird nichts zurückgegeben if (is_dir($const_root)) { if ($const_files = opendir($const_root)) { // Alle Inhalte auslesen while (($curr_file = readdir($const_files)) !== false) { // Nur Dateien beachten if(is_file($const_root.$curr_file)){ // Variablen aus der 'const.base.ts' werden mit der Property 'global' gewrappt // Variablen aus den Sprachdateien werden mit dem entsprechenen Kürzel gewrappt (z.B.: de) if (strcmp($curr_file, 'const.base.ts') == 0) { $content .= "'global':{"; } else { $tmp = explode('.', $curr_file); $content .= "'".$tmp[0]."':{"; } // Leere Variable für die Property $local_lang = ""; // File Zeilenweise auslesen $locale = fopen($const_root.$curr_file, "r"); while (!feof($locale)) { $line = fgets($locale); // Nur wenn die Zeile mit einem Buchstaben beginnt if (preg_match('/^[a-zA-Z].*/',$line)) { // Aufteilein in Name und Wert durch Trennung an '=' $lineArr = explode('=', $line); // Whitespaces trimmen $local_lang .= "'".trim($lineArr[0])."':'".trim($lineArr[1])."',"; } } fclose($locale); // Sofern Werte gefunden wurden den Beistrich am Ende entfernen if (!empty($local_lang)) { $local_lang = substr($local_lang, 0, -1); } // Property eintragen und schliessen $content .= $local_lang.'},'; } } closedir($const_root); // Letzten Beistrich entfernen $content = substr($content, 0, -1); } } return $content; } } ?>
Una vacanza wellness in Alto Adige, nel vostro Hotel Weinegg a 5 stelle, vi promette tutto ciò che state cercando – e anche di più! Tanto spazio per il dolce far niente e il relax, un'esclusiva offerta di saune, piscine e trattamenti di bellezza, una cucina squisita eppure vitale e bilanciata, così come innumerevoli possibilità per il tempo libero e un servizio eccellente.
Concedetevi un assaggio in anteprima della vostra prossima vacanza wellness in Alto Adige. Cominciate subito a sognare!