-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.1] [GSoC 21] Core Enhancement 1 - Improve Menu-Module Assignment #34743
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
Closed
Closed
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
9b7bef7
create language constant for Add Module Button field
YatharthVyas 7793279
switcher for Add Module field
YatharthVyas 300e295
add module button field value to param in installation sql script
YatharthVyas cd3cfc1
display Add Module Here button when pm is passed as a get parameter
YatharthVyas 50ca7ce
add module button added to the frontend that links to the place modul…
YatharthVyas e7ce2f1
Make Add Module Here button accessible by mentioning the position
YatharthVyas 246391e
Permissions Check for Add Module Frontend Flow
YatharthVyas 75f6d64
Added language constant for Invalid Position Error
YatharthVyas ffca089
added links for passing data from add module btn
YatharthVyas 5c5de2d
init new controller for set position of module
YatharthVyas e84db87
Separate HTML tags from language constants for Place Module
YatharthVyas 80cf9a7
Rephrase Add Module to Place Module
YatharthVyas 792bfc1
Remove redundant Template ID from URL params for place modules
YatharthVyas 9297169
Controller for Set Position works and clear new state vars after save
YatharthVyas e21bd09
Pre select module position
YatharthVyas 696a524
rename menuId to menu_id
YatharthVyas 6260cfa
Rephrase setPosition controller to selectPosition
YatharthVyas e18a07b
Pre select Module Menu Item
YatharthVyas c6a6248
Removed redundant permission check
YatharthVyas 42bf2b8
made place module layout flexible for backend edit position modal
YatharthVyas 626675c
add comment
YatharthVyas 4c79545
new js file for submitting the place module modal form
YatharthVyas ff563d8
remove extra semicolon
YatharthVyas 11a1c71
Backend Preview Modal
YatharthVyas 3c9ef2a
Add language constant for select position
YatharthVyas 8a4aa38
Rephrase template preview constant
YatharthVyas 34f7f56
new tmpl for the modal
YatharthVyas 09bf231
template
YatharthVyas 18a63b7
change a to span and fix modal link
YatharthVyas 0f735db
add script for onchange of template select field
YatharthVyas 2128169
fix modal view of positions preview
YatharthVyas d8de85f
preview route works for both admin and user
YatharthVyas 2749f86
remove redundant string
YatharthVyas 15c34b5
fix bug in admin template positions view
YatharthVyas 7e2b4de
make new form file for template select field
YatharthVyas 197a0df
conditionally render template select field for site and admin
YatharthVyas a948661
show inactive positions also while placing modules
YatharthVyas 596a834
show place modules view only for site
YatharthVyas 9b08d99
phpcs cleanup
YatharthVyas d84808b
code cleanup
YatharthVyas a97beb4
indentation
YatharthVyas 3cca444
add client id to redirect
YatharthVyas 9d2a6bc
comment for client_id 0
YatharthVyas 83d122f
php cs
YatharthVyas 8602d2e
js cs
YatharthVyas 9efc49f
rephrase add module button so its similar to the backend button text
YatharthVyas 74efa49
Place Add Module button outside of main and improve its css
YatharthVyas 7048e3d
remove margin top from Add Module btn
YatharthVyas 08e764d
Hide frontend editing icon from place module view
YatharthVyas 3f22e74
backend flow modal view set to select position
YatharthVyas 3146773
positions are selectable via modal in backend flow
YatharthVyas d6834a1
Rephrase preview template position
YatharthVyas b9ec435
redesign position preview modal button
YatharthVyas c5820aa
remove extra permission check
YatharthVyas fa4add8
missing permissions warning message for pm view
YatharthVyas 81288ee
enhance code readability
YatharthVyas 4c555ba
fix typo
YatharthVyas 3e67371
Merge branch '4.1-dev' of https://github.com/joomla-projects/gsoc21_c…
YatharthVyas a6ac050
Update signature
bembelimen bb3b387
Merge branch 'joomla-projects:4.1-dev' into feature-place-modules
YatharthVyas 2529769
Fixes https://github.com/joomla-projects/gsoc21_core-enhancements/iss…
YatharthVyas db7ce9d
remove add module button from template file
YatharthVyas a6bd732
do not display card style for pm view
YatharthVyas ece3764
addmodulebutton plugin xml file
YatharthVyas 9ac80b3
addmodulebutton plugin file
YatharthVyas bf2bc07
script file to render the add module button
YatharthVyas dc29916
language constants for plugin
YatharthVyas 18f6907
sql install script for addmodulebutton plugin
YatharthVyas bd5bb9e
sql update script for addmodulebutton plugin
YatharthVyas 0aa28f1
js lint
YatharthVyas 5afd605
remove the add module button switcher
YatharthVyas 9ad30e8
Update administrator/components/com_admin/sql/updates/mysql/4.1.0-202…
YatharthVyas cd269b4
Update administrator/components/com_admin/sql/updates/postgresql/4.1.…
YatharthVyas f3c6fd8
remove language constants from cassiopeia
YatharthVyas 4dc8b45
add language constants to the plugin
YatharthVyas 1720df0
fix error message for users without permissions
YatharthVyas b278a4b
Merge branch 'feature-place-modules' of https://github.com/YatharthVy…
YatharthVyas 39aa3f0
Merge branch 'feature-place-modules' of https://github.com/YatharthVy…
YatharthVyas 933cb80
add the plugin to list of extensions
YatharthVyas 69b0de6
remove the old add module button css
YatharthVyas 963fbb3
change position and style of add module button
YatharthVyas 1a340ac
phpcs
YatharthVyas dc17906
Update plugins/system/addmodulebutton/addmodulebutton.php
YatharthVyas a634a9e
update add module button tooltip label
YatharthVyas 1315d9e
Capitalize Module
YatharthVyas cccebad
Update administrator/components/com_modules/tmpl/module/preview_posit…
YatharthVyas 541a478
phpcs
YatharthVyas d387342
Merge branch '4.1-dev' into feature-place-modules
YatharthVyas bc12875
fix indentations
YatharthVyas df02c40
undo extra indents
YatharthVyas 8ab1561
remove EOL whitespace
YatharthVyas a543128
fix indent for multiline comment
YatharthVyas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-06-27.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES | ||
| (0, 'plg_system_addmodulebutton', 'plugin', 'addmodulebutton', 'system', 0, 1, 1, 0, 1, '', '', '', NULL, NULL, 0, 0); |
2 changes: 2 additions & 0 deletions
2
administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-06-27.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES | ||
| (0, 'plg_system_addmodulebutton', 'plugin', 'addmodulebutton', 'system', 0, 1, 1, 0, 1, '', '', '', NULL, NULL, 0, 0); |
24 changes: 24 additions & 0 deletions
24
administrator/components/com_modules/forms/preview_positions.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <form> | ||
| <fieldset addfieldprefix="Joomla\Component\Modules\Administrator\Field"> | ||
| <field | ||
| name="template_style_site" | ||
| id="template-style-select" | ||
| type="templatestyle" | ||
| client="site" | ||
| label="COM_MODULES_MODULE_TEMPLATE_SELECT" | ||
| > | ||
| <option value="">JOPTION_USE_DEFAULT</option> | ||
| </field> | ||
|
|
||
| <field | ||
| name="template_style_admin" | ||
| id="template-style-select" | ||
| type="templatestyle" | ||
| client="administrator" | ||
| label="COM_MODULES_MODULE_TEMPLATE_SELECT" | ||
| > | ||
| <option value="">JOPTION_USE_DEFAULT</option> | ||
| </field> | ||
| </fieldset> | ||
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
administrator/components/com_modules/tmpl/module/preview_positions.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <?php | ||
| /** | ||
| * @package Joomla.Administrator | ||
| * @subpackage com_modules | ||
| * | ||
| * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> | ||
This comment was marked as abuse.
Sorry, something went wrong. |
||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\Factory; | ||
| use Joomla\CMS\Language\Text; | ||
| use Joomla\CMS\Uri\Uri; | ||
|
|
||
| /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ | ||
| $wa = $this->document->getWebAssetManager(); | ||
| $wa->useScript('com_modules.admin-modules-preview_positions'); | ||
|
|
||
| $isAdmin = Factory::getApplication()->input->get('client_id'); | ||
|
|
||
| // Get the URL of the iframe that displays template preview. | ||
| $iframeBaseURL = Uri::root(); | ||
| $iframeBaseURL .= $isAdmin ? 'administrator' : ''; | ||
|
|
||
| // Conditionally render the admin or site template select field. | ||
| $templateField = 'template_style_'; | ||
| $templateField .= $isAdmin ? 'admin' : 'site'; | ||
|
|
||
| // Render the template select field. | ||
| $this->fieldsets = $this->form->getFieldsets(); | ||
| echo $this->form->renderField($templateField); | ||
| ?> | ||
| <div class="jviewport-height90"> | ||
| <iframe | ||
| src="<?php echo $iframeBaseURL . '?pm=1&edit=1&templateStyle='; ?> | ||
| id="module-position-select" | ||
| name="module-position-select" | ||
| title="module-position-select" | ||
| height="100%" | ||
| width="100%"> | ||
| </iframe> | ||
| </div> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
administrator/language/en-GB/plg_system_addmodulebutton.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ; Joomla! Project | ||
| ; (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> | ||
| ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
| ; Note : All ini files need to be saved as UTF-8 | ||
|
|
||
| PLG_SYSTEM_ADDMODULEBUTTON="System - Add Module Button" | ||
| PLG_SYSTEM_ADD_MODULE_BUTTON_LABEL="Create a Module" | ||
| PLG_SYSTEM_ADD_MODULE_BUTTON_DESCRIPTION="Add a new module here" | ||
| PLG_ADD_MODULE_BUTTON_XML_DESCRIPTION="Displays a button to insert a module in a menu directly from the Frontend." | ||
| PLG_SYSTEM_ADD_MODULE_BUTTON_CREATE_MODULE_PERMISSIONS_WARNING="Please login with an account having permission to Select Module Position" | ||
| PLG_SYSTEM_ADD_MODULE_BUTTON_EDIT_MODULE_PERMISSIONS_WARNING="Please login with an account having permission to Edit Module Position" |
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/plg_system_addmodulebutton.sys.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ; Joomla! Project | ||
| ; (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> | ||
| ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
| ; Note : All ini files need to be saved as UTF-8 | ||
|
|
||
| PLG_SYSTEM_ADDMODULEBUTTON="System - Add Module Button" | ||
| PLG_ADD_MODULE_BUTTON_XML_DESCRIPTION="Displays a button to insert a module in a menu directly from the Frontend." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
build/media_source/com_modules/js/admin-modules-preview_positions.es6.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /** | ||
| * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| /** | ||
| * Add a keyboard event listener to the Select Template Style element. | ||
| * | ||
| * This script is meant to be loaded deferred. This means that it's non-blocking | ||
| * (the browser can load it whenever) and it doesn't need an on DOMContentLoaded event handler | ||
| * because the browser is guaranteed to execute it only after the DOM content has loaded, the | ||
| * whole point of it being deferred. | ||
| */ | ||
|
|
||
| const elIframe = document.getElementById('module-position-select'); | ||
| const elTemplateSelect = document.getElementById('jform_template_style_select'); | ||
|
|
||
| elTemplateSelect.addEventListener('change', (event) => { | ||
| elIframe.src = elIframe.src.substring(0, elIframe.src.indexOf('templateStyle=') + 14) + event.target.value; | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as abuse.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.