Skip to content

Commit 8e0a6b0

Browse files
committed
Extend the dcaconfig, add new commands
1 parent 541de51 commit 8e0a6b0

File tree

2 files changed

+46
-54
lines changed

2 files changed

+46
-54
lines changed

2.x/system/config/dcaconfig.php

+23-27
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
1-
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
1+
<?php
22

33
/**
44
* Contao Open Source CMS
5-
* Copyright (C) 2005-2011 Leo Feyer
65
*
7-
* Formerly known as TYPOlight Open Source CMS.
8-
*
9-
* This program is free software: you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation, either
12-
* version 3 of the License, or (at your option) any later version.
13-
*
14-
* This program is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with this program. If not, please visit the Free
21-
* Software Foundation website at <http://www.gnu.org/licenses/>.
22-
*
23-
* PHP version 5
24-
* @copyright Leo Feyer 2005-2011
25-
* @author Leo Feyer <http://www.contao.org>
26-
* @package Config
27-
* @license LGPL
6+
* @copyright Andreas Isaak 2013
7+
* @package contao-boilerplate
8+
* @license GNU/LGPL
289
* @filesource
10+
*
2911
*/
3012

3113
// Display page ID
@@ -37,12 +19,10 @@
3719
$GLOBALS['TL_DCA']['tl_article']['list']['label']['format'] = '%s <span style="color: #aaaaaa; padding-left: 3px;">(%s, ID: %s)</span>';
3820

3921
// Narrow headlines
40-
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['options'] = array('h2','h3','h4','h5','h6');
41-
// $GLOBALS['TL_DCA']['tl_news']['fields']['caption']['eval']['allowHtml'] = true;
22+
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['options'] = array('h2', 'h3', 'h4', 'h5', 'h6', 'h1');
4223

4324
// Import Backend-User
4425
$this->import('BackendUser', 'User');
45-
4626
if (!$this->User->isAdmin)
4727
{
4828
$GLOBALS['TL_DCA']['tl_content']['fields']['text']['eval']['rte'] = 'tinyMCE_boilerplate';
@@ -58,4 +38,20 @@
5838
$GLOBALS['TL_DCA']['tl_article']['fields']['teaser']['eval']['rte'] = 'tinyMCE_boilerplate';
5939
}
6040

61-
?>
41+
// Remove the space fields
42+
// unset($GLOBALS['TL_DCA']['tl_article']['fields']['space']);
43+
// unset($GLOBALS['TL_DCA']['tl_content']['fields']['space']);
44+
// unset($GLOBALS['TL_DCA']['tl_module'] ['fields']['space']);
45+
46+
// Remove the image margin fields
47+
// unset($GLOBALS['TL_DCA']['tl_article']['fields']['imagemargin']);
48+
// unset($GLOBALS['TL_DCA']['tl_content']['fields']['imagemargin']);
49+
// unset($GLOBALS['TL_DCA']['tl_module']['fields']['imagemargin']);
50+
// unset($GLOBALS['TL_DCA']['tl_news']['fields']['imagemargin']);
51+
// unset($GLOBALS['TL_DCA']['tl_calendar_events']['fields']['imagemargin']);
52+
53+
// Sets the default content element
54+
// $GLOBALS['TL_DCA']['tl_content']['fields']['type']['default'] = 'headline';
55+
56+
// Sets the default form field
57+
// $GLOBALS['TL_DCA']['tl_form_field']['fields']['type']['default'] = 'hidden';

3.x/system/config/dcaconfig.php

+23-27
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
1-
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
1+
<?php
22

33
/**
44
* Contao Open Source CMS
5-
* Copyright (C) 2005-2011 Leo Feyer
65
*
7-
* Formerly known as TYPOlight Open Source CMS.
8-
*
9-
* This program is free software: you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation, either
12-
* version 3 of the License, or (at your option) any later version.
13-
*
14-
* This program is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with this program. If not, please visit the Free
21-
* Software Foundation website at <http://www.gnu.org/licenses/>.
22-
*
23-
* PHP version 5
24-
* @copyright Leo Feyer 2005-2011
25-
* @author Leo Feyer <http://www.contao.org>
26-
* @package Config
27-
* @license LGPL
6+
* @copyright Andreas Isaak 2013
7+
* @package contao-boilerplate
8+
* @license GNU/LGPL
289
* @filesource
10+
*
2911
*/
3012

3113
// Display page ID
@@ -37,12 +19,10 @@
3719
$GLOBALS['TL_DCA']['tl_article']['list']['label']['format'] = '%s <span style="color: #aaaaaa; padding-left: 3px;">(%s, ID: %s)</span>';
3820

3921
// Narrow headlines
40-
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['options'] = array('h2','h3','h4','h5','h6');
41-
// $GLOBALS['TL_DCA']['tl_news']['fields']['caption']['eval']['allowHtml'] = true;
22+
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['options'] = array('h2', 'h3', 'h4', 'h5', 'h6', 'h1');
4223

4324
// Import Backend-User
4425
$this->import('BackendUser', 'User');
45-
4626
if (!$this->User->isAdmin)
4727
{
4828
$GLOBALS['TL_DCA']['tl_content']['fields']['text']['eval']['rte'] = 'tinyMCE_boilerplate';
@@ -58,4 +38,20 @@
5838
$GLOBALS['TL_DCA']['tl_article']['fields']['teaser']['eval']['rte'] = 'tinyMCE_boilerplate';
5939
}
6040

61-
?>
41+
// Remove the space fields
42+
// unset($GLOBALS['TL_DCA']['tl_article']['fields']['space']);
43+
// unset($GLOBALS['TL_DCA']['tl_content']['fields']['space']);
44+
// unset($GLOBALS['TL_DCA']['tl_module'] ['fields']['space']);
45+
46+
// Remove the image margin fields
47+
// unset($GLOBALS['TL_DCA']['tl_article']['fields']['imagemargin']);
48+
// unset($GLOBALS['TL_DCA']['tl_content']['fields']['imagemargin']);
49+
// unset($GLOBALS['TL_DCA']['tl_module']['fields']['imagemargin']);
50+
// unset($GLOBALS['TL_DCA']['tl_news']['fields']['imagemargin']);
51+
// unset($GLOBALS['TL_DCA']['tl_calendar_events']['fields']['imagemargin']);
52+
53+
// Sets the default content element
54+
// $GLOBALS['TL_DCA']['tl_content']['fields']['type']['default'] = 'headline';
55+
56+
// Sets the default form field
57+
// $GLOBALS['TL_DCA']['tl_form_field']['fields']['type']['default'] = 'hidden';

0 commit comments

Comments
 (0)