... |
... |
@@ -33,7 +33,7 @@ $GLOBALS['TL_DCA']['tl_article']['fields']['es_type'] = array
|
33 |
33 |
'exclude' => true,
|
34 |
34 |
'inputType' => 'select',
|
35 |
35 |
'options_callback' => array('tl_article_eSM_artLayout','getArticleLayouts'),
|
36 |
|
- 'eval' => array('tl_class'=>'w50', 'includeBlankOption'=>true, 'submitOnChange'=>true),
|
|
36 |
+ 'eval' => array('chosen'=>true, 'tl_class'=>'w50', 'includeBlankOption'=>true, 'submitOnChange'=>true),
|
37 |
37 |
'sql' => "int(10) unsigned NOT NULL default '0'"
|
38 |
38 |
);
|
39 |
39 |
|
... |
... |
@@ -86,29 +86,12 @@ class tl_article_eSM_artLayout extends Backend
|
86 |
86 |
public function getArticleLayouts(\DataContainer $dc)
|
87 |
87 |
{
|
88 |
88 |
|
89 |
|
- $arrLayoutIds = array();
|
90 |
|
- $PageModel = \PageModel::findWithDetails($dc->activeRecord->pid);
|
91 |
|
- if ($PageModel->layout)
|
92 |
|
- {
|
93 |
|
- $arrLayoutIds[] = $PageModel->layout;
|
94 |
|
- }
|
95 |
|
- if ($PageModel->mobileLayout)
|
96 |
|
- {
|
97 |
|
- $arrLayoutIds[] = $PageModel->mobileLayout;
|
98 |
|
- }
|
99 |
|
-
|
100 |
|
- $Themes = \ThemeModel::findMultipleByIds($arrLayoutIds);
|
101 |
|
- if ($Themes === null)
|
102 |
|
- {
|
103 |
|
- return array();
|
104 |
|
- }
|
105 |
|
-
|
106 |
89 |
$arrArticleLayouts = array();
|
107 |
|
- $ArticleLayouts = \Database::getInstance()->execute("SELECT id, title FROM tl_article_layouts WHERE ".\Database::getInstance()->findInSet('pid',$Themes->fetchEach('id'))." ORDER BY sorting");
|
|
90 |
+ $ArticleLayouts = \Database::getInstance()->execute("SELECT al.id, al.title, al.alias, t.name FROM tl_article_layouts al, tl_theme t WHERE t.id = al.pid ORDER BY t.name, al.sorting");
|
108 |
91 |
|
109 |
92 |
while ($ArticleLayouts->next())
|
110 |
93 |
{
|
111 |
|
- $arrArticleLayouts[$ArticleLayouts->id] = $ArticleLayouts->title;
|
|
94 |
+ $arrArticleLayouts[$ArticleLayouts->name][$ArticleLayouts->id] = $ArticleLayouts->title;
|
112 |
95 |
}
|
113 |
96 |
|
114 |
97 |
return $arrArticleLayouts;
|