Пример #1
0
 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
0
 /**
  * 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
0
 /**
  * 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
0
 function loadLanguage($extension, $admin = 1)
 {
     if (!$extension) {
         return;
     }
     NNFrameworkFunctions::loadLanguage($extension, $admin ? JPATH_ADMINISTRATOR : JPATH_SITE);
 }
Пример #5
0
 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
0
 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
0
 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=&quot;index.php?option=com_plugins&filter_type=system&filter_folder=system&search=cache cleaner&filter_search=cache cleaner&quot;>', '</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
0
 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=&quot;javascript&quot; type=&quot;text/javascript&quot;><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
0
 /**
  * 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
0
 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
0
/**
 * Plugin Helper File
 *
 * @package         Articles Anywhere
 * @version         4.0.3
 *
 * @author          Peter van Westen <*****@*****.**>
 * @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
0
 */
/**
 * @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
0
    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;
                }
            }
        }
        $html[] = '<ul class="nn_multiselect-ul" style="max-height:300px;min-width:' . $size . 'px;overflow-x: hidden;">';
        $prevlevel = 0;
        foreach ($o as $i => $option) {
            if ($prevlevel < $option->level) {
                // correct wrong level indentations
                $option->level = $prevlevel + 1;
                $html[] = '<ul class="nn_multiselect-sub">';
            } else {
                if ($prevlevel > $option->level) {
                    $html[] = str_repeat('</li></ul>', $prevlevel - $option->level);
                } else {
                    if ($i) {
                        $html[] = '</li>';
                    }
                }
            }
            $labelclass = trim('pull-left ' . (isset($option->labelclass) ? $option->labelclass : ''));
            $html[] = '<li>';
            $item = '<div class="' . trim('nn_multiselect-item pull-left ' . (isset($option->class) ? $option->class : '')) . '">';
            if (isset($option->title)) {
                $labelclass .= ' nav-header';
            }
            if (isset($option->title) && (!isset($option->value) || !$option->value)) {
                $item .= '<label class="' . $labelclass . '">' . $option->title . '</label>';
            } else {
                $selected = in_array($option->value, $value) ? ' checked="checked"' : '';
                $disabled = isset($option->disable) && $option->disable ? ' readonly="readonly" style="visibility:hidden"' : '';
                $item .= '<input type="checkbox" class="pull-left" name="' . $name . '" id="' . $id . $option->value . '" value="' . $option->value . '"' . $selected . $disabled . ' />
					<label for="' . $id . $option->value . '" class="' . $labelclass . '">' . $option->text . '</label>';
            }
            $item .= '</div>';
            $html[] = $item;
            if (!isset($o[$i + 1]) && $option->level > 0) {
                $html[] = str_repeat('</li></ul>', (int) $option->level);
            }
            $prevlevel = $option->level;
        }
        $html[] = '</ul>';
        $html[] = '
			<div style="display:none;" class="nn_multiselect-menu-block">
				<div class="pull-left nav-hover nn_multiselect-menu">
					<div class="btn-group">
						<a href="#" data-toggle="dropdown" class="dropdown-toggle btn btn-micro">
							<span class="caret"></span>
						</a>
						<ul class="dropdown-menu">
							<li class="nav-header">' . JText::_('COM_MODULES_SUBITEMS') . '</li>
							<li class="divider"></li>
							<li class=""><a class="checkall" href="javascript:;"><span class="icon-checkbox"></span> ' . JText::_('JSELECT') . '</a>
							</li>
							<li><a class="uncheckall" href="javascript:;"><span class="icon-checkbox-unchecked"></span> ' . JText::_('COM_MODULES_DESELECT') . '</a>
							</li>
							<div class="nn_multiselect-menu-expand">
								<li class="divider"></li>
								<li><a class="expandall" href="javascript:;"><span class="icon-plus"></span> ' . JText::_('NN_EXPAND') . '</a></li>
								<li><a class="collapseall" href="javascript:;"><span class="icon-minus"></span> ' . JText::_('NN_COLLAPSE') . '</a></li>
							</div>
						</ul>
					</div>
				</div>
			</div>';
        $html[] = '</div>';
        $html = implode('', $html);
        return self::handlePreparedStyles($html);
    }
Пример #14
0
 * @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
0
 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>';
 }
Пример #16
0
 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('#(</div>\\s*</form>\\s*(<\\!--.*?-->\\s*)*</div>)#', $link . '\\1', $body);
     JResponse::setBody($body);
 }
Пример #17
0
 * Plugin Helper File
 *
 * @package         Sourcerer
 * @version         5.0.2
 *
 * @author          Peter van Westen <*****@*****.**>
 * @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
{
    var $option = '';
    var $src_params = null;
    public function __construct(&$params)
    {
        $this->option = JFactory::getApplication()->input->get('option');
        // Set plugin parameters
        $this->src_params = new stdClass();
        $this->src_params->syntax_word = trim($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.
Пример #18
0
 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', JPATH_ADMINISTRATOR);
     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);
     $total = $db->loadResult();
     // Create the pagination object
     jimport('joomla.html.pagination');
     $page = new JPagination($total, $limitstart, $limit);
     if ($filter_order == 'ordering') {
         $order = 'category, ordering ' . $filter_order_Dir;
     } else {
         $order = $filter_order . ' ' . $filter_order_Dir . ', category, ordering';
     }
     // Get the articles
     $query->clear()->select('c.*, c.state as published, g.title AS accesslevel, cc.title AS category')->select('u.name AS editor, f.content_id AS frontpage, v.name AS author')->from('#__content AS c')->join('LEFT', '#__categories AS cc ON cc.id = c.catid')->join('LEFT', '#__viewlevels AS g ON g.id = c.access')->join('LEFT', '#__users AS u ON u.id = c.checked_out')->join('LEFT', '#__users AS v ON v.id = c.created_by')->join('LEFT', '#__content_frontpage AS f ON f.content_id = c.id')->where($where)->order($order);
     $db->setQuery($query, $page->limitstart, $page->limit);
     $rows = $db->loadObjectList();
     // If there is a database query error, throw a HTTP 500 and exit
     if ($db->getErrorNum()) {
         JError::raiseError(500, $db->stderr());
         return false;
     }
     $this->outputHTML($params, $rows, $page, $lists, $k2);
 }