本文整理汇总了PHP中KunenaFactory::loadLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaFactory::loadLanguage方法的具体用法?PHP KunenaFactory::loadLanguage怎么用?PHP KunenaFactory::loadLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaFactory
的用法示例。
在下文中一共展示了KunenaFactory::loadLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
/**
* Sets up the fixture.
*/
public static function setUpBeforeClass()
{
$queries[] = "TRUNCATE TABLE #__kunena_categories";
$queries[] = "TRUNCATE TABLE #__kunena_topics";
$queries[] = "TRUNCATE TABLE #__kunena_messages";
$queries[] = "TRUNCATE TABLE #__kunena_messages_text";
$queries[] = "TRUNCATE TABLE #__kunena_users";
$queries[] = "TRUNCATE TABLE #__kunena_users_banned";
$queries[] = "TRUNCATE TABLE #__kunena_user_categories";
$queries[] = "TRUNCATE TABLE #__kunena_user_read";
$queries[] = "TRUNCATE TABLE #__kunena_user_topics";
$queries[] = "TRUNCATE TABLE #__kunena_thankyou";
$queries[] = "TRUNCATE TABLE #__kunena_keywords";
$queries[] = "TRUNCATE TABLE #__kunena_keywords_map";
$queries[] = "TRUNCATE TABLE #__kunena_polls_users";
$queries[] = "TRUNCATE TABLE #__kunena_polls_options";
$queries[] = "TRUNCATE TABLE #__kunena_polls";
$queries[] = "TRUNCATE TABLE #__kunena_sessions";
$db = JFactory::getDBO();
foreach ($queries as $query) {
$db->setQuery($query);
$db->query();
KunenaError::checkDatabaseError();
}
KunenaFactory::loadLanguage();
KunenaFactory::getUser(42)->save();
}
示例2: __construct
public function __construct($params)
{
static $cssadded = false;
require_once KUNENA_PATH_LIB . DS . 'kunena.link.class.php';
require_once KUNENA_PATH_LIB . DS . 'kunena.image.class.php';
require_once KUNENA_PATH_LIB . DS . 'kunena.timeformat.class.php';
require_once KUNENA_PATH_FUNCS . DS . 'latestx.php';
require_once JPATH_ADMINISTRATOR . '/components/com_kunena/libraries/html/parser.php';
$this->kunena_config = KunenaFactory::getConfig();
$this->myprofile = KunenaFactory::getUser();
// load Kunena main language file so we can leverage langaueg strings from it
KunenaFactory::loadLanguage();
// Initialize session
$session = KunenaFactory::getSession();
$session->updateAllowedForums();
$this->document = JFactory::getDocument();
$kloadcss = $params->get('kunena_load_css');
if ($cssadded == false && $kloadcss) {
$this->document->addStyleSheet(JURI::root() . 'modules/mod_kunenalatest/tmpl/css/kunenalatest.css');
$cssadded = true;
}
$this->latestdo = null;
if ($params->get('choosemodel') != 'latest') {
$this->latestdo = $params->get('choosemodel');
}
$this->params = $params;
$this->ktemplate = KunenaFactory::getTemplate();
$this->klistpost = modKunenaLatestHelper::getKunenaLatestList($params);
$this->topic_ordering = modKunenaLatestHelper::getTopicsOrdering($this->myprofile, $this->kunena_config);
require JModuleHelper::getLayoutPath('mod_kunenalatest');
}
示例3: display
public function display() {
static $cssadded = false;
require_once (KUNENA_PATH_LIB . DS . 'kunena.link.class.php');
require_once (KUNENA_PATH_LIB . DS . 'kunena.image.class.php');
require_once (KUNENA_PATH_LIB . DS . 'kunena.timeformat.class.php');
require_once (KUNENA_PATH_FUNCS . DS . 'latestx.php');
require_once (JPATH_ADMINISTRATOR . '/components/com_kunena/libraries/html/parser.php');
$this->kunena_config = KunenaFactory::getConfig ();
$this->myprofile = KunenaFactory::getUser ();
// load Kunena main language file so we can leverage langaueg strings from it
KunenaFactory::loadLanguage();
// Initialize session
$session = KunenaFactory::getSession ();
$session->updateAllowedForums();
$this->latestdo = null;
if ($this->params->get ( 'choosemodel' ) != 'latest') {
$this->latestdo = $this->params->get ( 'choosemodel' );
}
$this->ktemplate = KunenaFactory::getTemplate();
$this->klistpost = modKunenaLatestHelper::getKunenaLatestList ( $this->params );
$this->topic_ordering = modKunenaLatestHelper::getTopicsOrdering($this->myprofile, $this->kunena_config);
require (JModuleHelper::getLayoutPath ( 'mod_kunenalatest' ));
}
示例4: __construct
/**
* @param object $subject
* @param array $config
*/
public function __construct(&$subject, $config)
{
// Do not load if Kunena version is not supported or Kunena is offline
if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('4.0') && KunenaForum::installed()))
{
return;
}
KunenaFactory::loadLanguage('plg_kunena_uddeim.sys', 'admin');
$path = JPATH_SITE . "/components/com_uddeim/uddeim.api.php";
if (!is_file($path))
{
return;
}
include_once($path);
$uddeim = new uddeIMAPI();
if ($uddeim->version() < 1)
{
return;
}
parent::__construct($subject, $config);
$this->loadLanguage('plg_kunena_uddeim.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_kunena_uddeim.sys', KPATH_ADMIN);
}
示例5: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
if (!class_exists('KunenaForum') || !KunenaForum::installed()) {
echo '<a href="index.php?option=com_kunena">PLEASE COMPLETE KUNENA INSTALLATION</a>';
return;
}
KunenaFactory::loadLanguage('com_kunena');
$none = $node->attributes('none');
$options = array();
foreach ($node->children() as $option) {
$options[] = JHTML::_('select.option', $option->attributes('value'), JText::_($option->data()));
}
$ctrl = $control_name . '[' . $name . ']';
$size = $node->attributes('size');
$class = $node->attributes('class');
$attribs = ' ';
if ($size) {
$attribs .= 'size="' . $size . '"';
}
if ($class) {
$attribs .= 'class="' . $class . '"';
} else {
$attribs .= 'class="inputbox"';
}
if ($node->attributes('multiple')) {
$attribs .= ' multiple="multiple"';
$ctrl .= '[]';
}
return JHTML::_('kunenaforum.categorylist', $ctrl, 0, $options, $node->attributes(), $attribs, 'value', 'text', $value);
}
示例6: getInput
/**
* @return string
*/
protected function getInput()
{
if (!class_exists('KunenaForum') || !KunenaForum::installed()) {
echo '<a href="index.php?option=com_kunena">PLEASE COMPLETE KUNENA INSTALLATION</a>';
return '';
}
KunenaFactory::loadLanguage('com_kunena');
$size = $this->element['size'];
$class = $this->element['class'];
$attribs = ' ';
if ($size) {
$attribs .= 'size="' . $size . '"';
}
if ($class) {
$attribs .= 'class="' . $class . '"';
} else {
$attribs .= 'class="inputbox"';
}
if (!empty($this->element['multiple'])) {
$attribs .= ' multiple="multiple"';
}
// Get the field options.
$options = $this->getOptions();
return JHtml::_('kunenaforum.categorylist', $this->name, 0, $options, $this->element, $attribs, 'value', 'text', $this->value);
}
示例7: loadLanguage
/**
* Logic to load language strings for the template.
*
* By default language files are also loaded from the parent templates.
*
* @return void
*/
public function loadLanguage()
{
$lang = JFactory::getLanguage();
KunenaFactory::loadLanguage('com_kunena.templates', 'site');
foreach (array_reverse($this->default) as $template) {
$file = "kunena_tmpl_{$template}";
$lang->load($file, JPATH_SITE) || $lang->load($file, KPATH_SITE) || $lang->load($file, KPATH_SITE . "/template/{$template}");
}
}
示例8: loadLanguage
public function loadLanguage()
{
// Loading language strings for the template
$lang = JFactory::getLanguage();
KunenaFactory::loadLanguage('com_kunena.templates', 'site');
foreach (array_reverse($this->default) as $template) {
$file = 'kunena_tmpl_' . $template;
$lang->load($file, JPATH_SITE) || $lang->load($file, KPATH_SITE) || $lang->load($file, KPATH_SITE . '/template/' . $template);
}
}
示例9: exists
/**
* Determines if Kunena is installed on the site.
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function exists()
{
$file = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
if (!JFile::exists($file)) {
return false;
}
// Load Kunena's api file
require_once $file;
// Load Kunena's language
KunenaFactory::loadLanguage('com_kunena.libraries', 'admin');
return true;
}
示例10: before
/**
* Prepare AJAX display.
*
* @return void
*/
protected function before()
{
// Load language files.
KunenaFactory::loadLanguage('com_kunena.sys', 'admin');
KunenaFactory::loadLanguage('com_kunena.templates');
KunenaFactory::loadLanguage('com_kunena.models');
KunenaFactory::loadLanguage('com_kunena.views');
$this->me = KunenaUserHelper::getMyself();
$this->config = KunenaConfig::getInstance();
$this->document = JFactory::getDocument();
$this->template = KunenaFactory::getTemplate();
$this->template->initialize();
}
示例11: initialize
public function initialize()
{
KunenaFactory::loadLanguage('com_kunena.tpl_blue_eagle');
// Enable legacy mode
KunenaTemplateLegacy::load();
require_once JPATH_SITE . '/' . $this->getFile('initialize.php');
$this->addStyleSheet('css/kunena.20.css');
// Toggler language strings
JFactory::getDocument()->addScriptDeclaration('// <![CDATA[
var kunena_toggler_close = "' . JText::_('COM_KUNENA_TOGGLER_COLLAPSE', true) . '";
var kunena_toggler_open = "' . JText::_('COM_KUNENA_TOGGLER_EXPAND', true) . '";
// ]]>');
}
示例12: onGetIcons
/**
* Display Kunena backend icon in Joomla 2.5+
*
* @param string $context
*/
public function onGetIcons($context)
{
if (!$context == 'mod_quickicon' || !JFactory::getUser()->authorise('core.manage', 'com_kunena')) {
return;
}
KunenaFactory::loadLanguage('com_kunena.sys', 'admin');
if (KunenaForum::installed() && KunenaFactory::getConfig()->version_check && JFactory::getUser()->authorise('core.manage', 'com_installer')) {
$db = JFactory::getDbo();
$query = $db->getQuery(true)->select($db->qn('params'))->from($db->qn('#__extensions'))->where($db->qn('type') . ' = ' . $db->q('component'))->where($db->qn('element') . ' = ' . $db->q('com_kunena'));
$db->setQuery($query);
$cparams = new JRegistry((string) $db->loadResult());
//$cparams = JComponentHelper::getParams('com_kunena');
$liveupdate = new JRegistry($cparams->get('liveupdate', null));
$lastCheck = $liveupdate->get('lastcheck', 0);
$updateInfo = json_decode(trim((string) $liveupdate->get('updatedata', ''), '"'));
$valid = abs(time() - $lastCheck) <= 24 * 3600;
// 24 hours
if (!$valid) {
// If information is not valid, update it asynchronously.
$ajax_url = JURI::base() . 'index.php?option=com_kunena&view=liveupdate&task=ajax';
$script = "window.addEvent('domready', function() {\n\tvar com_kunena_updatecheck_ajax_structure = {\n\t\tonSuccess: function(msg, responseXML) {\n\t\t\tvar updateInfo = JSON.decode(msg, true);\n\t\t\tif (updateInfo.html) {\n\t\t\t\tdocument.id('com_kunena_icon').getElement('img').setProperty('src',updateInfo.img);\n\t\t\t\tdocument.id('com_kunena_icon').getElement('span').set('html', updateInfo.html);\n\t\t\t\tdocument.id('com_kunena_icon').getElement('a').set('href', updateInfo.link);\n\t\t\t}\n\t\t},\n\t\turl: '{$ajax_url}'\n\t};\n\tajax_object = new Request(com_kunena_updatecheck_ajax_structure);\n\tajax_object.send();\n});";
$document = JFactory::getDocument();
$document->addScriptDeclaration($script);
}
}
$link = 'index.php?option=com_kunena';
if (!KunenaForum::installed()) {
// Not fully installed
$img = 'kunena/icons/icon-48-kupdate-alert-white.png';
$text = JText::_('PLG_QUICKICON_KUNENA_COMPLETE_INSTALLATION');
} elseif (empty($updateInfo->supported)) {
// Unsupported
$img = 'kunena/icons/kunena-logo-48-white.png';
$text = JText::_('COM_KUNENA');
} elseif ($updateInfo->stuck) {
// Stuck
$img = 'kunena/icons/icon-48-kupdate-alert-white.png';
$text = JText::_('COM_KUNENA') . '<br />' . JText::_('PLG_QUICKICON_KUNENA_UPDATE_CRASH');
} elseif (version_compare(KunenaForum::version(), $updateInfo->version, '<')) {
// Has updates
$img = 'kunena/icons/icon-48-kupdate-update-white.png';
$text = 'Kunena ' . $updateInfo->version . '<br />' . JText::_('PLG_QUICKICON_KUNENA_UPDATE_AVAILABLE');
$link .= '&view=liveupdate';
} else {
// Already in the latest release
$img = 'kunena/icons/icon-48-kupdate-good-white.png';
$text = JText::_('COM_KUNENA');
}
return array(array('link' => JRoute::_($link), 'image' => $img, 'text' => $text, 'access' => array('core.manage', 'com_kunena'), 'id' => 'com_kunena_icon'));
}
示例13: display
function display()
{
KunenaForum::setup();
KunenaFactory::loadLanguage();
KunenaFactory::loadLanguage('com_kunena.templates');
$this->params->def('greeting', 1);
$this->document = JFactory::getDocument();
$this->me = KunenaFactory::getUser();
$token = JUtility::getToken();
// Load CSS only once
if (self::$cssadded == false) {
$this->document->addStyleSheet(JURI::root(true) . '/modules/mod_kunenalogin/tmpl/css/kunenalogin.css');
self::$cssadded = true;
}
$cache = JFactory::getCache('com_kunena', 'output');
if ($cache->start("{$this->me->userid}.{$token}", 'mod_kunenalogin')) {
return;
}
$login = KunenaLogin::getInstance();
if (!$this->me->exists()) {
$this->type = 'login';
$this->login = null;
if ($login) {
$this->lostPasswordUrl = $login->getResetURL();
$this->lostUsernameUrl = $login->getRemindURL();
$this->registerUrl = $login->getRegistrationURL();
$this->remember = JPluginHelper::isEnabled('system', 'remember');
}
} else {
$this->type = 'logout';
$this->logout = null;
$this->lastvisitDate = new KunenaDate($this->me->lastvisitDate);
if ($login) {
$this->logout = $login->getLogoutURL();
$this->recentPosts = JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=topics', JText::_('MOD_KUNENALOGIN_RECENT'));
$this->myPosts = JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=topics&layout=user&mode=default', JText::_('MOD_KUNENALOGIN_MYPOSTS'));
}
// Private messages
$private = KunenaFactory::getPrivateMessaging();
$this->privateMessages = '';
if ($this->params->get('showmessage') && $private) {
$count = $private->getUnreadCount($this->me->userid);
$this->privateMessages = $private->getInboxLink($count ? JText::sprintf('COM_KUNENA_PMS_INBOX_NEW', $count) : JText::_('COM_KUNENA_PMS_INBOX'));
}
}
$this->return = $this->getReturnURL();
require JModuleHelper::getLayoutPath('mod_kunenalogin');
$cache->end();
}
示例14: exists
/**
* Determines if Kunena is installed on the site.
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function exists()
{
$file = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
if (!JFile::exists($file)) {
return false;
}
// Load Kunena's api file
require_once $file;
// Load Kunena's js file
$doc = JFactory::getDocument();
$doc->addScript(rtrim(JURI::root(), '/') . '/media/kunena/js/default.js');
// Load Kunena's language
KunenaFactory::loadLanguage('com_kunena.libraries', 'admin');
return true;
}
示例15: display
public function display($userId = null, $docType = null)
{
if (!KunenaHelper::exists()) {
return;
}
// Load language file from Kunena
KunenaFactory::loadLanguage('com_kunena.libraries', 'admin');
// Load Kunena's language file
JFactory::getLanguage()->load('com_kunena.libraries', JPATH_ADMINISTRATOR);
// Get the current user
$user = FD::user($userId);
// Get the user params
$params = $this->getUserParams($user->id);
// Get the app params
$appParams = $this->app->getParams();
// Get the total items to display
$total = (int) $params->get('total', $appParams->get('total', 5));
// Get the posts created by the user.
$model = $this->getModel('Posts');
$posts = $model->getPosts($user->id, $total);
// Get the replies
$replies = $model->getReplies($user->id);
// Get stats
$stats = $model->getStats($user->id);
// Get total replies
$totalReplies = $model->getTotalReplies($user->id);
// Get Kunena's template
$kTemplate = KunenaFactory::getTemplate();
$kUser = KunenaUserHelper::get($userId);
$this->set('totalReplies', $totalReplies);
$this->set('stats', $stats);
$this->set('thanks', $kUser->thankyou);
$this->set('totalPosts', $kUser->posts);
$this->set('kTemplate', $kTemplate);
$this->set('user', $user);
$this->set('params', $params);
$this->set('posts', $posts);
$this->set('replies', $replies);
echo parent::display('profile/default');
}