This repository was archived by the owner on Feb 9, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Auto-association modals for contents #2
Closed
Closed
Changes from 4 commits
Commits
Show all changes
440 commits
Select commit
Hold shift + click to select a range
ea53e98
Merge pull request #56 from Digital-Peak/finder/filter
dneukirchen 82eaf9c
corret use of global
astridx 5a2da4b
Merge branch 'dev' of https://github.com/joomla-projects/joomla-es6 i…
astridx 1e82c2a
name functions as self is used
astridx d225068
name unnamed funciton again
astridx 7a4200f
Remove inline script and event handlers
dneukirchen b828a93
Remove unused $user
dneukirchen bb34ead
Replace inline scripts
dneukirchen 21c9189
Remove empty div
dneukirchen 64d8698
Remove the inline script
dneukirchen b06bb37
Add external script
dneukirchen ebb3af7
NLEOF
dneukirchen c734bde
Remove namespace check (we dont need it here)
dneukirchen 2cebd74
Remove namespace check
dneukirchen 31fc782
CS
dneukirchen ecff605
Remove inline script
dneukirchen f0c4c51
Add external script
dneukirchen 4f40d8a
use event
astridx 03147bd
Merge pull request #47 from astridx/astridx-plg_media-action_rotate/r…
dneukirchen 1adf576
Merge branch 'dev' of https://github.com/joomla-projects/joomla-es6 i…
astridx 9c6db93
named functions to arrow functions
astridx 7be1ec8
Merge pull request #49 from astridx/astrid-plg_media-action_crop/crop.js
dneukirchen fe6de6f
Merge branch 'dev' of https://github.com/joomla-projects/joomla-es6 i…
astridx 478259b
wip
astridx fd2c459
Merge pull request #48 from astridx/astrid-plg_media-action_resize/re…
dneukirchen ff4a59d
Replace inline script
dneukirchen 4e55c1d
Remove inline scripts/components/com mailto/tmpl/mailto/default.php
dneukirchen 2803ba2
Merge pull request #62 from joomla-projects/remove-inline-scripts/com…
dneukirchen 556d737
Merge pull request #60 from joomla-projects/remove-inline-scripts/com…
dneukirchen 1131583
Merge pull request #63 from joomla-projects/remove-inline-scripts/com…
dneukirchen 6619e22
Merge pull request #64 from joomla-projects/remove-inline-scripts/com…
dneukirchen 6fa2e79
Merge pull request #61 from joomla-projects/remove-inline-scripts/com…
dneukirchen d4d3268
Remove inline scripts
dneukirchen bd1c030
Merge pull request #65 from joomla-projects/remove-inline-scripts/com…
dneukirchen 927528e
Merge pull request #66 from joomla-projects/remove-inline-scripts/com…
dneukirchen e9c9b26
Remove inline scripts components/com_tags/tmpl/tag/default_items.php
dneukirchen 6bbaa1c
remove-inline-scripts/components/com_tags/tmpl/tag/list_items.php
dneukirchen 600a3cc
remove-inline-scripts/components/com_tags/tmpl/tags/default_items.php
dneukirchen a2ac23c
CS
dneukirchen 78d5ded
Naming convention
dneukirchen 947c37b
Remove onchange handler
dneukirchen 98cf392
Remove onchange
dneukirchen e9b57f9
Remove onchange
dneukirchen d746ba9
Merge pull request #68 from joomla-projects/remove-inline-scripts/com…
dneukirchen 6397b5d
Merge pull request #67 from joomla-projects/remove-inline-scripts/com…
dneukirchen 2b8f269
Merge pull request #69 from joomla-projects/remove-inline-scripts/com…
dneukirchen ce92cc7
Start refactoring
dneukirchen 8a3bdc0
Remove Joomla.toggleContainer
dneukirchen a0544b4
Remove inline style
dneukirchen d48c6e6
Remove inline style and js from callback containers
dneukirchen 0001f2c
Remove inline styles from session
dneukirchen b14a06e
Remove code that belongs into admin template
dneukirchen b0d510f
CS
dneukirchen 380a489
Merge pull request #70 from joomla-projects/remove-inline-scripts/plu…
dneukirchen 545eabd
Rename stats.js to stats-message.js
dneukirchen c368d58
remove-inline-scripts/plugins/system/stats/layouts/field/data.php
dneukirchen 6a06f74
remove-inline-scripts/plugins/installer/packageinstaller/tmpl/default…
dneukirchen a295212
Missing var
dneukirchen 15a97a1
CS
dneukirchen fa5af89
Merge pull request #71 from joomla-projects/remove-inline-scripts/plu…
dneukirchen c366437
Merge pull request #72 from joomla-projects/remove-inline-scripts/plu…
dneukirchen c95fc11
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen 9eb0472
Merge branch 'dev' of https://github.com/joomla-projects/joomla-es6 i…
dneukirchen f85aa5e
Update crop es6
dneukirchen 2c7dab1
Update resize es6
dneukirchen 50f3f5d
Update rotate es6
dneukirchen b639872
Removed input int rotate
dneukirchen 8c8aa93
Inline code com_plugin/edit
astridx fc156ed
delete inline JavaScript as I think that we do not need it
astridx b1bc37e
extension to es6
350f6df
wip
astridx 00ae73b
Merge pull request #73 from joomla-projects/upstream-sync-media
9edb494
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen e65db66
Merge pull request #81 from astridx/InlineScripts_administrator/compo…
dneukirchen 5abc424
Merge pull request #82 from astridx/InlineScripts_administrator/compo…
dneukirchen 45f885f
contact-es6
e25a0e8
Merge pull request #83 from Anu1601CS/extension-es6
dneukirchen 326fb00
Merge pull request #86 from astridx/default_batch_body.php
dneukirchen 233705f
Remove inline Javascript for administrator/components/com_menus/Field…
astridx b81b268
Merge pull request #88 from astridx/menuTypeField
513954e
remove jQuery Leftover
dgrammatiko 82e5328
make dog happy
0b7a188
Merge pull request #87 from Anu1601CS/contact-es6
dneukirchen b6fcde0
Merge pull request #1 from joomla-projects/dev
anuragteapot 6ec9868
com_content 4
a5214ea
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen a22aa4c
Merge pull request #99 from Anu1601CS/content-4
dneukirchen 0c36940
inline javascript remove, jQuery remove, es6 (#103)
astridx 3849822
Remove inline Javascript for administrator/components/com_joomlaupda…
astridx c0bdb92
Remove inline Javascript for administrator/components/com_fields/tmp…
astridx 28f2ab0
Remove inline Javascript for administrator/components/com_languages/t…
astridx cae0d8d
Remove inline Javascript for administrator/components/com_joomlaupda…
astridx a823fc7
Transform com_content to ES6 (#97)
anuragteapot bbcc06b
Transform com_finder to ES6 and remove inline script [ Part1 ] (#90)
anuragteapot 7f2cbcf
Remove inline Javascript for administrator/components/com_languages/t…
astridx 59ca5aa
Convert Install from Web script (#50)
mbabker 2f4dd8e
com_content 1 (#95)
anuragteapot fb9c89e
Remove inline scripts from some layouts (#57)
C-Lodder ed8f46a
Transform com_content to ES6 (#96)
anuragteapot 70cbc83
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen 5982b99
Transform com_finder to ES6 and remove inline script [ Part 3 ] (#92)
anuragteapot d6a04ef
Transform com_finder to ES6 and remove inline script [ Part 2 ] (#91)
anuragteapot a4e4a40
Remove inline js of com_cache (#105)
laoneo 76864e0
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen da4bbb7
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen 5b2e316
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen 8b060e9
Remove inline Javascript for administrator/components/com_content/tmp…
astridx df1ba80
media/plg_system_debug/js/debug.js (#113)
kasvith 25642a5
media/plg_captcha_recaptcha/js/recaptcha.js (#112)
kasvith eadf286
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen 0e4c854
Disable no-params-reassign for properties (#116)
dneukirchen e3ad3f6
com_user to es6 (#117)
anuragteapot d3342ce
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen 8dbd106
Merge remote-tracking branch 'upstream/4.0-dev' into dev
dneukirchen 246032f
Replace JFactory to Factory (#20227)
csthomas d255dd8
[4.0] Subform custom element (#19184)
Fedik 86e295c
Update AssociationsHelper.php (#20239)
laoneo e10914d
[4.0] Make switcher type detection more robust (#19953)
46f7763
Update Bootstrap to 4.1.1 (#20285)
ciar4n 9f82859
[4.0] fix vendors assets (#20291)
0feb4fa
[4.0] Component services in Component class (#20217)
laoneo 69eaf4e
[4.0] Various installation cleanups (#20306)
wilsonge 4120a19
[4.0] Remove the need for empty dispatcher classes (#19987)
laoneo 181e9eb
[4.0] Fix issues when people don't enter the right information in the…
wilsonge e3da9e3
fix previrew (#20326)
anuragteapot d4b2560
Clean up import
wilsonge 87baaab
Fix issues in unused installer controller method
wilsonge 417adcc
Remove unused static property
wilsonge 6d1b663
Move hardcoded string to language files
wilsonge 48c5242
[4.0] Installation strings (#20333)
brianteeman cac31d1
Merge commit '3967dad2e345c54d16623d6da1e61211cb1963c5' into 4.0-dev
wilsonge ffda7cb
Merge commit '550e67fdaef920f0ea2f7bc8d5a64deccd4bb46f' into 4.0-dev
wilsonge 8a293d5
Merge commit 'aa5db0a' into 4.0-dev
wilsonge 1402c50
Merge commit 'f96a132' into 4.0-dev
wilsonge b742fc9
Merge commit '9be1fb0' into 4.0-dev
wilsonge c9818b3
Merge commit '5e390b5a7e133c4aea027bd7a7d19d481dd172a9' into 4.0-dev
wilsonge 915eb6d
Introduce CODEOWNERS (#20137)
mbabker 6fcaa99
Fix code style
wilsonge cb30b6a
Remove invalid or not used imports (#20337)
laoneo 1dbf007
Merge commit '05fd1d9' into 4.0-dev
wilsonge 902d0ee
Remove invalid classes from the classmap (#20316)
laoneo dd7defe
Merge commit '16459c7' into 4.0-dev
wilsonge 6f12691
Merge commit 'a8cf40f' into 4.0-dev
wilsonge 3104c32
Merge commit 'b410d74' into 4.0-dev
wilsonge 302a690
Merge commit 'd36ffe5' into 4.0-dev
wilsonge 3ce6109
Merge commit 'c66c814cc1fcba715ffc8f0f22a691b2f804f8f0' into 4.0-dev
wilsonge 97c20e0
Update libraries folder to 4.0 alpha 3
wilsonge 0ef3efe
Update administrator to 4.0 alpha 3
wilsonge 6e1d6c8
Other directories to J4 alpha 3
wilsonge 4af757b
Fix class name. Fixes #20355
wilsonge d2d2d1a
Fix docblock
wilsonge 5dcc4b7
Fix classname. Fixes #20356
wilsonge 239f908
Fixes admin 404 pages. Fixes #20357
wilsonge d1fe20d
Fix debug user view broken. Fixes #20378
wilsonge 42a180a
Move to draggable from jQuery UI. Partially fixes #20374
wilsonge 3a13f8f
[4.0] Fix filters for archive view (#20349)
htmgarcia 0b75cf4
Merge remote-tracking branch 'remotes/core/4.0-dev' into dev
laoneo be1059e
Update copyright year to 2018
laoneo f84e91b
Fix preinstall model and form path in installer (#20385)
HLeithner 0fc0214
Merge branch '4.0-dev' into toolbar
wilsonge b275fb1
Import cleanup
wilsonge 04a4e21
Merge branch '4.0-dev' of github.com:joomla/joomla-cms into 4.0-dev
wilsonge f7a51cc
Merge remote-tracking branch 'remotes/es6/dev' into j4/es6
laoneo a62b555
Revert year invalid change
laoneo ef721eb
[4.0] Add and update docblocks and missing class properties in instal…
wilsonge 4f73bb9
Fix type of name property
wilsonge cafb181
Merge branch 'dev' of https://github.com/joomla-projects/joomla-es6 i…
laoneo c1694f3
[4.0] Give com_modules a service interface so that com_config can int…
wilsonge 09e59eb
Add a migration layer for PostgreSQL configured sites to the database…
mbabker c5091d5
[4.0] Bump database and session packages (#20388)
mbabker 77548b0
Fix codestyle
wilsonge a2d2c1d
Merge branch '4.0-dev' into j4/es6
laoneo 3e0ae33
Ignore ifw client file
laoneo 7f1682a
Ignore ifw client file correctly
laoneo 280d7ba
Update to alpha 4 dev
wilsonge 778d9b8
Ignore ifw client file on top
laoneo 5edcef9
Fix typo in exception
wilsonge ed0572f
Revert the lintignore
laoneo a0d8cbf
Disable es lint for global var and use confirm from window
laoneo decce0f
Disable no alert rule till we have a CE in place
laoneo 3e240b2
Merge branch '4.0-dev' into j4/es6
laoneo cfe2f9f
[4.0] Removal of _QQ_ (#20399)
brianteeman 6ce4a24
[4.0] Toolbar factory (#20402)
wilsonge 91335d6
Merge branch '4.0-dev' into j4/es6
wilsonge 7775baf
[4.0] Change how uncaught exceptions are processed (#20109)
mbabker c998fa1
Change 404 message from URL Invalid to Not Found (#20419)
PhilETaylor 2676654
Add minified files
laoneo c7b5722
Merge branch '4.0-dev' into j4/es6
laoneo 6a2eed4
Standard forms dont require inline js for validation (#20398)
6544913
Fixes #19864 with encodeURIComponent on form values (#20414)
PhilETaylor 2aafe19
[4.0] Class 'ModulesHelper' not found when creating/editing module (#…
infograf768 300024e
[4.0] New UI Features for plg_system_httpheaders (#20403)
zero-24 ca1b9af
Merge branch '4.0-dev' into j4/es6
laoneo fb5da9d
[4.0] CSP generate & append nonce's using the JDocument api and plg_s…
zero-24 8aafaf2
[4.0][CS] Inside libraries/form (#20433)
carlitorweb 068cd2b
Redo of #20398 with no inline scripts
laoneo 540e2c6
Merge remote-tracking branch 'origin/j4/es6' into j4/es6
laoneo 129ce67
Merge branch '4.0-dev' into j4/es6
laoneo 29629ee
[4.0] Testing: Added command to only install Joomla with the RoboFile…
yvesh 2084ddf
Merge pull request #20396 from Digital-Peak/j4/es6
wilsonge 7fb8397
Contenthistory compare notification when selected more versions (#20434)
carlitorweb 33e4c0a
[4.0] Use the app response so we get headers sent on error (#20431)
wilsonge 1ff5434
Point the js tests to the master branch
laoneo 802b444
Merge branch '4.0-dev' into j4/js/tests/latest
laoneo 38aec5c
Change to 4.0-dev
laoneo 9fc0913
Merge remote-tracking branch 'origin/j4/js/tests/latest' into j4/js/t…
laoneo 788a254
Merge pull request #20449 from Digital-Peak/j4/js/tests/latest
jeckodevelopment 295a7a7
[4.0] Remove caption js (#20153)
253525e
Use namespaced class
wilsonge 50a5d4c
[4.0] Installation text improvement (#20454)
79fd949
Trigger the onBeforeExecute correctly through the dispatcher (#20448)
laoneo d60e358
add the requested new line (#20444)
zero-24 17b25e6
Replace the use of the apps_base_url global var with an event listener
mbabker 17e43c2
Load text string through translation API
mbabker ac77baa
Change com_admin to services (#20453)
laoneo cb18f11
[4.0] Take the list of tags out of the form (#20443)
htmgarcia 31cd53b
no more html imports (#20429)
cd0783d
The dispatcher factory is a required dependency (#20504)
laoneo 340e0b4
[4.0] Notices in articles layouts (#20503)
infograf768 2b4a631
[4.0] js error in core.js (web components) (#20512)
f499b6c
[4.0] Fix table status icon styling (#20514)
ciar4n 4c014d3
[4.0] Displaying articles captions below the images (#20520)
infograf768 3a0b5e9
Create a small modal test
Wang-Yu-Chao ebdc7e2
[4.0] Improve assets handling (#19744)
8477d0b
Only add debug information during installation on HTML documents (#20…
laoneo 28e6656
New auto-association modal for articles
Wang-Yu-Chao a45c321
[4.0] Fields using more namespaced classes (#19297)
7b29299
Fixing Suggestions in Finder/Smart Search (#20523)
Hackwar 8bd6f37
Check for the correct countItems callback function (#20505)
laoneo e74c702
[4.0] Change com_associations to services (#20457)
laoneo 085a640
Build skeleton of auto-associations in com_associations
Wang-Yu-Chao d0649ae
[4.0][com_menus] Use correct language constant (#20574)
b2f6904
Use sql in model to find associations, categories, alias and menutype
Wang-Yu-Chao 7722f1b
Center image (#20565)
c9de7b1
[4.0] Multilingual minimum correction to be able to test stuff (#20599)
infograf768 21bb801
Save tab state when editing a plugin (#20592)
laoneo 5510ac3
Use function to remove field in filter form.
Wang-Yu-Chao e999dcd
[4.0][A11Y] CSS4 focus visible polyfill (#20570)
6abe60b
Change com_joomlaupdate to services (#20612)
laoneo 45f54dd
[4.0] remove <php 7 code (#20555)
brianteeman be7715b
[4.0] Installation language (#20515)
brianteeman dd150ee
[4.0] Namespace content site associations helper (#19868)
laoneo 69734e4
[4.0] Modules can't be created (#19836)
laoneo 27440a1
Missing argument in sprintf(). (#20624)
cheryeong 084c9dd
Change com_checkin to services (#20614)
laoneo 9fec4cd
Change com_cache to services (#20613)
laoneo df88a13
[4.0] Finish the move of com_modules to services (#20622)
laoneo 6ee625f
[4.0] Change com_templates to services (#20619)
laoneo 027a013
Merge branch 'master' of github.com:joomla-projects/gsoc18_automatic_…
Wang-Yu-Chao 948e4f5
Create associations of current article by selected languages
Wang-Yu-Chao 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
251 changes: 251 additions & 0 deletions
251
administrator/components/com_associations/Model/AutoModel.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,251 @@ | ||
| <?php | ||
| /** | ||
| * @package Joomla.Administrator | ||
| * @subpackage com_associations | ||
| * | ||
| * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
| namespace Joomla\Component\Associations\Administrator\Model; | ||
|
|
||
| defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\MVC\Factory\MVCFactoryInterface; | ||
| use Joomla\CMS\MVC\Model\ListModel; | ||
| use Joomla\Database\DatabaseQuery; | ||
| use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper; | ||
|
|
||
| /** | ||
| * Methods supporting a list of article records. | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| class AutoModel extends ListModel | ||
| { | ||
| /** | ||
| * Override parent constructor. | ||
| * | ||
| * @param array $config An optional associative array of configuration settings. | ||
| * @param MVCFactoryInterface $factory The factory. | ||
| * | ||
| * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public function __construct($config = array(), MVCFactoryInterface $factory = null) | ||
| { | ||
| // @TODO change filter fields. | ||
| if (empty($config['filter_fields'])) | ||
| { | ||
| $config['filter_fields'] = array( | ||
| 'id', | ||
| 'title', | ||
| 'ordering', | ||
| 'itemtype', | ||
| 'language', | ||
| 'menutype', | ||
| 'menutype_title', | ||
| 'state', | ||
| 'category_id', | ||
| 'category_title', | ||
| 'access', | ||
| 'access_level', | ||
| ); | ||
| } | ||
|
|
||
| parent::__construct($config, $factory); | ||
| } | ||
|
|
||
| /** | ||
| * Method to auto-populate the model state. | ||
| * | ||
| * Note. Calling getState in this method will result in recursion. | ||
| * | ||
| * @param string $ordering An optional ordering field. | ||
| * @param string $direction An optional direction (asc|desc). | ||
| * | ||
| * @return void | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| protected function populateState($ordering = 'ordering', $direction = 'asc') | ||
| { | ||
| $app = \JFactory::getApplication(); | ||
|
|
||
| $forcedLanguage = $app->input->get('forcedLanguage', '', 'cmd'); | ||
|
|
||
| // Adjust the context to support modal layouts. | ||
| if ($layout = $app->input->get('layout')) | ||
| { | ||
| $this->context .= '.' . $layout; | ||
| } | ||
|
|
||
| // Adjust the context to support forced languages. | ||
| if ($forcedLanguage) | ||
| { | ||
| $this->context .= '.' . $forcedLanguage; | ||
| } | ||
|
|
||
| $this->setState('itemtype', $this->getUserStateFromRequest($this->context . '.itemtype', 'itemtype', '', 'string')); | ||
| $this->setState('referenceId', $this->getUserStateFromRequest($this->context . '.id', 'id', 0, 'int')); | ||
|
|
||
| $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string')); | ||
| $this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'cmd')); | ||
| $this->setState( | ||
| 'filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '', 'cmd') | ||
| ); | ||
| $this->setState('filter.menutype', $this->getUserStateFromRequest($this->context . '.filter.menutype', 'filter_menutype', '', 'string')); | ||
| $this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'string')); | ||
| $this->setState('filter.level', $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level', '', 'cmd')); | ||
|
|
||
| // List state information. | ||
| parent::populateState($ordering, $direction); | ||
| } | ||
|
|
||
| /** | ||
| * Method to get a store id based on model configuration state. | ||
| * | ||
| * This is necessary because the model is used by the component and | ||
| * different modules that might need different sets of data or different | ||
| * ordering requirements. | ||
| * | ||
| * @param string $id A prefix for the store id. | ||
| * | ||
| * @return string A store id. | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| protected function getStoreId($id = '') | ||
| { | ||
| // Compile the store id. | ||
| $id .= ':' . $this->getState('itemtype'); | ||
| $id .= ':' . $this->getState('forcedLanguage'); | ||
| $id .= ':' . $this->getState('filter.search'); | ||
| $id .= ':' . $this->getState('filter.state'); | ||
| $id .= ':' . $this->getState('filter.category_id'); | ||
| $id .= ':' . $this->getState('filter.menutype'); | ||
| $id .= ':' . $this->getState('filter.access'); | ||
| $id .= ':' . $this->getState('filter.level'); | ||
|
|
||
| return parent::getStoreId($id); | ||
| } | ||
|
|
||
| /** | ||
| * Build an SQL query to load the list data. | ||
| * | ||
| * @return DatabaseQuery|boolean | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| protected function getListQuery() | ||
| { | ||
| $type = null; | ||
|
|
||
| list($extensionName, $typeName) = explode('.', $this->state->get('itemtype'), 2); | ||
|
|
||
| $extension = AssociationsHelper::getSupportedExtension($extensionName); | ||
| $types = $extension->get('types'); | ||
|
|
||
| if (array_key_exists($typeName, $types)) | ||
| { | ||
| $type = $types[$typeName]; | ||
| } | ||
|
|
||
| if (is_null($type)) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| // Create a new query object. | ||
| $db = $this->getDbo(); | ||
| $query = $db->getQuery(true); | ||
|
|
||
| $details = $type->get('details'); | ||
|
|
||
| if (!array_key_exists('support', $details)) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| $support = $details['support']; | ||
|
|
||
| if (!array_key_exists('fields', $details)) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| $fields = $details['fields']; | ||
|
|
||
| $tablename = $details['tables']['a']; | ||
| $referenceId = $this->state->get('referenceId'); | ||
| $context = $extensionName . '.item'; | ||
| $pk = explode('.', $fields['id'])[1]; | ||
| $titleField = explode('.', $fields['title'])[1]; | ||
| $langField = explode('.', $fields['language'])[1]; | ||
|
|
||
| if ($typeName === 'category') | ||
| { | ||
| $context = 'com_categories.item'; | ||
| } | ||
|
|
||
| $categoriesExtraSql = (($tablename === '#__categories') ? ' AND c2.extension = ' . $db->quote($extensionName) : ''); | ||
|
|
||
| $query->select($db->quoteName('c2.' . $pk, 'item_id')) | ||
| ->select($db->quoteName('c2.' . $titleField, 'item_title')) | ||
| ->from($db->quoteName($tablename, 'c')) | ||
| ->join('INNER', $db->quoteName('#__associations', 'a') . ' ON a.id = c.' . $db->quoteName($pk) . ' AND a.context=' . $db->quote($context)) | ||
| ->join('INNER', $db->quoteName('#__associations', 'a2') . ' ON a.key = a2.key') | ||
| ->join('INNER', $db->quoteName($tablename, 'c2') . ' ON a2.id = c2.' . $db->quoteName($pk) . $categoriesExtraSql); | ||
|
|
||
| $query->select($db->quoteName('l.lang_id', 'lang_id')) | ||
| ->select($db->quoteName('l.lang_code', 'language')) | ||
| ->select($db->quoteName('l.published', 'published')) | ||
| ->select($db->quoteName('l.title', 'language_title')) | ||
| ->select($db->quoteName('l.image', 'language_image')) | ||
| ->join( | ||
| 'RIGHT', $db->quoteName('#__languages', 'l') . ' ON c2.' | ||
| . $db->quoteName($langField) . ' = l.lang_code' | ||
| ); | ||
|
|
||
| // Use alias field ? | ||
| if (!empty($fields['alias'])) | ||
| { | ||
| $aliasField = explode('.', $fields['alias'])[1]; | ||
|
|
||
| $query->select($db->quoteName('c2.' . $aliasField, 'alias')); | ||
| } | ||
|
|
||
| // Use catid field ? | ||
| if (!empty($fields['catid'])) | ||
| { | ||
| $catField = explode('.', $fields['catid'])[1]; | ||
|
|
||
| $query->join('LEFT', $db->quoteName('#__categories', 'ca') | ||
| . ' ON ' . $db->quoteName('c2.' . $catField) . ' = ca.id AND ca.extension = ' . $db->quote($extensionName) | ||
| ) | ||
| ->select($db->quoteName('ca.alias', 'category')); | ||
| } | ||
|
|
||
| // If component item type supports menu type, select the menu type also. | ||
| if (!empty($fields['menutype'])) | ||
| { | ||
| $menutypeField = explode('.', $fields['menutype'])[1]; | ||
|
|
||
| $query->select($db->quoteName('mt.title', 'menutype_title')) | ||
| ->join( | ||
| 'LEFT', $db->quoteName('#__menu_types', 'mt') . ' ON ' . $db->quoteName('mt.menutype') | ||
| . ' = ' . $db->quoteName('c2.' . $menutypeField) | ||
| ); | ||
| } | ||
|
|
||
| $query->where('(c.' . $pk . ' = ' . (int) $referenceId . ' OR c.' . $pk . ' IS NULL) AND (c.' | ||
| . $langField . ' != l.lang_code OR c.' . $langField . ' IS NULL)' | ||
| ); | ||
|
|
||
| if ($tablename === '#__categories') | ||
| { | ||
| $query->where('c.extension = ' . $db->quote($extensionName)); | ||
| } | ||
|
|
||
| return $query; | ||
| } | ||
| } | ||
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.
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.
quote l.lang_code and c.extension too