本文整理汇总了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);
// only handle messages in html
if (JFactory::getDocument()->getType() != 'html') {
return false;
}
$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: install
/**
* Download and install
*/
function install($id, $url)
{
if (!is_string($url)) {
return JText::_('NNEM_ERROR_NO_VALID_URL');
}
$url = 'http://' . str_replace('http://', '', $url);
if (!($target = JInstallerHelper::downloadPackage($url))) {
return JText::_('NNEM_ERROR_CANNOT_DOWNLOAD_FILE');
}
$target = JFactory::getConfig()->get('tmp_path') . '/' . $target;
NNFrameworkFunctions::loadLanguage('com_installer', JPATH_ADMINISTRATOR);
jimport('joomla.installer.installer');
jimport('joomla.installer.helper');
// Get an installer instance
$installer = JInstaller::getInstance();
// Unpack the package
$package = JInstallerHelper::unpack($target);
// Cleanup the install files
if (!is_file($package['packagefile'])) {
$config = JFactory::getConfig();
$package['packagefile'] = $config->get('tmp_path') . '/' . $package['packagefile'];
}
JInstallerHelper::cleanupInstall($package['packagefile'], $package['packagefile']);
// Install the package
if (!$installer->install($package['dir'])) {
// There was an error installing the package
return JText::sprintf('COM_INSTALLER_INSTALL_ERROR', JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type'])));
}
return true;
}
示例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;
}
$user = JFactory::getUser();
if ($user->get('guest') || !$user->authorise('core.edit', 'com_content') && !$user->authorise('core.create', 'com_content')) {
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=popup.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: loadLanguage
function loadLanguage($extension, $admin = 1)
{
if (!$extension) {
return;
}
NNFrameworkFunctions::loadLanguage($extension, $admin ? JPATH_ADMINISTRATOR : JPATH_SITE);
}
示例5: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$size = (int) $this->get('size');
$multiple = $this->get('multiple', 0);
NNFrameworkFunctions::loadLanguage('com_menus', JPATH_ADMINISTRATOR);
$options = $this->getMenuItems();
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return NNHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
示例6: 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;
}
示例7: 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);
NNFrameworkFunctions::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::sprintf('CC_SYSTEM_PLUGIN_NOT_ENABLED', '<a href="index.php?option=com_plugins&filter_type=system&filter_folder=system&search=cache cleaner&filter_search=cache cleaner">', '</a>'))) . "';\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);
}
示例8: 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);
}
示例9: 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);
}
示例10: 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', JPATH_ADMINISTRATOR);
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);
}
示例11: defined
/**
* Plugin Helper File
*
* @package Articles Anywhere
* @version 4.0.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;
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_articlesanywhere');
/**
* Plugin that places articles
*/
class PlgSystemArticlesAnywhereHelper
{
var $helpers = array();
public function __construct(&$params)
{
$this->params = $params;
$this->params->comment_start = '<!-- START: Articles Anywhere -->';
$this->params->comment_end = '<!-- END: Articles Anywhere -->';
$this->params->message_start = '<!-- Articles Anywhere Message: ';
$this->params->message_end = ' -->';
$this->params->article_tag = trim($this->params->article_tag);
$this->params->message = '';
示例12: defined
*/
/**
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.tabstate');
if (!JFactory::getUser()->authorise('core.manage', 'com_modules')) {
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
NNFrameworkFunctions::loadLanguage('com_modules', JPATH_ADMINISTRATOR);
NNFrameworkFunctions::loadLanguage('com_advancedmodules');
jimport('joomla.filesystem.file');
// return if NoNumber Framework plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
$msg = JText::_('AMM_NONUMBER_FRAMEWORK_NOT_INSTALLED') . ' ' . JText::sprintf('AMM_EXTENSION_CAN_NOT_FUNCTION', JText::_('COM_ADVANCEDMODULES'));
JFactory::getApplication()->enqueueMessage($msg, 'error');
return;
}
// give notice if NoNumber Framework plugin is not enabled
$nnep = JPluginHelper::getPlugin('system', 'nnframework');
if (!isset($nnep->name)) {
$msg = JText::_('AMM_NONUMBER_FRAMEWORK_NOT_ENABLED') . ' ' . JText::sprintf('AMM_EXTENSION_CAN_NOT_FUNCTION', JText::_('COM_ADVANCEDMODULES'));
JFactory::getApplication()->enqueueMessage($msg, 'notice');
}
// load the NoNumber Framework language file
NNFrameworkFunctions::loadLanguage('plg_system_nnframework');
$controller = JControllerLegacy::getInstance('AdvancedModules');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
示例13: selectlist
static function selectlist(&$options, $name, $value, $id, $size = 0, $multiple = 0, $simple = 0)
{
if (empty($options)) {
return '<fieldset class="radio">' . JText::_('NN_NO_ITEMS_FOUND') . '</fieldset>';
}
require_once __DIR__ . '/parameters.php';
$parameters = NNParameters::getInstance();
$params = $parameters->getPluginParams('nnframework');
if (!is_array($value)) {
$value = explode(',', $value);
}
$count = 0;
if ($options != -1) {
foreach ($options as $option) {
$count++;
if (isset($option->links)) {
$count += count($option->links);
}
if ($count > $params->max_list_count) {
break;
}
}
}
if ($options == -1 || $count > $params->max_list_count) {
if (is_array($value)) {
$value = implode(',', $value);
}
if (!$value) {
$input = '<textarea name="' . $name . '" id="' . $id . '" cols="40" rows="5" />' . $value . '</textarea>';
} else {
$input = '<input type="text" name="' . $name . '" id="' . $id . '" value="' . $value . '" size="60" />';
}
return '<fieldset class="radio"><label for="' . $id . '">' . JText::_('NN_ITEM_IDS') . ':</label>' . $input . '</fieldset>';
}
if (!$multiple) {
$first_level = isset($options['0']->level) ? $options['0']->level : 0;
foreach ($options as &$option) {
if (!isset($option->level)) {
continue;
}
$repeat = $option->level - $first_level > 0 ? $option->level - $first_level : 0;
$option->text = str_repeat(' - ', $repeat) . $option->text;
}
$html = JHtml::_('select.genericlist', $options, $name, 'class="inputbox"', 'value', 'text', $value);
return self::handlePreparedStyles($html);
}
$size = (int) $size ?: 300;
if ($simple) {
$attr = 'style="width: ' . $size . 'px"';
$attr .= $multiple ? ' multiple="multiple"' : '';
$html = JHtml::_('select.genericlist', $options, $name, trim($attr), 'value', 'text', $value, $id);
return self::handlePreparedStyles($html);
}
require_once __DIR__ . '/functions.php';
NNFrameworkFunctions::loadLanguage('com_modules', JPATH_ADMINISTRATOR);
JHtml::stylesheet('nnframework/multiselect.min.css', false, true);
NNFrameworkFunctions::addScriptVersion(JUri::root(true) . '/media/nnframework/js/multiselect.min.js');
$html = array();
$html[] = '<div class="well well-small nn_multiselect" id="' . $id . '">';
$html[] = '
<div class="form-inline nn_multiselect-controls">
<span class="small">' . JText::_('JSELECT') . ':
<a class="nn_multiselect-checkall" href="javascript:;">' . JText::_('JALL') . '</a>,
<a class="nn_multiselect-uncheckall" href="javascript:;">' . JText::_('JNONE') . '</a>,
<a class="nn_multiselect-toggleall" href="javascript:;">' . JText::_('NN_TOGGLE') . '</a>
</span>
<span class="width-20">|</span>
<span class="small">' . JText::_('NN_EXPAND') . ':
<a class="nn_multiselect-expandall" href="javascript:;">' . JText::_('JALL') . '</a>,
<a class="nn_multiselect-collapseall" href="javascript:;">' . JText::_('JNONE') . '</a>
</span>
<span class="width-20">|</span>
<span class="small">' . JText::_('JSHOW') . ':
<a class="nn_multiselect-showall" href="javascript:;">' . JText::_('JALL') . '</a>,
<a class="nn_multiselect-showselected" href="javascript:;">' . JText::_('NN_SELECTED') . '</a>
</span>
<span class="nn_multiselect-maxmin">
<span class="width-20">|</span>
<span class="small">
<a class="nn_multiselect-maximize" href="javascript:;">' . JText::_('NN_MAXIMIZE') . '</a>
<a class="nn_multiselect-minimize" style="display:none;" href="javascript:;">' . JText::_('NN_MINIMIZE') . '</a>
</span>
</span>
<input type="text" name="nn_multiselect-filter" class="nn_multiselect-filter input-medium search-query pull-right" size="16"
autocomplete="off" placeholder="' . JText::_('JSEARCH_FILTER') . '" aria-invalid="false" tabindex="-1">
</div>
<div class="clearfix"></div>
<hr class="hr-condensed" />';
$o = array();
foreach ($options as $option) {
$option->level = isset($option->level) ? $option->level : 0;
$o[] = $option;
if (isset($option->links)) {
foreach ($option->links as $link) {
$link->level = $option->level + (isset($link->level) ? $link->level : 1);
$o[] = $link;
}
}
//.........这里部分代码省略.........
示例14: defined
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
if (!JFactory::getUser()->authorise('core.manage', 'com_modules')) {
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
NNFrameworkFunctions::loadLanguage('com_modules', JPATH_ADMINISTRATOR);
NNFrameworkFunctions::loadLanguage('com_advancedmodules');
jimport('joomla.filesystem.file');
// return if NoNumber Framework plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
$msg = JText::_('AMM_NONUMBER_FRAMEWORK_NOT_INSTALLED') . ' ' . JText::sprintf('AMM_EXTENSION_CAN_NOT_FUNCTION', JText::_('COM_ADVANCEDMODULES'));
JFactory::getApplication()->enqueueMessage($msg, 'error');
return;
}
// give notice if NoNumber Framework plugin is not enabled
$nnframework = JPluginHelper::getPlugin('system', 'nnframework');
if (!isset($nnframework->name)) {
$msg = JText::_('AMM_NONUMBER_FRAMEWORK_NOT_ENABLED') . ' ' . JText::sprintf('AMM_EXTENSION_CAN_NOT_FUNCTION', JText::_('COM_ADVANCEDMODULES'));
JFactory::getApplication()->enqueueMessage($msg, 'notice');
}
// load the NoNumber Framework language file
NNFrameworkFunctions::loadLanguage('plg_system_nnframework');
// Load admin main core language strings
NNFrameworkFunctions::loadLanguage('', JPATH_ADMINISTRATOR);
// Tell the browser not to cache this page.
JFactory::getApplication()->setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT', true);
$controller = JControllerLegacy::getInstance('AdvancedModules');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
示例15: processTagReadmore
public function processTagReadmore($extra)
{
if (!($link = $this->getArticleUrl())) {
return false;
}
// load the content language file
NNFrameworkFunctions::loadLanguage('com_content', JPATH_SITE);
$extra = explode('|', $extra);
$class = isset($extra['1']) ? trim($extra['1']) : 'readmore';
$readmore = $this->getReadMoreText($extra);
if ($class == 'readmore') {
return '<p class="' . $class . '"><a href="' . $link . '">' . $readmore . '</a></p>';
}
return '<a class="' . $class . '" href="' . $link . '">' . $readmore . '</a>';
}