Showing 638 changed files with 8,079 additions and 6,244 deletions.
15 changes: 0 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
# Components
/components/

# Tests
/tests/Fixtures/app/cache/contao/
/tests/Fixtures/assets/*
!/tests/Fixtures/assets/.gitignore
/tests/Fixtures/system/cache/
/tests/Fixtures/system/config/
/tests/Fixtures/system/logs/
/tests/Fixtures/system/themes/*
!/tests/Fixtures/system/themes/.gitignore
/tests/Fixtures/system/tmp/
/tests/Fixtures/web/

# Vendor
/vendor/
3 changes: 0 additions & 3 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'header_comment',
'concat_with_spaces',
'short_array_syntax',
'-phpdoc_to_comment',
'-empty_return',
'-concat_without_spaces',
])
->finder($finder)
;
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ env:

matrix:
include:
- php: 5.5
env: deps=highest
- php: 5.6
env: deps=lowest
- php: 7.0
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'

before_install:
- cp $HOME/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini /tmp
- phpenv config-rm xdebug.ini

before_script:
- composer selfupdate
- if [ -z "$deps" ]; then composer install --prefer-source; fi;
- if [ "$deps" = "lowest" ]; then composer update --prefer-source --prefer-lowest --prefer-stable; fi;
- if [ "$deps" = "highest" ]; then composer update --prefer-source; fi;
- travis_wait composer update $COMPOSER_FLAGS --no-interaction
- phpenv config-add /tmp/xdebug.ini

script:
- mkdir -p build/logs
Expand Down
56 changes: 28 additions & 28 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,142 +2,142 @@
host = https://www.transifex.com
type = XLIFF

[contao-core-bundle.v4_1-countries]
[contao-core-bundle.v4_2-countries]
source_file = src/Resources/contao/languages/en/countries.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/countries.xlf

[contao-core-bundle.v4_1-default]
[contao-core-bundle.v4_2-default]
source_file = src/Resources/contao/languages/en/default.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/default.xlf

[contao-core-bundle.v4_1-exception]
[contao-core-bundle.v4_2-exception]
source_file = src/Resources/contao/languages/en/exception.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/exception.xlf

[contao-core-bundle.v4_1-explain]
[contao-core-bundle.v4_2-explain]
source_file = src/Resources/contao/languages/en/explain.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/explain.xlf

[contao-core-bundle.v4_1-languages]
[contao-core-bundle.v4_2-languages]
source_file = src/Resources/contao/languages/en/languages.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/languages.xlf

[contao-core-bundle.v4_1-modules]
[contao-core-bundle.v4_2-modules]
source_file = src/Resources/contao/languages/en/modules.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/modules.xlf

[contao-core-bundle.v4_1-tl_article]
[contao-core-bundle.v4_2-tl_article]
source_file = src/Resources/contao/languages/en/tl_article.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_article.xlf

[contao-core-bundle.v4_1-tl_content]
[contao-core-bundle.v4_2-tl_content]
source_file = src/Resources/contao/languages/en/tl_content.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_content.xlf

[contao-core-bundle.v4_1-tl_files]
[contao-core-bundle.v4_2-tl_files]
source_file = src/Resources/contao/languages/en/tl_files.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_files.xlf

[contao-core-bundle.v4_1-tl_form]
[contao-core-bundle.v4_2-tl_form]
source_file = src/Resources/contao/languages/en/tl_form.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_form.xlf

[contao-core-bundle.v4_1-tl_form_field]
[contao-core-bundle.v4_2-tl_form_field]
source_file = src/Resources/contao/languages/en/tl_form_field.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_form_field.xlf

[contao-core-bundle.v4_1-tl_image_size]
[contao-core-bundle.v4_2-tl_image_size]
source_file = src/Resources/contao/languages/en/tl_image_size.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_image_size.xlf

[contao-core-bundle.v4_1-tl_image_size_item]
[contao-core-bundle.v4_2-tl_image_size_item]
source_file = src/Resources/contao/languages/en/tl_image_size_item.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_image_size_item.xlf

[contao-core-bundle.v4_1-tl_layout]
[contao-core-bundle.v4_2-tl_layout]
source_file = src/Resources/contao/languages/en/tl_layout.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_layout.xlf

[contao-core-bundle.v4_1-tl_log]
[contao-core-bundle.v4_2-tl_log]
source_file = src/Resources/contao/languages/en/tl_log.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_log.xlf

[contao-core-bundle.v4_1-tl_maintenance]
[contao-core-bundle.v4_2-tl_maintenance]
source_file = src/Resources/contao/languages/en/tl_maintenance.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_maintenance.xlf

[contao-core-bundle.v4_1-tl_member]
[contao-core-bundle.v4_2-tl_member]
source_file = src/Resources/contao/languages/en/tl_member.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_member.xlf

[contao-core-bundle.v4_1-tl_member_group]
[contao-core-bundle.v4_2-tl_member_group]
source_file = src/Resources/contao/languages/en/tl_member_group.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_member_group.xlf

[contao-core-bundle.v4_1-tl_module]
[contao-core-bundle.v4_2-tl_module]
source_file = src/Resources/contao/languages/en/tl_module.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_module.xlf

[contao-core-bundle.v4_1-tl_page]
[contao-core-bundle.v4_2-tl_page]
source_file = src/Resources/contao/languages/en/tl_page.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_page.xlf

[contao-core-bundle.v4_1-tl_settings]
[contao-core-bundle.v4_2-tl_settings]
source_file = src/Resources/contao/languages/en/tl_settings.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_settings.xlf

[contao-core-bundle.v4_1-tl_style]
[contao-core-bundle.v4_2-tl_style]
source_file = src/Resources/contao/languages/en/tl_style.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_style.xlf

[contao-core-bundle.v4_1-tl_style_sheet]
[contao-core-bundle.v4_2-tl_style_sheet]
source_file = src/Resources/contao/languages/en/tl_style_sheet.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_style_sheet.xlf

[contao-core-bundle.v4_1-tl_templates]
[contao-core-bundle.v4_2-tl_templates]
source_file = src/Resources/contao/languages/en/tl_templates.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_templates.xlf

[contao-core-bundle.v4_1-tl_theme]
[contao-core-bundle.v4_2-tl_theme]
source_file = src/Resources/contao/languages/en/tl_theme.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_theme.xlf

[contao-core-bundle.v4_1-tl_undo]
[contao-core-bundle.v4_2-tl_undo]
source_file = src/Resources/contao/languages/en/tl_undo.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_undo.xlf

[contao-core-bundle.v4_1-tl_user]
[contao-core-bundle.v4_2-tl_user]
source_file = src/Resources/contao/languages/en/tl_user.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_user.xlf

[contao-core-bundle.v4_1-tl_user_group]
[contao-core-bundle.v4_2-tl_user_group]
source_file = src/Resources/contao/languages/en/tl_user_group.xlf
source_lang = en
file_filter = src/Resources/contao/languages/<lang>/tl_user_group.xlf
139 changes: 52 additions & 87 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,54 @@
# Contao core bundle change log

### 4.1.3 (2016-04-22)

* Use data URIs for the image preview in the back end.
* Use DIRECTORY_SEPARATOR to convert kernel.cache_dir into a relative path (see #464).
* Always trigger the "isVisibleElement" hook (see contao/core#8312).
* Do not change all sessions when switching users (see contao/core#8158).
* Do not allow to close fieldsets with empty required fields (see contao/core#8300).
* Make the path related properties of the File class binary-safe (see contao/core#8295).
* Correctly validate and decode IDNA e-mail addresses (see contao/core#8306).
* Skip forward pages entirely in the book navigation module (see contao/core#5074).
* Do not add the X-Priority header in the Email class (see contao/core#8298).
* Determine the search index checksum in a more reliable way (see contao/core#7652).

### 4.1.2 (2016-03-22)

* Handle derived classes in the exception converter (see #462).
* Prevent the autofocus attribute from being added multiple times (see contao/core#8281).
* Respect the SSL settings of the root page when generating sitemaps (see contao/core#8270).
* Read from the temporary file if it has not been closed yet (see contao/core#8269).
* Always use HTTPS if the target server supports SSL connections (see contao/core#8183).
* Adjust the meta wizard field length to the column length (see contao/core#8277).
* Correctly handle custom mime icon paths (see contao/core#8275).
* Show the 404 error page if an unpublished article is requested (see contao/core#8264).
* Correctly count the URLs when rebuilding the search index (see contao/core#8262).
* Ensure that every image has a width and height attribute (see contao/core#8162).
* Set the correct mime type when embedding SVG images (see contao/core#8245).
* Handle the "float_left" and "float_right" classes in the back end (see contao/core#8239).
* Consider the fallback language if a page alias is ambiguous (see contao/core#8142).
* Fix the error 403/404 redirect (see contao/website#74).

### 4.1.1 (2016-03-03)

* Remove the "disable IP check" field from the back end settings (see #436).
* Do not quote the search string in `FIND_IN_SET()` (see #424).
* Always fix the domain and language when generating URLs (see contao/core#8238).
* Fix two issues with the flexible back end theme (see contao/core#8227).
* Correctly toggle custom page type icons (see contao/core#8236).
* Correctly render the links in the monthly/yearly event list menu (see contao/core#8140).
* Skip the registration related fields if a user is duplicated (see contao/core#8185).
* Correctly show the form field type help text (see contao/core#8200).
* Correctly create the initial version of a record (see contao/core#8141).
* Correctly show the "expand preview" buttons (see contao/core#8146).
* Correctly check that a password does not match the username (see contao/core#8209).
* Check if a directory exists before executing `mkdir()` (see contao/core#8150).
* Do not link to the maintenance module if the user cannot access it (see contao/core#8151).
* Show the "new folder" button in the template manager (see contao/core#8138).

### 4.1.0 (2015-11-26)

* Log e-mails in the database instead of a log file (see #413).
* Use events to modify the front end preview URL.
* Handle closures in the back end help controller (see #408).
* Fix saving the image size widget if no option is selected (see #411).
* Correctly set the ID when toggling fields via Ajax (see contao/core#8043).

### 4.1.0-RC1 (2015-11-10)

* Limit access to the image sizes per user or user group (see #319).
* Support the Lexik maintenance bundle if it is installed (see #283).
* Throw an exception instead of redirecting to `/contao?act=error` (see #395).
* Make the image caching and target path configurable (see #381).
* Call the load_callback when loading the page/file tree via ajax (see #398).
* Load the random_compat library in the Composer script handler (see #397).
* Never cache a page if there are messages (see #343).
* Adjust the code to be compatible with PHP7 (see contao/core#8018).
* Fix several issues with the new file search and add the `type:file` and `type:folder` flags (see #392).
* Only warm the Contao cache if the installation has been completed (see #383).
* Support retrieving services in `System::import()` and `System::importStatic()` (see #376).
* Handle an empty input in the meta wizard (see #382).
* Use the `kernel.terminate` event for the command scheduler (see #244).
* Support news and event links in the front end preview (see contao/core#7504).

### 4.1.0-beta1 (2015-10-21)

* Add all translations which are at least 95% complete.
* Update the hash of an existing file in `Dbafs::addResource()` (see contao/core#7828).
* Add a more accurate e-mail validation with unicode support (see #367).
* Add the "env::base_url" insert tag (see #322).
* Make the file manager and file picker searchable (see contao/core#7196).
* Show the website title in the back end (see contao/core#7840).
* Re-send the activation mail upon a second registration attempt (see contao/core#7992).
* Always show the "save and edit" button (see contao/core#3567).
* Highlight the rows on hover via CSS (see contao/core#7837).
* Show the important part in the file tree (see contao/core#7865).
* Also show the field names in "edit multiple" mode (see contao/core#7868).
* Add a button to remove single images from the file tree selection (see contao/core#6684).
* Support overwriting resources in `app/Resources/contao` (see #314).
### 4.2.0 (2016-06-18)

* Also check for the back end cookie when loading from cache (see contao/core#8249).
* Unset "mode" and "pid" upon save and edit (see contao/core#8292).
* Always use the relative path in DC_Folder (see contao/core#8370).
* Use the correct empty value when resetting copied fields (see contao/core#8365).
* Remove the "required" attribute if a subpalette is closed (see contao/core#8192).
* Correctly calculate the maximum file size for DropZone (see contao/core#8098).
* Versionize and show password changes (see contao/core#8301).
* Make File::$dirname an absolute path again (see contao/core#8325).
* Store the full URLs in the search index (see #491).
* Standardize the group names in the checkbox widget (see contao/core#8002).
* Prevent models from being registered twice (see contao/core#8224).
* Prevent horizontal scrolling in the ACE editor (see contao/core#8328).
* Correctly render the breadcrumb links in the template editor (see contao/core#8341).
* Remove the role attributes from the navigation templates (see contao/core#8343).
* Do not add `role="tablist"` to the accordion container (see contao/core#8344).
* Handle the `useAutoItem` option in the URL generator (see #489).
* Correctly implement the "autoplay" option in the YouTube/Vimeo element (see #509).
* Show the system messages in a modal dialog (see #486).
* Make DropZone the default uploader in the file manager (see #504).
* Correctly aling the input hints (see #503).
* Disable the "preview as" button if a member is not allowed to log in (see #502).
* Remove the "type" attribute from the Youtube/Vimeo iframe tag.
* Fix the filter reset buttons (see #496).
* Fix the filename case of the new SVG icons (see #492).

### 4.2.0-RC1 (2016-05-18)

* Add the URI when throwing 403 and 404 exceptions (see #369).
* Correctly determine the script_name in the Environment class (see #426).
* Add the URL generator (see #480).
* Support subpalettes in subpalettes (see #450).
* Add keys to the cronjobs array (see #440).

### 4.2.0-beta1 (2016-04-25)

* Remove the internal cache routines from the maintenance module (see #459).
* Modernize the back end theme and use SVG icons (see contao/core#4608).
* Add the PaletteManipulator class to modify DCA palettes (see #474).
* Optimize the jQuery and MooTools templates (see contao/core#8017).
* Show the record ID and table name in the diff view (see contao/core#5800).
* Add a "reset filters" button (see contao/core#6239).
* Support filters in the tree view (see contao/core#7074).
* Recursively replace insert tags (see #473).
* Add the Vimeo content element (see contao/core#8219).
* Improve the YouTube element (see contao/core#7514).
* Update the Piwik tracking code (see contao/core#8229).
* Use instanceof to check the return value of Model::getRelated() (see #451).
* Use the Composer class loader to load the Contao classes (see #437).
* Add the "ignoreFePreview" flag to the model classes (see #452).
* Clean up the code of the file selector (see #456).
17 changes: 14 additions & 3 deletions DEPRECATED.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,22 @@ Use the `kernel.root_dir` instead of `TL_ROOT`:
$rootDir = dirname(System::getContainer()->getParameter('kernel.root_dir'));
```

Check the container scope instead of using `TL_MODE`:
Use the `ScopeAwareTrait` trait instead of using `TL_MODE`:

```php
$isBackEnd = System::getContainer()->isScopeActive(ContaoCoreBundle::SCOPE_BACKEND);
$isFrontEnd = System::getContainer()->isScopeActive(ContaoCoreBundle::SCOPE_FRONTEND);
use Contao\CoreBundle\Framework\ScopeAwareTrait;

class Test {
use ScopeAwareTrait;

public function isBackend() {
return $this->isBackendScope();
}

public function isFrontend() {
return $this->isFrontendScope();
}
}
```

Use the kernel start time instead of `TL_START`:
Expand Down
Loading