// set TRUE to get info about each rendered template added into the output HTML $debug_annotate_templates = FALSE; // set TRUE to turn off template caching (good if you are frequently changing templates) $debug_disable_template_caching = FALSE; // set TRUE to show the Subversion version on the bottom of each page, // along with the timing. This requires some XML parsing, so it's // best to leave it off on a live site. $debug_show_svn_version = FALSE; $comments_disabled = FALSE; // --- SITE PERSONALIZATION --- // site name PA::$site_name = "PeopleAggregator"; // default sender email $default_sender = "*****@*****.**"; // --- INTERNATIONALIZATION --- PA::$language = 'english'; // work in progress: try 'japanese' to see the homepage in Japanese. // --- MISC --- // Set enable_network_spawning to FALSE to disable the creation of new // networks, without disabling the network directory or any existing // networks. $_PA->enable_network_spawning = TRUE; // Set enable_networks to FALSE to completely disable networks - don't // allow them to be used at all, and disable spawning and the network // directory. $_PA->enable_networks = TRUE; // Set to TRUE to force all networks to be private, regardless of // their settings. This will mean nobody has access to anything until // they have created an account and logged in. //TODO: To round this feature off, the following things would be useful: // - an option to not auto-join users to the home network (to make the home net truly private).
/** * Load internationalization string files * * */ public function loadLanguageFiles() { $culture_file = getShadowedPath(PA::$config_path . '/i18n.xml'); $culture_data = new XmlConfig($culture_file); if ($culture_data->docLoaded) { PA::$culture_data = $culture_data->asArray(); } else { throw new BootStrapException("Error - Can't load \"{$culture_file}\" culture file.", BootStrapException::UNRECOVERABLE_BOOT_EXCEPTION); } $this->installed_languages = $this->getLanguagesList(); session_start(); if (!empty($this->request_data['lang'])) { if (array_key_exists($this->request_data['lang'], $this->installed_languages)) { $this->current_lang = $this->request_data['lang']; $_SESSION['user_lang'] = $this->current_lang; } } else { if (isset($_SESSION['user_lang'])) { $this->current_lang = $_SESSION['user_lang']; } else { if (PA::$config->pa_installed) { $net_info = get_network_info(); $net_settings = unserialize($net_info->extra); $this->current_lang = isset($net_settings['default_language']) ? $net_settings['default_language'] : 'english'; } } } session_commit(); if ($this->current_lang) { PA::$language = $this->current_lang; } ob_start(); global $TRANSLATED_STRINGS; $strings_file = getShadowedPath("web/languages/" . PA::$language . "/strings.php"); try { if (file_exists($strings_file)) { eval('?>' . (require_once $strings_file)); } $msg_handler = getShadowedPath("web/languages/" . PA::$language . "/MessagesHandler.php"); if (file_exists($msg_handler)) { eval('?>' . (require_once $msg_handler)); } else { eval('?>' . (require_once getShadowedPath("web/languages/english/MessagesHandler.php"))); } } catch (Exception $e) { // Either an invalid language was selected, or one (e.g. English) without a strings.php file. $TRANSLATED_STRINGS = array(); throw new BootStrapException($e->message, 1); } return ob_get_clean(); }