-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[6.0] Add a global master language for Multilingual Associations #25403
base: 6.0-dev
Are you sure you want to change the base?
Changes from all commits
cec6bd5
57c3a12
655f7bb
9cd69c0
b74930c
d20257a
eb72d74
cc03c48
b669d7b
d834ab6
cd7aeb4
391e1a0
72f8963
03818fd
577c1c6
6812d99
1495977
7da2da0
8c61dd6
e6d7e3c
e0ceadd
0eed838
211400d
75ccfe9
b9361e6
500f10e
b9d451c
628c22e
69b7c05
7171c11
a123b14
4ab0293
cb4a7d3
666acbd
9b3d1c6
dbe7494
28010b8
b74287e
b34c098
561c01e
9f29efd
be8fdbf
591ced4
e22457d
fc95e69
550db64
eaf8ce2
2275c8a
ca7d5b0
7df0d4a
ef78227
3a109bb
7f42c40
978aac0
e6cdd7e
506059f
a866a13
0acf809
047bf74
55e46d1
eb2bdbb
285944f
3ac1800
6e30b12
ad19dc3
42a39b2
ba57d95
190ab67
3918c30
ef1eb55
5052e70
dc44040
3215e64
3c182ae
88ddb2a
952d7fb
393ed64
588ee55
3951117
f6ba2ee
7104b51
f6f3e9d
2733b6a
439c6ad
8f97cc0
a7c72db
da88da9
01f9cd8
5c321cb
ab0e2bd
77bb4f7
e81e549
1f8fb0b
6304010
de8a1b1
04ee4a7
fcb4f22
059ad32
822eeba
5dbad04
8f65a6c
e705cf5
3069cd7
197d0ce
9f5c7a3
c6e83ed
6e74985
f8866a2
1b14de0
41d85a7
6cd6fcb
b4d0019
5c9d903
6193b2b
4e7e99f
58d567d
a596d3a
f5b6dcb
1844027
a17cef8
ac231c8
fbf0c44
ffc4e27
6dcae08
0023d72
062dd08
440584d
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE `#__associations` ADD COLUMN `parent_id` int(11) NOT NULL DEFAULT -1 COMMENT 'The parent of an association.'; | ||
ALTER TABLE `#__associations` ADD COLUMN `parent_date` datetime COMMENT 'The save or modified date of the parent.'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE "#__associations" ADD COLUMN "parent_id" integer DEFAULT -1 NOT NULL; | ||
ALTER TABLE "#__associations" ADD COLUMN "parent_date" timestamp without time zone; | ||
COMMENT ON COLUMN "#__associations"."parent_id" IS 'The parent of an association.'; | ||
COMMENT ON COLUMN "#__associations"."parent_date" IS 'The save or modified date of the parent.'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_associations | ||
* | ||
* @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\Associations\Administrator\Controller; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\MVC\Controller\BaseController; | ||
use Joomla\CMS\Router\Route; | ||
|
||
/** | ||
* Association edit controller class. | ||
* | ||
* @since 4.0 | ||
This comment was marked as abuse.
Sorry, something went wrong. |
||
*/ | ||
class DefaultAssocLangController extends BaseController | ||
{ | ||
/** | ||
* Method to update the childs modified date of the parent in the associations table. | ||
* | ||
* @return void | ||
* | ||
* @since 4.0 | ||
This comment was marked as abuse.
Sorry, something went wrong. |
||
*/ | ||
public function update() | ||
{ | ||
$targetId = $this->input->get('targetId', '', 'int'); | ||
$parentId = $this->input->get('id', '', 'int'); | ||
$itemtype = $this->input->get('itemtype', '', 'string'); | ||
|
||
$this->getModel('defaultAssocLang')->update($targetId, $parentId, $itemtype); | ||
|
||
$this->setRedirect(Route::_('index.php?option=com_associations&view=associations', false)); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_associations | ||
* | ||
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
This comment was marked as abuse.
Sorry, something went wrong. |
||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
namespace Joomla\Component\Associations\Administrator\Field; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Form\Field\ContentlanguageField; | ||
use Joomla\CMS\HTML\HTMLHelper; | ||
use Joomla\CMS\Language\Associations; | ||
use Joomla\CMS\Language\LanguageHelper; | ||
use Joomla\CMS\Language\Text; | ||
use Joomla\Registry\Registry; | ||
|
||
|
||
/** | ||
* Content Association Languages Field class. | ||
* | ||
* @since 4.0 | ||
This comment was marked as abuse.
Sorry, something went wrong. |
||
*/ | ||
class ContentdefaultassoclangField extends ContentlanguageField | ||
{ | ||
/** | ||
* The list field type. | ||
* | ||
* @var string | ||
* | ||
* @since 4.0 | ||
This comment was marked as abuse.
Sorry, something went wrong. |
||
*/ | ||
public $type = 'contentdefaultassoclang'; | ||
|
||
/** | ||
* Method to get the field options. | ||
* | ||
* @return array The field option objects. | ||
* | ||
* @since 4.0 | ||
This comment was marked as abuse.
Sorry, something went wrong. |
||
*/ | ||
public function getOptions() | ||
{ | ||
$defaultAssocLang = Associations::getDefaultAssocLang(); | ||
$contentLanguages = LanguageHelper::getContentLanguages(array(0, 1)); | ||
|
||
$options = array(); | ||
$options[] = HTMLHelper::_('select.option', '', Text::_('JOPTION_SELECT_LANGUAGE')); | ||
|
||
foreach ($contentLanguages as $langCode) | ||
{ | ||
// Add information to the language if it is the default association language. | ||
if ($langCode->lang_code == $defaultAssocLang) | ||
{ | ||
$options[] = HTMLHelper::_('select.option', $langCode->lang_code, $langCode->title . ' - ' . Text::_('JGLOBAL_ASSOCIATIONS_DEFAULT_ASSOC_LANG')); | ||
} | ||
else | ||
{ | ||
$options[] = HTMLHelper::_('select.option', $langCode->lang_code, $langCode->title); | ||
} | ||
} | ||
|
||
return $options; | ||
} | ||
} |
This comment was marked as abuse.
Sorry, something went wrong.