You've already forked joomla_test
first commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_installer
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_installer
|
||||
* @since 2.5
|
||||
*/
|
||||
abstract class InstallerHtmlManage
|
||||
{
|
||||
/**
|
||||
* Returns a published state on a grid
|
||||
*
|
||||
* @param integer $value The state value.
|
||||
* @param integer $i The row index
|
||||
* @param boolean $enabled An optional setting for access control on the action.
|
||||
* @param string $checkbox An optional prefix for checkboxes.
|
||||
*
|
||||
* @return string The Html code
|
||||
*
|
||||
* @see JHtmlJGrid::state
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public static function state($value, $i, $enabled = true, $checkbox = 'cb')
|
||||
{
|
||||
$states = array(
|
||||
2 => array(
|
||||
'',
|
||||
'COM_INSTALLER_EXTENSION_PROTECTED',
|
||||
'',
|
||||
'COM_INSTALLER_EXTENSION_PROTECTED',
|
||||
true,
|
||||
'protected',
|
||||
'protected'
|
||||
),
|
||||
1 => array(
|
||||
'unpublish',
|
||||
'COM_INSTALLER_EXTENSION_ENABLED',
|
||||
'COM_INSTALLER_EXTENSION_DISABLE',
|
||||
'COM_INSTALLER_EXTENSION_ENABLED',
|
||||
true,
|
||||
'publish',
|
||||
'publish'
|
||||
),
|
||||
0 => array(
|
||||
'publish',
|
||||
'COM_INSTALLER_EXTENSION_DISABLED',
|
||||
'COM_INSTALLER_EXTENSION_ENABLE',
|
||||
'COM_INSTALLER_EXTENSION_DISABLED',
|
||||
true,
|
||||
'unpublish',
|
||||
'unpublish'
|
||||
),
|
||||
);
|
||||
|
||||
return JHtml::_('jgrid.state', $states, $value, $i, 'manage.', $enabled, true, $checkbox);
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
142
administrator/components/com_installer/helpers/installer.php
Normal file
142
administrator/components/com_installer/helpers/installer.php
Normal file
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_installer
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Installer helper.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_installer
|
||||
* @since 1.6
|
||||
*/
|
||||
class InstallerHelper
|
||||
{
|
||||
/**
|
||||
* Configure the Linkbar.
|
||||
*
|
||||
* @param string $vName The name of the active view.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function addSubmenu($vName = 'install')
|
||||
{
|
||||
JHtmlSidebar::addEntry(
|
||||
JText::_('COM_INSTALLER_SUBMENU_INSTALL'),
|
||||
'index.php?option=com_installer',
|
||||
$vName == 'install'
|
||||
);
|
||||
JHtmlSidebar::addEntry(
|
||||
JText::_('COM_INSTALLER_SUBMENU_UPDATE'),
|
||||
'index.php?option=com_installer&view=update',
|
||||
$vName == 'update'
|
||||
);
|
||||
JHtmlSidebar::addEntry(
|
||||
JText::_('COM_INSTALLER_SUBMENU_MANAGE'),
|
||||
'index.php?option=com_installer&view=manage',
|
||||
$vName == 'manage'
|
||||
);
|
||||
JHtmlSidebar::addEntry(
|
||||
JText::_('COM_INSTALLER_SUBMENU_DISCOVER'),
|
||||
'index.php?option=com_installer&view=discover',
|
||||
$vName == 'discover'
|
||||
);
|
||||
JHtmlSidebar::addEntry(
|
||||
JText::_('COM_INSTALLER_SUBMENU_DATABASE'),
|
||||
'index.php?option=com_installer&view=database',
|
||||
$vName == 'database'
|
||||
);
|
||||
JHtmlSidebar::addEntry(
|
||||
JText::_('COM_INSTALLER_SUBMENU_WARNINGS'),
|
||||
'index.php?option=com_installer&view=warnings',
|
||||
$vName == 'warnings'
|
||||
);
|
||||
JHtmlSidebar::addEntry(
|
||||
JText::_('COM_INSTALLER_SUBMENU_LANGUAGES'),
|
||||
'index.php?option=com_installer&view=languages',
|
||||
$vName == 'languages'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of filter options for the extension types.
|
||||
*
|
||||
* @return array An array of stdClass objects.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function getExtensionTypes()
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('DISTINCT type')
|
||||
->from('#__extensions');
|
||||
$db->setQuery($query);
|
||||
$types = $db->loadColumn();
|
||||
|
||||
$options = array();
|
||||
foreach ($types as $type)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $type, 'COM_INSTALLER_TYPE_' . strtoupper($type));
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of filter options for the extension types.
|
||||
*
|
||||
* @return array An array of stdClass objects.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function getExtensionGroupes()
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('DISTINCT folder')
|
||||
->from('#__extensions')
|
||||
->where('folder != ' . $db->quote(''))
|
||||
->order('folder');
|
||||
$db->setQuery($query);
|
||||
$folders = $db->loadColumn();
|
||||
|
||||
$options = array();
|
||||
foreach ($folders as $folder)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $folder, $folder);
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of the actions that can be performed.
|
||||
*
|
||||
* @return JObject
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public static function getActions()
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$result = new JObject;
|
||||
|
||||
$assetName = 'com_installer';
|
||||
|
||||
$actions = JAccess::getActions($assetName);
|
||||
|
||||
foreach ($actions as $action)
|
||||
{
|
||||
$result->set($action->name, $user->authorise($action->name, $assetName));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user