本文整理汇总了PHP中JPlugin::loadLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP JPlugin::loadLanguage方法的具体用法?PHP JPlugin::loadLanguage怎么用?PHP JPlugin::loadLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPlugin
的用法示例。
在下文中一共展示了JPlugin::loadLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onProfileDisplay
function onProfileDisplay()
{
JPlugin::loadLanguage('plg_community_events', JPATH_ADMINISTRATOR);
$config = CFactory::getConfig();
if (!$config->get('enableevents')) {
return JText::_('PLG_EVENTS_EVENT_DISABLED');
}
$document = JFactory::getDocument();
$mainframe = JFactory::getApplication();
$user = CFactory::getRequestUser();
$caching = $this->params->get('cache', 1);
$model = CFactory::getModel('Events');
$my = CFactory::getUser();
$this->loadUserParams();
//CFactory::load( 'helpers' , 'event' );
$event = JTable::getInstance('Event', 'CTable');
$handler = CEventHelper::getHandler($event);
$events = $model->getEvents(null, $user->id, $this->params->get('sorting', 'latest'), null, true, false, null, null, $handler->getContentTypes(), $handler->getContentId(), $this->userparams->get('count', 5));
if ($this->params->get('hide_empty', 0) && !count($events)) {
return '';
}
if ($caching) {
$caching = $mainframe->getCfg('caching');
}
$creatable = $my->canCreateEvents();
$cache = JFactory::getCache('plgCommunityEvents');
$cache->setCaching($caching);
$callback = array($this, '_getEventsHTML');
$content = $cache->call($callback, true, $events, $user, $config, $model->getEventsCount($user->id), $creatable);
return $content;
}
示例2: onAfterRouter
function onAfterRouter()
{
if ($this->_admin) {
return;
}
JPlugin::loadLanguage('com_content', JPATH_SITE);
}
示例3: onContentPrepare
public function onContentPrepare($context, &$article, &$params, $limitstart)
{
$app = JFactory::getApplication();
/* @var $app JApplication */
// Do not render the buttons in administration area
if ($app->isAdmin()) {
return;
}
$doc = JFactory::getDocument();
/* @var $doc JDocumentHtml */
$docType = $doc->getType();
// Joomla! must render content of this plugin only in HTML document
if (strcmp("html", $docType) != 0) {
return;
}
$currentOption = JRequest::getCmd("option");
if ($currentOption != "com_content" or !isset($article) or empty($article->id) or !isset($this->params)) {
return;
}
JPlugin::loadLanguage('plg_mvsocialbuttons');
$buttons = $this->getButtons($article);
$position = $this->params->get('position');
switch ($position) {
case 1:
$article->text = $buttons . $article->text;
break;
case 2:
$article->text = $article->text . $buttons;
break;
default:
$article->text = $buttons . $article->text . $buttons;
break;
}
return true;
}
示例4: construct
function construct( )
{
$name = "input";
if(empty($this->params)){
$plugin = JPluginHelper::getPlugin('fieldsattachment', $name);
$this->params = new JParameter($plugin->params);
}
//LOAD LANGUAGE --------------------------------------------------------------
$lang =&JFactory::getLanguage();
$lang->load( 'plg_fieldsattachment_'.$name );
$lang = &JFactory::getLanguage(); ;
$lang_file="plg_fieldsattachment_".$name ;
$sitepath1 = JPATH_BASE ;
$sitepath1 = str_replace ("administrator", "", $sitepath1);
$path = $sitepath1."languages".DS . $lang->getTag() .DS.$lang->getTag().".".$lang_file.".php.ini";
if(JFile::exists($path)){
JPlugin::loadLanguage( 'plg_fieldsattachment_'.$name );
}
//-----------------------------------------------------------------------------
//JPlugin::loadLanguage( 'plg_fieldsattachment_input' );
$this->params->set( "name" , $name );
}
示例5: onProfileDisplay
function onProfileDisplay()
{
// Load language
$lang =& JFactory::getLanguage();
JPlugin::loadLanguage('plg_community_plg_rsmembership', JPATH_ADMINISTRATOR);
// Attach CSS
$document =& JFactory::getDocument();
$css = JURI::base() . 'plugins/community/plg_rsmembership/style.css';
$document->addStyleSheet($css);
if (!file_exists($this->_path)) {
$content = '<div class="icon-nopost"><img src="' . JURI::base() . 'components/com_community/assets/error.gif" alt="" /></div>';
$content .= '<div class="content-nopost">' . JText::_('RSM_NOT_INSTALLED') . '</div>';
} else {
require_once $this->_path;
$user =& CFactory::getActiveProfile();
$userName = $user->getDisplayName();
$userId = $user->id;
$memberships = $this->_getMemberships();
$Itemid = $this->getItemid();
$cache =& JFactory::getCache('plgCommunityPlg_RSMembership');
$cache->setCaching($this->params->get('cache', 1));
$callback = array('plgCommunityPlg_RSMembership', '_getRSMembershipHTML');
$content = $cache->call($callback, $userName, $userId, $memberships, $Itemid);
}
return $content;
}
示例6: _getTagText
private function _getTagText($html)
{
JPlugin::loadLanguage('plg_system_pftomsproject', JPATH_ADMINISTRATOR);
$str2 = null;
$r = null;
$p1 = '%<dd class="owner-data">.*?</dd>%si';
$str2 = ' $0
<div class="btn-toolbar btn-toolbar-top">
<div class="btn-group">
<button class="btn export">
<i class="cus-doc-pdf"></i> ' . JText::_('PLG_PFTOMSPROJECT_LABEL_EXPORT') . '
</button>
<button class="btn dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="index.php?option=com_pfprojects&view=projects&action=export&cid="><i class="cus-doc-excel-table"></i> ' . JText::_('PLG_PFTOMSPROJECT_LABEL_MS2013') . '</a>
</li>
</ul>
</div>
</div>';
$r = preg_replace($p1, $str2, $html);
return $r;
}
示例7: onProfileDisplay
function onProfileDisplay()
{
JPlugin::loadLanguage('plg_community_mygoogleads', JPATH_ADMINISTRATOR);
$config = CFactory::getConfig();
$config = CFactory::getConfig();
$this->loadUserParams();
$uri = JURI::base();
$user = CFactory::getRequestUser();
$document = JFactory::getDocument();
$css = $uri . 'plugins/community/mygoogleads/mygoogleads/style.css';
$document->addStyleSheet($css);
$googleCode = $this->userparams->get('googleCode');
$content = '';
if (!empty($googleCode)) {
$mainframe = JFactory::getApplication();
$caching = $this->params->get('cache', 1);
if ($caching) {
$caching = $mainframe->getCfg('caching');
}
$cache = JFactory::getCache('plgCommunityMyGoogleAds');
$cache->setCaching($caching);
$callback = array('plgCommunityMyGoogleAds', '_getGoogleAdsHTML');
$content = $cache->call($callback, $googleCode, $user->id);
} else {
// $content = "<div class=\"icon-nopost\"><img src=\"".JURI::base()."components/com_community/assets/error.gif\" alt=\"\" /></div>";
$content .= "<div class=\"content-nopost\">" . JText::_('PLG_GOOGLE_ADS_NOT_SET') . "</div>";
}
return $content;
}
示例8: onProfileDisplay
function onProfileDisplay()
{
if (!self::kunenaOnline()) {
return;
}
//Load Language file.
JPlugin::loadLanguage('plg_community_mykunena', JPATH_ADMINISTRATOR);
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::base() . 'plugins/community/mykunena/style.css');
$items = array();
$user = CFactory::getRequestUser();
if ($user->id) {
require_once KPATH_SITE . '/funcs/latestx.php';
$obj = new CKunenaLatestX('userposts', 0);
$obj->user = JFactory::getUser($user->id);
$obj->threads_per_page = $this->params->get('count', 5);
$obj->embedded = 1;
$obj->getUserPosts();
$items = $obj->customreply;
}
$caching = $this->params->get('cache', 1);
if ($caching) {
$app = JFactory::getApplication();
$caching = $app->getCfg('caching');
}
$cache = JFactory::getCache('plgCommunityMyKunena');
$cache->setCaching($caching);
$callback = array('plgCommunityMyKunena', '_getMyKunenaHTML');
$content = $cache->call($callback, $user, $items);
return $content;
}
示例9: onProfileDisplay
/**
* Ajax function to save a new wall entry
*
* @param message A message that is submitted by the user
* @param uniqueId The unique id for this group
*
**/
function onProfileDisplay()
{
JPlugin::loadLanguage('plg_community_myvideos', JPATH_ADMINISTRATOR);
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$user = CFactory::getRequestUser();
$userid = $user->id;
$this->loadUserParams();
$def_limit = $this->params->get('count', 10);
$limit = JRequest::getVar('limit', $def_limit, 'REQUEST');
$limitstart = JRequest::getVar('limitstart', 0, 'REQUEST');
$row = $this->getVideos($userid, $limitstart, $limit);
$total = count($row);
if ($this->params->get('hide_empty', 0) && !$total) {
return '';
}
$caching = $this->params->get('cache', 1);
if ($caching) {
$caching = $mainframe->getCfg('caching');
}
$cache = JFactory::getCache('plgCommunityMyVideos');
$cache->setCaching($caching);
$callback = array('plgCommunityMyVideos', '_getLatestVideosHTML');
$count = $this->userparams->get('count', $def_limit);
$dbg = "<!--DEFLIMIT {$def_limit} USERPARAMLIMIT {$count}-->";
$content = $dbg . $cache->call($callback, $userid, $count, $limitstart, $row, $total);
return $content;
}
示例10: onContentPrepare
/**
* Handle onPrepareLocatie
*
*/
public function onContentPrepare($context, $article, $params, $page = 0)
{
// just startup
$replacement = '';
$app = JFactory::getApplication();
// Only render in the HTML format
$document = JFactory::getDocument();
$type = $document->getType();
$html = $type == 'html';
// find all instances of plugin and put in $matches
preg_match_all($this->_regex1, $article->text, $declarations);
// Return if there are no matches
if (!count($declarations[0])) {
return true;
}
JPlugin::loadLanguage('plg_content_googlecalendar', JPATH_ADMINISTRATOR);
// make replacement
$replacement = $this->params->get('code');
if (!$replacement) {
$article->text = preg_replace($this->_regex1, '', $article->text);
return true;
}
//Replace
$article->text = preg_replace($this->_regex1, $replacement, $article->text);
}
示例11: onProfileDisplay
/**
* Ajax function to save a new wall entry
*
* @param message A message that is submitted by the user
* @param uniqueId The unique id for this group
*
* */
function onProfileDisplay()
{
//Load language file.
JPlugin::loadLanguage('plg_community_myarticles', JPATH_ADMINISTRATOR);
// Attach CSS
$document = JFactory::getDocument();
$css = JURI::base() . 'plugins/community/myarticles/myarticles/style.css';
$document->addStyleSheet($css);
if (JRequest::getVar('task', '', 'REQUEST') == 'app') {
$app = 1;
} else {
$app = 0;
}
$user = CFactory::getRequestUser();
$userid = $user->id;
$def_limit = $this->params->get('count', 10);
$limit = JRequest::getVar('limit', $def_limit, 'REQUEST');
$limitstart = JRequest::getVar('limitstart', 0, 'REQUEST');
$row = $this->getArticle($userid, $limitstart, $limit, $this->section);
$cat = $this->getCatAlias();
$total = $this->countArticle($userid, $this->section);
if ($this->params->get('hide_empty', 0) && !$total) {
return '';
}
$mainframe = JFactory::getApplication();
$caching = $this->params->get('cache', 1);
if ($caching) {
$caching = $mainframe->getCfg('caching');
}
$cache = JFactory::getCache('plgCommunityMyArticles');
$cache->setCaching($caching);
$callback = array('plgCommunityMyArticles', '_getArticleHTML');
$content = $cache->call($callback, $userid, $limit, $limitstart, $row, $app, $total, $cat, $this->params);
return $content;
}
示例12: construct
/**
* Constructor
*
* For php4 compatability we must not use the __constructor as a constructor for plugins
* because func_get_args ( void ) returns a copy of all passed arguments NOT references.
* This causes problems with cross-referencing necessary for the observer design pattern.
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.0
*/
function construct()
{
$name = "file";
if (empty($this->params)) {
$plugin = JPluginHelper::getPlugin('fieldsattachment', $name);
$this->params = new JParameter($plugin->params);
}
$this->params->set("name", $name);
//$this->params->set( "path" , '..'.DS.'images'.DS.'documents' );
/* $sitepath = JURI::base() ;
$pos = strrpos($sitepath, "administrator");
if(!empty($pos)){$sitepath = JURI::base().'..'.DS;}*/
$sitepath = fieldsattachHelper::getabsoluteURL();
$this->params->set("path", $sitepath . 'images' . DS . 'documents');
// $this->params->set( "sitepath" , $sitepath );
$this->params->set("documentpath", JPATH_INSTALLATION . DS . '..' . DS . 'images' . DS . 'documents');
//LOAD LANGUAGE --------------------------------------------------------------
$lang =& JFactory::getLanguage();
$lang->load('plg_fieldsattachment_' . $name);
$lang =& JFactory::getLanguage();
$lang_file = "plg_fieldsattachment_" . $name;
$sitepath1 = JPATH_BASE;
$sitepath1 = str_replace("administrator", "", $sitepath1);
$path = $sitepath1 . "languages" . DS . $lang->getTag() . DS . $lang->getTag() . "." . $lang_file . ".php.ini";
if (JFile::exists($path)) {
JPlugin::loadLanguage('plg_fieldsattachment_' . $name);
}
//-----------------------------------------------------------------------------
}
示例13: construct
/**
* Constructor
*
* For php4 compatability we must not use the __constructor as a constructor for plugins
* because func_get_args ( void ) returns a copy of all passed arguments NOT references.
* This causes problems with cross-referencing necessary for the observer design pattern.
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.0
*/
function construct()
{
$name = "image";
$this->name = $name;
/*$sitepath = JURI::base() ;
$pos = strrpos($sitepath, "administrator");
if(!empty($pos)){$sitepath = JURI::base().'..'.DS;}*/
$sitepath = fieldsattachHelper::getabsoluteURL();
$this->path1 = $sitepath . 'images' . DS . 'documents';
$documentpath = fieldsattachHelper::getabsolutePATH();
if (JRequest::getVar('option') == 'com_categories' && JRequest::getVar('layout') == "edit") {
$this->documentpath = $documentpath . DS . 'images' . DS . 'documentscategories';
}
//LOAD LANGUAGE --------------------------------------------------------------
$lang =& JFactory::getLanguage();
$lang->load('plg_fieldsattachment_' . $name);
$lang =& JFactory::getLanguage();
$lang_file = "plg_fieldsattachment_" . $name;
$sitepath1 = JPATH_BASE;
$sitepath1 = str_replace("administrator", "", $sitepath1);
$path = $sitepath1 . "languages" . DS . $lang->getTag() . DS . $lang->getTag() . "." . $lang_file . ".php.ini";
if (JFile::exists($path)) {
JPlugin::loadLanguage('plg_fieldsattachment_' . $name);
}
//-----------------------------------------------------------------------------
}
示例14: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
JPlugin::loadLanguage('com_virtuemart', JPATH_ADMINISTRATOR);
$model = VmModel::getModel('Manufacturer');
$manufacturers = $model->getManufacturers(true, true, false);
return JHTML::_('select.genericlist', $manufacturers, $control_name . '[' . $name . ']', '', $name, 'mf_name', $value, $control_name . $name);
}
示例15: onProfileDisplay
/**
* Ajax function to save a new wall entry
*
* @param message A message that is submitted by the user
* @param uniqueId The unique id for this group
*
**/
function onProfileDisplay()
{
JPlugin::loadLanguage('plg_community_mytaggedvideos', JPATH_ADMINISTRATOR);
$mainframe = JFactory::getApplication();
// Attach CSS
$document = JFactory::getDocument();
// $css = JURI::base() . 'plugins/community/myvideos/style.css';
// $document->addStyleSheet($css);
$user = CFactory::getRequestUser();
$userid = $user->id;
$this->loadUserParams();
$def_limit = $this->params->get('count', 10);
$limit = JRequest::getVar('limit', $def_limit, 'REQUEST');
$limitstart = JRequest::getVar('limitstart', 0, 'REQUEST');
$row = $this->getVideos($userid);
$total = count($row);
if ($this->params->get('hide_empty', 0) && !$total) {
return '';
}
$caching = $this->params->get('cache', 1);
if ($caching) {
$caching = $mainframe->getCfg('caching');
}
$cache = JFactory::getCache('plgCommunityMyTaggedVideos');
$cache->setCaching($caching);
$callback = array('plgCommunityMyTaggedVideos', '_getLatestVideosHTML');
$content = $cache->call($callback, $userid, $this->userparams->get('count', 5), $limitstart, $row, $total);
return $content;
}