-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Fix database for Extensions - GSoC Expand Extensions Manager #17537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 78 commits
1ceec68
3ca6ba7
0b447a1
10d11de
87d0a13
9b0e728
399da44
36b3f1e
4e4ff12
27e28dd
b8e364e
a021ad4
20b4ec6
ad94d0e
7611b5e
a8b2517
8cac2b6
2ec2309
709cdd7
bdf909c
a2a3960
d291c39
5e0bbb7
73fb78f
117f5c5
32b5e21
b7ec345
2340573
91ef506
7e50ed8
df27ad3
66781fe
e70e9a5
ae235a3
2ffbcc5
d227bd2
c38f450
4cde55e
60b47ef
3b1ac9d
10f3529
f3371f2
9c94a72
60a1549
2cf5082
d461724
bfeec71
19ae179
ab13733
c74add1
38aa62a
191d23c
6f5134a
8284d69
f50772b
56f54b8
4c0c58a
cb6f5e6
763d0f2
4baaf00
d1f2389
b7a36ca
4b9193b
90d3d8f
201ca32
865b95c
72a7922
d9723d9
f06aa54
1cb6e6d
67202d3
10e70eb
4fa0e85
2be8238
552ee27
f04645a
f177f40
8535cda
027d3ef
3bb921f
b824fd4
ac08f40
2de1baa
1f3858f
71de8fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,10 @@ | |
|
|
||
| defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\Factory; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move lines 11-13 after |
||
| use Joomla\CMS\HTML\HTMLHelper; | ||
| use Joomla\CMS\Language\Text; | ||
|
|
||
| /** | ||
| * Installer helper. | ||
| * | ||
|
|
@@ -23,46 +27,48 @@ class InstallerHelper | |
| * @param string $vName The name of the active view. | ||
| * | ||
| * @return void | ||
| * | ||
| * @since 1.6 | ||
| */ | ||
| public static function addSubmenu($vName = 'install') | ||
| { | ||
| \JHtmlSidebar::addEntry( | ||
| \JText::_('COM_INSTALLER_SUBMENU_INSTALL'), | ||
| Text::_('COM_INSTALLER_SUBMENU_INSTALL'), | ||
| 'index.php?option=com_installer', | ||
| $vName == 'install' | ||
| ); | ||
| \JHtmlSidebar::addEntry( | ||
| \JText::_('COM_INSTALLER_SUBMENU_UPDATE'), | ||
| Text::_('COM_INSTALLER_SUBMENU_UPDATE'), | ||
| 'index.php?option=com_installer&view=update', | ||
| $vName == 'update' | ||
| ); | ||
| \JHtmlSidebar::addEntry( | ||
| \JText::_('COM_INSTALLER_SUBMENU_MANAGE'), | ||
| Text::_('COM_INSTALLER_SUBMENU_MANAGE'), | ||
| 'index.php?option=com_installer&view=manage', | ||
| $vName == 'manage' | ||
| ); | ||
| \JHtmlSidebar::addEntry( | ||
| \JText::_('COM_INSTALLER_SUBMENU_DISCOVER'), | ||
| Text::_('COM_INSTALLER_SUBMENU_DISCOVER'), | ||
| 'index.php?option=com_installer&view=discover', | ||
| $vName == 'discover' | ||
| ); | ||
| \JHtmlSidebar::addEntry( | ||
| \JText::_('COM_INSTALLER_SUBMENU_DATABASE'), | ||
| Text::_('COM_INSTALLER_SUBMENU_DATABASE'), | ||
| 'index.php?option=com_installer&view=database', | ||
| $vName == 'database' | ||
| ); | ||
| \JHtmlSidebar::addEntry( | ||
| \JText::_('COM_INSTALLER_SUBMENU_WARNINGS'), | ||
| Text::_('COM_INSTALLER_SUBMENU_WARNINGS'), | ||
| 'index.php?option=com_installer&view=warnings', | ||
| $vName == 'warnings' | ||
| ); | ||
| \JHtmlSidebar::addEntry( | ||
| \JText::_('COM_INSTALLER_SUBMENU_LANGUAGES'), | ||
| Text::_('COM_INSTALLER_SUBMENU_LANGUAGES'), | ||
| 'index.php?option=com_installer&view=languages', | ||
| $vName == 'languages' | ||
| ); | ||
| \JHtmlSidebar::addEntry( | ||
| \JText::_('COM_INSTALLER_SUBMENU_UPDATESITES'), | ||
| Text::_('COM_INSTALLER_SUBMENU_UPDATESITES'), | ||
| 'index.php?option=com_installer&view=updatesites', | ||
| $vName == 'updatesites' | ||
| ); | ||
|
|
@@ -88,7 +94,7 @@ public static function getExtensionTypes() | |
|
|
||
| foreach ($types as $type) | ||
| { | ||
| $options[] = \JHtml::_('select.option', $type, \JText::_('COM_INSTALLER_TYPE_' . strtoupper($type))); | ||
| $options[] = HTMLHelper::_('select.option', $type, Text::_('COM_INSTALLER_TYPE_' . strtoupper($type))); | ||
| } | ||
|
|
||
| return $options; | ||
|
|
@@ -103,20 +109,20 @@ public static function getExtensionTypes() | |
| */ | ||
| public static function getExtensionGroupes() | ||
| { | ||
| $db = \JFactory::getDbo(); | ||
| $db = Factory::getDbo(); | ||
| $query = $db->getQuery(true) | ||
| ->select('DISTINCT folder') | ||
| ->from('#__extensions') | ||
| ->where('folder != ' . $db->quote('')) | ||
| ->order('folder'); | ||
| ->select('DISTINCT ' . $db->quoteName('folder')) | ||
| ->from($db->quoteName('#__extensions')) | ||
| ->where($db->quoteName('folder') . ' != ' . $db->quote('')) | ||
| ->order($db->quoteName('folder')); | ||
| $db->setQuery($query); | ||
| $folders = $db->loadColumn(); | ||
|
|
||
| $options = array(); | ||
|
|
||
| foreach ($folders as $folder) | ||
| { | ||
| $options[] = \JHtml::_('select.option', $folder, $folder); | ||
| $options[] = HTMLHelper::_('select.option', $folder, $folder); | ||
| } | ||
|
|
||
| return $options; | ||
|
|
@@ -133,8 +139,8 @@ public static function getClientOptions() | |
| { | ||
| // Build the filter options. | ||
| $options = array(); | ||
| $options[] = \JHtml::_('select.option', '0', \JText::_('JSITE')); | ||
| $options[] = \JHtml::_('select.option', '1', \JText::_('JADMINISTRATOR')); | ||
| $options[] = HTMLHelper::_('select.option', '0', Text::_('JSITE')); | ||
| $options[] = HTMLHelper::_('select.option', '1', Text::_('JADMINISTRATOR')); | ||
|
|
||
| return $options; | ||
| } | ||
|
|
@@ -150,11 +156,54 @@ public static function getStateOptions() | |
| { | ||
| // Build the filter options. | ||
| $options = array(); | ||
| $options[] = \JHtml::_('select.option', '0', \JText::_('JDISABLED')); | ||
| $options[] = \JHtml::_('select.option', '1', \JText::_('JENABLED')); | ||
| $options[] = \JHtml::_('select.option', '2', \JText::_('JPROTECTED')); | ||
| $options[] = \JHtml::_('select.option', '3', \JText::_('JUNPROTECTED')); | ||
| $options[] = HTMLHelper::_('select.option', '0', Text::_('JDISABLED')); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need Status filter?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would think so. It is used in the list filter. Why do you think we don't need it?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I filtered on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes, I see the filter was there but it wasn't applied in the query. That has been fixed now. |
||
| $options[] = HTMLHelper::_('select.option', '1', Text::_('JENABLED')); | ||
| $options[] = HTMLHelper::_('select.option', '2', Text::_('JPROTECTED')); | ||
| $options[] = HTMLHelper::_('select.option', '3', Text::_('JUNPROTECTED')); | ||
|
|
||
| return $options; | ||
| } | ||
|
|
||
| /** | ||
| * Get a list of filter options for the application statuses. | ||
| * | ||
| * @param string $element element of an extension | ||
| * @param string $type type of an extension | ||
| * @param integer $client_id client_id of an extension | ||
| * @param string $folder folder of an extension | ||
| * | ||
| * @return \SimpleXMLElement | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public static function getInstallationXML($element, $type, $client_id = 1, $folder = null) | ||
| { | ||
| $path = $client_id ? JPATH_ADMINISTRATOR : JPATH_ROOT; | ||
|
|
||
| switch ($type) | ||
| { | ||
| case 'component': | ||
| $path .= '/components/' . $element . '/' . substr($element, 4) . '.xml'; | ||
| break; | ||
| case 'plugin': | ||
| $path .= '/plugins/' . $folder . '/' . $element . '/' . $element . '.xml'; | ||
| break; | ||
| case 'module': | ||
| $path .= '/modules/' . $element . '/' . $element->element . '.xml'; | ||
| break; | ||
| case 'template': | ||
| $path .= '/templates/' . $element . '/templateDetails.xml'; | ||
| break; | ||
| case 'library': | ||
| $path = JPATH_ADMINISTRATOR . '/manifests/libraries/' . $element . '.xml'; | ||
| break; | ||
| case 'file': | ||
| $path = JPATH_ADMINISTRATOR . '/manifests/files/' . $element . '.xml'; | ||
| break; | ||
| case 'package': | ||
| $path = JPATH_ADMINISTRATOR . '/manifests/packages/' . $element . '.xml'; | ||
| } | ||
|
|
||
| return simplexml_load_file($path); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this here still work when no extension is selected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@laoneo If no extension is selected, you get a popup in the backend saying you must make a selection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also when I just want to fix Joomla?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes

Joomla is just another option in the list.