- md5
- 8f1f96319f97fb52130bf1f8a8d0bc3c
- sha1
- b1a8812b6c35167007c7d054b99a5665f6a59dc8
- sha256
- 64d11279523a9bdb0698ed91742120b57de33c3ad238068535bd6805b027f1ce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
<?php
/**
* @package Joomla.Administrator
* @subpackage com_plugins
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Plugins\Administrator\Helper;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Installer\Installer;
/**
* Plugins component helper.
*
* @since 1.6
*/
class PluginsHelper
{
public static $extension = 'com_plugins';
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
*/
public static function addSubmenu($vName)
{
// No submenu for this component.
}
/**
* Returns an array of standard published state filter options.
*
* @return string The HTML code for the select tag
*/
public static function publishedOptions()
{
// Build the active state filter options.
$options = array();
$options[] = HTMLHelper::_('select.option', '1', 'JENABLED');
$options[] = HTMLHelper::_('select.option', '0', 'JDISABLED');
return $options;
}
/**
* Returns an array of standard published state filter options.
*
* @return string The HTML code for the select tag
*/
public static function folderOptions()
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('DISTINCT(folder) AS value, folder AS text')
->from('#__extensions')
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
->order('folder');
$db->setQuery($query);
try
{
$options = $db->loadObjectList();
}
catch (\RuntimeException $e)
{
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
return $options;
}
/**
* Parse the template file.
*
* @param string $templateBaseDir Base path to the template directory.
* @param string $templateDir Template directory.
*
* @return \JObject
*/
public function parseXMLTemplateFile($templateBaseDir, $templateDir)
{
$data = new \JObject;
// Check of the xml file exists.
$filePath = Path::clean($templateBaseDir . '/templates/' . $templateDir . '/templateDetails.xml');
if (is_file($filePath))
{
$xml = Installer::parseXMLInstallFile($filePath);
if ($xml['type'] != 'template')
{
return false;
}
foreach ($xml as $key => $value)
{
$data->set($key, $value);
}
}
return $data;
}
}
No other release has this exact content. See every version of this file.