本文整理汇总了PHP中nnFrameworkFunctions::loadLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP nnFrameworkFunctions::loadLanguage方法的具体用法?PHP nnFrameworkFunctions::loadLanguage怎么用?PHP nnFrameworkFunctions::loadLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nnFrameworkFunctions
的用法示例。
在下文中一共展示了nnFrameworkFunctions::loadLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clean
function clean()
{
if (!($type = $this->getCleanType())) {
return;
}
// Load language for messaging
nnFrameworkFunctions::loadLanguage('mod_cachecleaner');
$this->purgeCache($type);
$error = $this->helpers->getParams()->error;
if ($error) {
$message = JText::_('CC_NOT_ALL_CACHE_COULD_BE_REMOVED');
$message .= $this->helpers->getParams()->error !== true ? '<br />' . $this->helpers->getParams()->error : '';
} else {
$message = $this->helpers->getParams()->message ?: JText::_('CC_CACHE_CLEANED');
if ($this->params->show_size && $this->helpers->getParams()->size) {
$message .= ' (' . $this->helpers->get('cache')->getSize() . ')';
}
}
if (JFactory::getApplication()->input->getInt('break')) {
echo (!$error ? '+' : '') . str_replace('<br />', ' - ', $message);
die;
}
if ($this->show_message && $message) {
JFactory::getApplication()->enqueueMessage($message, $error ? 'error' : 'message');
}
}
示例2: render
function render(&$params)
{
jimport('joomla.filesystem.file');
// Load plugin language
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_system_nnframework');
nnFrameworkFunctions::loadLanguage('plg_editors-xtd_sourcerer');
nnFrameworkFunctions::loadLanguage('plg_system_sourcerer');
$language = 'en';
$locales = JFactory::getLanguage()->getLocale();
foreach ($locales as $locale) {
if (JFile::exists(JPATH_PLUGINS . '/editors-xtd/sourcerer/editarea/langs/' . $locale . '.js')) {
$language = $locale;
break;
}
}
// Add scripts and styles
JHtml::_('behavior.mootools');
JFactory::getDocument()->addScript(JURI::root(true) . '/plugins/editors-xtd/sourcerer/editarea/edit_area_full.js');
JHtml::script('sourcerer/script.min.js', false, true);
$script = "\n\t\t\teditAreaLoader.init({\n\t\t\t\tid: 'source',\t// id of the textarea to transform\n\t\t\t\tstart_highlight: true,\t// if start with highlight\n\t\t\t\tallow_resize: 'y',\n\t\t\t\tallow_toggle: false,\n\t\t\t\tword_wrap: true,\n\t\t\t\tlanguage: '" . $language . "',\n\t\t\t\tsyntax: 'php',\n\t\t\t\ttoolbar: 'fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, highlight, reset_highlight, word_wrap',\n\t\t\t\tsyntax_selection_allow: 'css,html,js,php'\n\t\t\t});\n\n\t\t\tvar sourcerer_syntax_word = '" . $params->syntax_word . "';\n\t\t\tvar sourcerer_editorname = '" . JFactory::getApplication()->input->getString('name', 'text') . "';\n\t\t\tvar sourcerer_default_addsourcetags = " . (int) $params->addsourcetags . ";\n\t\t\tvar sourcerer_root = '" . JURI::root(true) . "';\n\n\t\t\twindow.addEvent( 'domready', function() { sourcerer_init(); });\n\t\t";
JFactory::getDocument()->addScriptDeclaration($script);
JHtml::stylesheet('nnframework/style.min.css', false, true);
JHtml::stylesheet('nnframework/popup.min.css', false, true);
JHtml::stylesheet('sourcerer/popup.min.css', false, true);
$params->code = '<!-- You can place html anywhere within the source tags --><br /><br /><br /><script language="javascript" type="text/javascript"><br /> // You can place JavaScript like this<br /> <br /></script><br /><?php<br /> // You can place PHP like this<br /> <br />?>';
$params->code = str_replace('<br />', "\n", $params->code);
echo $this->getHTML($params);
}
示例3: render
/**
* Display the button
*
* @return array A two element array of ( imageName, textToInsert )
*/
function render($name)
{
$button = new JObject();
if (JFactory::getApplication()->isSite() && !$this->params->enable_frontend) {
return $button;
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_editors-xtd_articlesanywhere');
JHtml::_('behavior.modal');
JHtml::stylesheet('nnframework/style.min.css', false, true);
$class = 'nonumber icon-articlesanywhere';
$link = 'index.php?nn_qp=1' . '&folder=plugins.editors-xtd.articlesanywhere' . '&file=articlesanywhere.inc.php' . '&name=' . $name;
$text_ini = strtoupper(str_replace(' ', '_', $this->params->button_text));
$text = JText::_($text_ini);
if ($text == $text_ini) {
$text = JText::_($this->params->button_text);
}
$button->modal = true;
$button->class = 'btn';
$button->link = $link;
$button->text = trim($text);
$button->name = $class;
$button->options = "{handler: 'iframe', size: {x:window.getSize().x-100, y: window.getSize().y-100}}";
return $button;
}
示例4: onAfterRoute
public function onAfterRoute()
{
$this->_pass = 0;
jimport('joomla.filesystem.file');
if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) {
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
// return if page should be protected
if (nnProtect::isProtectedPage('', 1)) {
return;
}
}
// load the admin language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_' . $this->_type . '_' . $this->_name);
// return if NoNumber Framework plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
if (JFactory::getApplication()->isAdmin() && JFactory::getApplication()->input->get('option') != 'com_login') {
$msg = JText::_('SRC_NONUMBER_FRAMEWORK_NOT_INSTALLED') . ' ' . JText::sprintf('SRC_EXTENSION_CAN_NOT_FUNCTION', JText::_('SOURCERER'));
$mq = JFactory::getApplication()->getMessageQueue();
foreach ($mq as $m) {
if ($m['message'] == $msg) {
$msg = '';
break;
}
}
if ($msg) {
JFactory::getApplication()->enqueueMessage($msg, 'error');
}
}
return;
}
if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) {
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
// return if current page is an admin page
if (nnProtect::isAdmin()) {
return;
}
} else {
if (JFactory::getApplication()->isAdmin()) {
return;
}
}
// load the site language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_' . $this->_type . '_' . $this->_name, JPATH_SITE);
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams($this->_name);
// Include the Helper
require_once JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/helper.php';
$class = get_class($this) . 'Helper';
$this->_helper = new $class($params);
$this->_pass = 1;
}
示例5: replaceLinksInCoreModuleManager
private function replaceLinksInCoreModuleManager()
{
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('com_advancedmodules');
$body = JResponse::getBody();
$url = 'index.php?option=com_advancedmodules';
if (JFactory::getApplication()->input->get('view') == 'module') {
$url .= '&task=module.edit&id=' . (int) JFactory::getApplication()->input->get('id');
}
$link = '<a style="float:right;" href="' . JRoute::_($url) . '">' . JText::_('AMM_SWITCH_TO_ADVANCED_MODULE_MANAGER') . '</a><div style="clear:both;"></div>';
$body = preg_replace('#(</script>\\s*)(<form)#', '\\1' . $link . '\\2', $body);
$body = preg_replace('#(</form>\\s*)((<\\!--.*?-->\\s*)*</div>)#', '\\1' . $link . '\\2', $body);
JResponse::setBody($body);
}
示例6: render
function render()
{
if (!isset($this->params->display_link)) {
return;
}
// load the admin language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('mod_cachecleaner');
JHtml::stylesheet('nnframework/style.min.css', false, true);
JFactory::getDocument()->addScriptVersion(JURI::root(true) . '/media/nnframework/js/script.min.js');
$script = "\n\t\t\tvar cachecleaner_base = '" . JURI::base(true) . "';\n\t\t\tvar cachecleaner_root = '" . JURI::root() . "';\n\t\t\tvar cachecleaner_msg_clean = '" . addslashes(html_entity_decode(JText::_('CC_CLEANING_CACHE'))) . "';\n\t\t\tvar cachecleaner_msg_inactive = '" . addslashes(html_entity_decode(JText::_('CC_SYSTEM_PLUGIN_NOT_ENABLED'))) . "';\n\t\t\tvar cachecleaner_msg_failure = '" . addslashes(html_entity_decode(JText::_('CC_CACHE_COULD_NOT_BE_CLEANED'))) . "';";
JFactory::getDocument()->addScriptDeclaration($script);
JHtml::stylesheet('cachecleaner/style.min.css', false, true);
JHtml::script('cachecleaner/script.min.js', false, true);
$text_ini = strtoupper(str_replace(' ', '_', $this->params->icon_text));
$text = JText::_($text_ini);
if ($text == $text_ini) {
$text = JText::_($this->params->icon_text);
}
if ($this->params->display_toolbar_button) {
// Generate html for toolbar button
$html = array();
$html[] = '<a href="javascript://" onclick="return false;" class="btn btn-small cachecleaner_link">';
$html[] = '<span class="icon-nonumber icon-cachecleaner"></span> ';
$html[] = $text;
$html[] = '</a>';
$toolbar = JToolBar::getInstance('toolbar');
$toolbar->appendButton('Custom', implode('', $html));
}
// Generate html for status link
$html = array();
$html[] = '<div class="btn-group cachecleaner">';
$html[] = '<a href="javascript://" onclick="return false;" class="cachecleaner_link">';
if ($this->params->display_link != 'text') {
$html[] = '<span class="icon-nonumber icon-cachecleaner"></span> ';
}
if ($this->params->display_link != 'icon') {
$html[] = $text;
}
$html[] = '</a>';
$html[] = '</div>';
echo implode('', $html);
}
示例7: render
function render(&$params)
{
jimport('joomla.filesystem.file');
// Load plugin language
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_system_nnframework');
nnFrameworkFunctions::loadLanguage('plg_editors-xtd_sourcerer');
nnFrameworkFunctions::loadLanguage('plg_system_sourcerer');
JHtml::stylesheet('nnframework/style.min.css', false, true);
nnFrameworkFunctions::addScriptVersion(JURI::root(true) . '/media/nnframework/js/script.min.js');
JFactory::getDocument()->addStyleSheet('//code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css');
JFactory::getDocument()->addScript('//code.jquery.com/ui/1.9.2/jquery-ui.js');
$script = "\n\t\t\tvar sourcerer_syntax_word = '" . $params->syntax_word . "';\n\t\t\tvar sourcerer_editorname = '" . JFactory::getApplication()->input->getString('name', 'text') . "';\n\t\t\tvar sourcerer_default_addsourcetags = " . (int) $params->addsourcetags . ";\n\t\t\tvar sourcerer_root = '" . JURI::root(true) . "';\n\t\t";
JFactory::getDocument()->addScriptDeclaration($script);
JHtml::stylesheet('sourcerer/popup.min.css', false, true);
JHtml::script('sourcerer/script.min.js', false, true);
$params->code = '<!-- You can place html anywhere within the source tags --><br /><br /><br /><script language="javascript" type="text/javascript"><br /> // You can place JavaScript like this<br /> <br /></script><br /><?php<br /> // You can place PHP like this<br /> <br />?>';
$params->code = str_replace('<br />', "\n", $params->code);
echo $this->getHTML($params);
}
示例8: onDisplay
/**
* Display the button
*
* @return array A two element array of ( imageName, textToInsert )
*/
function onDisplay($name)
{
jimport('joomla.filesystem.file');
// return if system plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . '/system/' . $this->_name . '/' . $this->_name . '.php')) {
return;
}
// return if NoNumber Framework plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
return;
}
// load the admin language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_' . $this->_type . '_' . $this->_name);
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams($this->_name);
// Include the Helper
require_once JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/helper.php';
$class = get_class($this) . 'Helper';
$helper = new $class($params);
return $helper->render($name);
}
示例9: defined
/**
* Plugin Helper File
*
* @package Modules Anywhere
* @version 3.6.4
*
* @author Peter van Westen <peter@nonumber.nl>
* @link http://www.nonumber.nl
* @copyright Copyright © 2015 NoNumber All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
require_once JPATH_PLUGINS . '/system/nnframework/helpers/text.php';
nnFrameworkFunctions::loadLanguage('plg_system_modulesanywhere');
/**
* Plugin that places modules
*/
class plgSystemModulesAnywhereHelper
{
public function __construct(&$params)
{
$this->option = JFactory::getApplication()->input->get('option');
$this->params = $params;
$this->params->comment_start = '<!-- START: Modules Anywhere -->';
$this->params->comment_end = '<!-- END: Modules Anywhere -->';
$this->params->message_start = '<!-- Modules Anywhere Message: ';
$this->params->message_end = ' -->';
$this->params->protect_start = '<!-- START: MA_PROTECT -->';
$this->params->protect_end = '<!-- END: MA_PROTECT -->';
示例10: defined
* Plugin Helper File
*
* @package Sourcerer
* @version 4.4.9
*
* @author Peter van Westen <peter@nonumber.nl>
* @link http://www.nonumber.nl
* @copyright Copyright © 2015 NoNumber All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php';
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
require_once JPATH_PLUGINS . '/system/nnframework/helpers/text.php';
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
nnFrameworkFunctions::loadLanguage('plg_system_sourcerer');
/**
* Plugin that replaces Sourcerer code with its HTML / CSS / JavaScript / PHP equivalent
*/
class plgSystemSourcererHelper
{
public function __construct(&$params)
{
$this->option = JFactory::getApplication()->input->get('option');
// Set plugin parameters
$this->src_params = new stdClass();
$this->src_params->syntax_word = $params->syntax_word;
// Matches the start and end tags with everything in between
// Also matches any surrounding breaks and paragraph tags, to prevent unwanted empty lines in output.
$breaks_start = '((?:<p(?: [^>]*)?>\\s*)?)((?:<span [^>]*>\\s*)*)';
$breaks_end = '((?:\\s*</span>)*)((?:\\s*</p>)?)';
示例11: defined
/**
* Main Plugin File
*
* @package NoNumber Framework
* @version 15.4.3
*
* @author Peter van Westen <peter@nonumber.nl>
* @link http://www.nonumber.nl
* @copyright Copyright © 2015 NoNumber All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
if (JFactory::getApplication()->isAdmin()) {
// load the NoNumber Framework language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_system_nnframework');
}
jimport('joomla.filesystem.file');
// If controller.php exists, assume this is K2 v3
define('NN_K2_VERSION', JFile::exists(JPATH_ADMINISTRATOR . '/components/com_k2/controller.php') ? 3 : 2);
/**
* Plugin that loads Framework
*/
class plgSystemNNFramework extends JPlugin
{
public function onAfterRoute()
{
$this->updateDownloadKey();
$this->loadSearchHelper();
if (!JFactory::getApplication()->input->getInt('nn_qp', 0)) {
return;
示例12: render
function render(&$params)
{
$app = JFactory::getApplication();
// load the admin language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_system_nnframework');
nnFrameworkFunctions::loadLanguage('plg_editors-xtd_articlesanywhere');
nnFrameworkFunctions::loadLanguage('plg_system_articlesanywhere');
nnFrameworkFunctions::loadLanguage('com_content');
JHtml::stylesheet('nnframework/style.min.css', false, true);
require_once JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php';
$content_type = 'core';
$k2 = 0;
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$filter = null;
// Get some variables from the request
$option = 'articlesanywhere';
$filter_order = $app->getUserStateFromRequest($option . '_filter_order', 'filter_order', 'ordering', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest($option . '_filter_order_Dir', 'filter_order_Dir', '', 'word');
$filter_featured = $app->getUserStateFromRequest($option . '_filter_featured', 'filter_featured', '', 'int');
$filter_category = $app->getUserStateFromRequest($option . '_filter_category', 'filter_category', 0, 'int');
$filter_author = $app->getUserStateFromRequest($option . '_filter_author', 'filter_author', 0, 'int');
$filter_state = $app->getUserStateFromRequest($option . '_filter_state', 'filter_state', '', 'word');
$filter_search = $app->getUserStateFromRequest($option . '_filter_search', 'filter_search', '', 'string');
$filter_search = JString::strtolower($filter_search);
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
$limitstart = $app->getUserStateFromRequest($option . '_limitstart', 'limitstart', 0, 'int');
// In case limit has been changed, adjust limitstart accordingly
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$lists = array();
// filter_search filter
$lists['filter_search'] = $filter_search;
// table ordering
if ($filter_order == 'featured') {
$filter_order = 'ordering';
$filter_order_Dir = '';
}
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
$options = JHtml::_('category.options', 'com_content');
array_unshift($options, JHtml::_('select.option', '0', JText::_('JOPTION_SELECT_CATEGORY')));
$lists['categories'] = JHtml::_('select.genericlist', $options, 'filter_category', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $filter_category);
//$lists['categories'] = JHtml::_( 'select.genericlist', $categories, 'filter_category', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $filter_category );
// get list of Authors for dropdown filter
$query->clear()->select('c.created_by, u.name')->from('#__content AS c')->join('LEFT', '#__users AS u ON u.id = c.created_by')->where('c.state != -1')->where('c.state != -2')->group('u.id')->order('u.id DESC');
$db->setQuery($query);
$options = $db->loadObjectList();
array_unshift($options, JHtml::_('select.option', '0', JText::_('JOPTION_SELECT_AUTHOR'), 'created_by', 'name'));
$lists['authors'] = JHtml::_('select.genericlist', $options, 'filter_author', 'class="inputbox" size="1" onchange="this.form.submit( );"', 'created_by', 'name', $filter_author);
// state filter
$lists['state'] = JHtml::_('grid.state', $filter_state, 'JPUBLISHED', 'JUNPUBLISHED', 'JARCHIVED');
/* ITEMS */
$where = array();
$where[] = 'c.state != -2';
/*
* Add the filter specific information to the where clause
*/
// Category filter
if ($filter_category > 0) {
$where[] = 'c.catid = ' . (int) $filter_category;
}
// Author filter
if ($filter_author > 0) {
$where[] = 'c.created_by = ' . (int) $filter_author;
}
// Content state filter
if ($filter_state) {
if ($filter_state == 'P') {
$where[] = 'c.state = 1';
} else {
if ($filter_state == 'U') {
$where[] = 'c.state = 0';
} else {
if ($filter_state == 'A') {
$where[] = 'c.state = -1';
} else {
$where[] = 'c.state != -2';
}
}
}
}
// Keyword filter
if ($filter_search) {
if (stripos($filter_search, 'id:') === 0) {
$where[] = 'c.id = ' . (int) substr($filter_search, 3);
} else {
$cols = array('id', 'title', 'introtext', 'fulltext');
$w = array();
foreach ($cols as $col) {
$w[] = 'LOWER(c.' . $col . ') LIKE ' . $db->quote('%' . $db->escape($filter_search, true) . '%', false);
}
$where[] = '(' . implode(' OR ', $w) . ')';
}
}
// Build the where clause of the content record query
$where = implode(' AND ', $where);
// Get the total number of records
$query->clear()->select('COUNT(*)')->from('#__content AS c')->join('LEFT', '#__categories AS cc ON cc.id = c.catid')->where($where);
$db->setQuery($query);
//.........这里部分代码省略.........
示例13: render
function render(&$params)
{
$app = JFactory::getApplication();
// load the admin language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_system_nnframework');
nnFrameworkFunctions::loadLanguage('plg_editors-xtd_modulesanywhere');
nnFrameworkFunctions::loadLanguage('plg_system_modulesanywhere');
nnFrameworkFunctions::loadLanguage('com_modules');
JHtml::stylesheet('nnframework/style.min.css', false, true);
// Initialize some variables
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$option = 'modulesanywhere';
$filter_order = $app->getUserStateFromRequest($option . 'filter_order', 'filter_order', 'm.position', 'string');
$filter_order_Dir = $app->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', '', 'string');
$filter_state = $app->getUserStateFromRequest($option . 'filter_state', 'filter_state', '', 'string');
$filter_position = $app->getUserStateFromRequest($option . 'filter_position', 'filter_position', '', 'string');
$filter_type = $app->getUserStateFromRequest($option . 'filter_type', 'filter_type', '', 'string');
$filter_search = $app->getUserStateFromRequest($option . 'filter_search', 'filter_search', '', 'string');
$filter_search = JString::strtolower($filter_search);
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
$limitstart = $app->getUserStateFromRequest('modulesanywhere_limitstart', 'limitstart', 0, 'int');
$where[] = 'm.client_id = 0';
// used by filter
if ($filter_position) {
if ($filter_position == 'none') {
$where[] = 'm.position = ""';
} else {
$where[] = 'm.position = ' . $db->quote($filter_position);
}
}
if ($filter_type) {
$where[] = 'm.module = ' . $db->quote($filter_type);
}
if ($filter_search) {
$where[] = 'LOWER( m.title ) LIKE ' . $db->quote('%' . $db->escape($filter_search, true) . '%', false);
}
if ($filter_state != '') {
$where[] = 'm.published = ' . $filter_state;
}
$where = implode(' AND ', $where);
if ($filter_order == 'm.ordering') {
$orderby = 'm.position, m.ordering ' . $filter_order_Dir;
} else {
$orderby = $filter_order . ' ' . $filter_order_Dir . ', m.ordering ASC';
}
// get the total number of records
$query->clear()->select('COUNT(DISTINCT m.id)')->from('#__modules AS m')->join('LEFT', '#__users AS u ON u.id = m.checked_out')->join('LEFT', '#__viewlevels AS g ON g.id = m.access')->join('LEFT', '#__modules_menu AS mm ON mm.moduleid = m.id')->where($where);
$db->setQuery($query);
$total = $db->loadResult();
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit);
$query->clear()->select('m.*, u.name AS editor, g.title AS groupname, MIN( mm.menuid ) AS pages')->from('#__modules AS m')->join('LEFT', '#__users AS u ON u.id = m.checked_out')->join('LEFT', '#__viewlevels AS g ON g.id = m.access')->join('LEFT', '#__modules_menu AS mm ON mm.moduleid = m.id')->where($where)->group('m.id')->order($orderby);
$db->setQuery($query, $pageNav->limitstart, $pageNav->limit);
$rows = $db->loadObjectList();
if ($db->getErrorNum()) {
echo $db->stderr();
return false;
}
// get list of Positions for dropdown filter
$query->clear()->select('m.position AS value, m.position AS text')->from('#__modules as m')->where('m.client_id = 0')->where('m.position != ""')->group('m.position')->order('m.position');
$db->setQuery($query);
$positions = $db->loadObjectList();
array_unshift($positions, $options[] = JHtml::_('select.option', 'none', ':: ' . JText::_('JNONE') . ' ::'));
array_unshift($positions, JHtml::_('select.option', '', JText::_('COM_MODULES_OPTION_SELECT_POSITION')));
$lists['position'] = JHtml::_('select.genericlist', $positions, 'filter_position', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', $filter_position);
// get list of Types for dropdown filter
$query->clear()->select('e.element AS value, e.name AS text')->from('#__extensions as e')->where('e.client_id = 0')->where('type = ' . $db->quote('module'))->join('LEFT', '#__modules as m ON m.module = e.element AND m.client_id = e.client_id')->where('m.module IS NOT NULL')->group('e.element, e.name');
$db->setQuery($query);
$types = $db->loadObjectList();
foreach ($types as $i => $type) {
$extension = $type->value;
$source = JPATH_SITE . '/modules/' . $extension;
nnFrameworkFunctions::loadLanguage($extension . '.sys', JPATH_SITE) || nnFrameworkFunctions::loadLanguage($extension . '.sys', $source);
$types[$i]->text = JText::_($type->text);
}
JArrayHelper::sortObjects($types, 'text', 1, true, JFactory::getLanguage()->getLocale());
array_unshift($types, JHtml::_('select.option', '', JText::_('COM_MODULES_OPTION_SELECT_MODULE')));
$lists['type'] = JHtml::_('select.genericlist', $types, 'filter_type', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', $filter_type);
// state filter
$states = array();
$states[] = JHtml::_('select.option', '', JText::_('JOPTION_SELECT_PUBLISHED'));
$states[] = JHtml::_('select.option', '1', JText::_('JPUBLISHED'));
$states[] = JHtml::_('select.option', '0', JText::_('JUNPUBLISHED'));
$states[] = JHtml::_('select.option', '-2', JText::_('JTRASHED'));
$lists['state'] = JHtml::_('select.genericlist', $states, 'filter_state', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', $filter_state);
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['filter_search'] = $filter_search;
$this->outputHTML($params, $rows, $pageNav, $lists);
}
示例14: defined
* Plugin Helper File
*
* @package Snippets
* @version 3.5.5
*
* @author Peter van Westen <peter@nonumber.nl>
* @link http://www.nonumber.nl
* @copyright Copyright © 2014 NoNumber All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
// Load common functions
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
require_once JPATH_PLUGINS . '/system/nnframework/helpers/text.php';
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
nnFrameworkFunctions::loadLanguage('plg_system_snippets');
/**
* System Plugin that places a Snippets code block into the text
*/
class plgSystemSnippetsHelper
{
public function __construct(&$params)
{
$this->option = JFactory::getApplication()->input->get('option');
$this->params = $params;
$this->params->comment_start = '<!-- START: Snippets -->';
$this->params->comment_end = '<!-- END: Snippets -->';
$this->params->message_start = '<!-- Snippets Message: ';
$this->params->message_end = ' -->';
$bts = '((?:<p(?: [^>]*)?>\\s*)?)';
$bte = '((?:\\s*</p>)?)';
示例15: defined
/**
* Plugin Helper File
*
* @package CDN for Joomla!
* @version 3.4.0
*
* @author Peter van Westen <peter@nonumber.nl>
* @link http://www.nonumber.nl
* @copyright Copyright © 2014 NoNumber All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
nnFrameworkFunctions::loadLanguage('plg_system_cdnforjoomla');
/**
* Plugin that replaces media urls with CDN urls
*/
class plgSystemCDNforJoomlaHelper
{
var $params = null;
var $pass = false;
public function __construct(&$params)
{
$this->params = $params;
$hascdn = preg_replace(array('#^.*\\://#', '#/$#'), '', $this->params->cdn);
// return if cdn field has no value
if (!$hascdn) {
return;
}