function display($tpl = null) { $configHelper = new JXConfig(); $my = JFactory::getUser(); $defaultLang = JText::_('JXLIB_DEFAULT_LANGUAGE'); $defaultTz = JText::_('JXLIB_DEFAULT_TIMEZONE'); $defaultInvite = JXConfig::DISALLOW; $defaultAnon = JXConfig::ALLOW; // Additional Configuration which are not Joomla! native variables $siteName = $configHelper->get(JXConfig::SITENAME) == '' ? '' : $configHelper->get(JXConfig::SITENAME); $timeZone = $configHelper->getTimezone(); $language = $configHelper->getLanguage(); $allowAnon = $configHelper->get(JXConfig::ALLOW_ANON) == '' ? $defaultAnon : $configHelper->get(JXConfig::ALLOW_ANON); $allowInvite = $configHelper->get(JXConfig::ALLOW_INVITE) == '' ? $defaultInvite : $configHelper->get(JXConfig::ALLOW_INVITE); $limitEmailDomain = $configHelper->get(JXConfig::LIMIT_EMAIL_DOMAIN) == '' ? '' : $configHelper->get(JXConfig::LIMIT_EMAIL_DOMAIN); $domainName = $configHelper->getDomainName(true) == '' ? '' : $configHelper->getDomainName(true); //overwrite value with postParam when save error $error = array(); if ($_POST) { $postParam = JRequest::getVar('params'); $timeZone = isset($postParam['timezone']) ? $postParam['timezone'] : $timeZone; $language = isset($postParam['language']) ? $postParam['language'] : $language; $siteName = isset($postParam['sitename']) ? $postParam['sitename'] : $configHelper->get('sitename'); $allowInvite = isset($postParam['allow_invite']) ? $postParam['allow_invite'] : $allowInvite; $limitEmailDomain = isset($postParam['limit_email_domain']) ? $postParam['limit_email_domain'] : $limitEmailDomain; $domainName = isset($postParam['domain_name']) ? $postParam['domain_name'] : $domainName; } $form = JForm::getInstance('profileForm', JPATH_ROOT . DS . 'components' . DS . 'com_profile' . DS . 'models' . DS . 'forms' . DS . 'edit.xml'); $this->assignRef('profileForm', $form); $this->assignRef('my', $my); $this->assignRef('sitename', $siteName); $this->assignRef('default_timezone', $timeZone); $this->assignRef('default_language', $language); $this->assignRef('domain_name', $domainName); $this->assignRef('limit_email_domain', $limitEmailDomain); $this->assignRef('allow_invite', $allowInvite); $this->assignRef('allow_anon', $allowAnon); $this->assign('domain_editable', $configHelper->allowChangeDomain()); $doc = JFactory::getDocument(); $doc->setTitle(JText::_("COM_ACCOUNT_LABEL_ACCOUNT_SETTING")); parent::display($tpl); }
<?php /** * @category Plugins * @package JomSocial * @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved! * @license GNU/GPL, see LICENSE.php */ // no direct access defined('_JEXEC') or die('Restricted access'); define('FINDER_PATH_INDEXER', JPATH_ROOT . '/components/com_finder/helpers/indexer'); JLoader::register('FinderIndexerHelper', FINDER_PATH_INDEXER . '/helper.php'); JLoader::register('FinderIndexerQuery', FINDER_PATH_INDEXER . '/query.php'); JLoader::register('FinderIndexerResult', FINDER_PATH_INDEXER . '/result.php'); jimport('joomla.plugin.plugin'); jimport('joomla.xfactory'); $lang = JFactory::getLanguage(); $my = JXFactory::getUser(); $config = new JXConfig(); // First load account setting language (if any) to override joomla! language $defLanguage = $config->getLanguage() != '' ? $config->getLanguage() : $lang->get('default'); // Second load user personal language (if any) to override default language $siteLanguage = intval($my->id) > 0 && $my->getParam('language') != '' ? $my->getParam('language') : $defLanguage; $lang->setLanguage($siteLanguage); $result = $lang->load('lib_xjoomla'); /** * Editor Jomsocial Photo Button * * @package Editors-xtd * @since 1.5 */
static function loadLanguage($language = 'default') { // Load language file $lang = JFactory::getLanguage(); $config = new JXConfig(); // First load account setting language (if any) to override joomla! language $defLanguage = $config->getLanguage() != '' ? $config->getLanguage() : $lang->get('default'); /* // Second load user personal language (if any) to override default language $siteLanguage = (intval($user->id) > 0 && $user->getParam('language') != '') ? $user->getParam('language') : $defLanguage; */ $siteLanguage = empty($language) || $language == 'default' ? $defLanguage : $language; $lang->setLanguage($siteLanguage); $result = $lang->load('lib_xjoomla', JPATH_BASE, $siteLanguage, true); }