Permalink
Browse files

Merge branch 'master' into 5.1.0-dev

  • Loading branch information...
carakas committed Jan 23, 2018
2 parents b522c17 + e930ec2 commit f6e0eeb49b229e2c5504a541e8d08d0ca88da054
Showing with 219 additions and 123 deletions.
  1. +5 −8 .github/PULL_REQUEST_TEMPLATE.md
  2. +2 −0 .htaccess
  3. +9 −0 UPGRADE_5.0.md
  4. +1 −0 app/Kernel.php
  5. +3 −3 docs/01. installation/01. installation.md
  6. +2 −2 docs/01. installation/02. installation_wizard.md
  7. +2 −2 docs/01. installation/03. minimum_requirements.md
  8. +1 −1 docs/01. installation/06. version_control.md
  9. +1 −1 docs/01. installation/08. faq.md
  10. +1 −1 docs/02. getting started/01. introduction.md
  11. +2 −2 docs/02. getting started/03. adding_a_theme.md
  12. +1 −1 docs/02. getting started/04. spam_protection.md
  13. +1 −1 docs/04. theming guide/06. creating_a_template.md
  14. +1 −1 docs/05. module guide/03. routing.md
  15. +1 −1 docs/05. module guide/04. modeling_your_module.md
  16. +1 −1 docs/05. module guide/15. cronjobs.md
  17. 0 docs/05. module guide/{25. events_publish_and_subscribe.md → 23. events_publish_and_subscribe.md}
  18. 0 docs/05. module guide/{26. creating_an_installer.md → 24. creating_an_installer.md}
  19. 0 docs/05. module guide/{27. creating_a_module_zip_file.md → 25. creating_a_module_zip_file.md}
  20. 0 docs/05. module guide/{28. twittercards.md → 26. twittercards.md}
  21. 0 docs/05. module guide/{29. symfony_form_file.md → 27. symfony_form_file.md}
  22. 0 docs/05. module guide/{30. symfony_form_image.md → 28. symfony_form_image.md}
  23. +6 −6 docs/06. contribute/01. introduction.md
  24. +1 −1 docs/06. contribute/02. testing.md
  25. +3 −3 docs/06. contribute/03. features.md
  26. +29 −8 docs/07. media library/01. introduction.md
  27. +37 −0 docs/07. media library/02. module structure.md
  28. +1 −2 docs/07. media library/{02. integrating in your module.md → 03. integrating in your module.md}
  29. +16 −1 docs/07. media library/{04. cropper.md → 04. image management.md}
  30. 0 docs/07. media library/{03. console commands.md → 05. console commands.md}
  31. +76 −71 docs/README.md
  32. +9 −1 src/Backend/Modules/Locale/Engine/AnalyseModel.php
  33. +3 −1 src/Backend/Modules/Locale/Engine/LocaleAnalyser.php
  34. +1 −1 src/Backend/Modules/Mailmotor/DependencyInjection/Compiler/MailmotorCompilerPass.php
  35. +1 −2 src/Backend/Modules/Profiles/Engine/Model.php
  36. +2 −1 src/Frontend/Modules/Search/Ajax/Livesuggest.php
@@ -1,19 +1,16 @@
## Type

> remove the types that don't apply
> If you discover any security related issues, please email core@fork-cms.com instead of using the issue tracker.
<!-- Remove the types that don't apply -->
<!-- If you discover any security related issues, please email core@fork-cms.com instead of using the issue tracker. -->

- Critical bugfix
- Non critical bugfix
- Enhancement
- Feature

## Resolves the following issues

> List the hashes of the issues that this pull request resolves if their are issues for it.
> Use the following format: fixes #[issue_number]
<!-- List the hashes of the issues that this pull request resolves if their are issues for it. -->
<!-- Use the following format: fixes #[issue_number] -->

## Pull request description

> Describe what your pull request will fix / add / …
<!-- Describe what your pull request will fix / add / … -->

@@ -81,11 +81,13 @@ deny from env=stayout
# </IfModule>
# RewriteCond %{HTTPS} !=on
# RewriteCond %{HTTP_HOST} !.*\.dev [NC]
# RewriteCond %{HTTP_HOST} !.*localhost(:\d+)?$ [NC]
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# one url to rule them all
# RewriteCond %{HTTP_HOST} !^www\.<domain>\.be [NC]
# RewriteCond %{HTTP_HOST} !.*\.dev [NC]
# RewriteCond %{HTTP_HOST} !.*localhost(:\d+)?$ [NC]
# RewriteRule ^(.*)$ http://www.<domain>.be/$1 [R=301,L]

# src dir should pass via the front controller
@@ -559,6 +559,15 @@ The following form types have been moved
| `\Backend\Form\Type\ImageType` | `\Common\Form\ImageType` |
| `\Backend\Form\Type\CollectionType` | `\Common\Form\CollectionType` |

## Page Blocks Extra

The `pages_blocks` table structure have been updated.

```mysql
ALTER TABLE pages_blocks ADD extra_type varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'rich_text';
ALTER TABLE pages_blocks ADD extra_data text COLLATE utf8mb4_unicode_ci;
```

## Swiftmailer

The default used to be `mail` but that has been removed in favour of `sendmail`.
@@ -109,6 +109,7 @@ public function defineForkConstants(): void
defined('FRONTEND_PATH') || define('FRONTEND_PATH', PATH_WWW . '/src/Frontend');
defined('FRONTEND_CACHE_PATH') || define('FRONTEND_CACHE_PATH', FRONTEND_PATH . '/Cache');
defined('FRONTEND_THEMES_PATH') || define('FRONTEND_THEMES_PATH', FRONTEND_PATH . '/Themes');
defined('FRONTEND_CORE_PATH') || define('FRONTEND_CORE_PATH', FRONTEND_PATH . '/Core');
defined('FRONTEND_MODULES_PATH') || define('FRONTEND_MODULES_PATH', FRONTEND_PATH . '/Modules');
defined('FRONTEND_FILES_PATH') || define('FRONTEND_FILES_PATH', FRONTEND_PATH . '/Files');
@@ -7,7 +7,7 @@ PHP Developers using Composer can use this command to install the latest stable
composer create-project forkcms/forkcms .

Alternatively, you can install Fork CMS by downloading it from the website.
Before downloading, check if your server meets the [minimum requirements](docs/03. minimum_requirements.md) for
Before downloading, check if your server meets the [minimum requirements](03.%20minimum_requirements.md) for
Fork CMS. If it does, create a MySQL database and remember the credentials. Next,
[download](http://www.fork-cms.com/download) the latest release and
[unpack](http://en.wikipedia.org/wiki/Tar_%28file_format%29) the folder.
@@ -27,9 +27,9 @@ Upload the unpacked files into the document_root of your webserver. Make sure yo
## Step 3: Installation

Use your browser to surf to your domain (this should forward you to the Fork CMS installer).
[Follow the steps](docs/02. installation_wizard.md) and you're done!
[Follow the steps](02.%20installation_wizard.md) and you're done!

![Installation started](./assets/started_install.png)

> Don't panic if you experience problems during the installation. Start by taking a look at our
[Frequently Asked Questions](docs/07. faq.md).
[Frequently Asked Questions](08.%20faq.md).
@@ -7,7 +7,7 @@ First the library is checked to verify it is in the correct location and is acce

## Step 2: Check requirements

Before we start the installation we want to make sure everything is configured properly. The wizard goes through all [Minimum Requirements](docs/03. minimum_requirements.md), including PHP Version, subfolder restriction, PHP Extensions, PHP ini-settings, PHP functions, and webserver configuration.
Before we start the installation we want to make sure everything is configured properly. The wizard goes through all [Minimum Requirements](03.%20minimum_requirements.md), including PHP Version, subfolder restriction, PHP Extensions, PHP ini-settings, PHP functions, and webserver configuration.

![Installation step 2](./assets/installation_step2.png)

@@ -50,4 +50,4 @@ Finally, all necessary files are created in the background and your success mess

![Installation step 7](./assets/installation_step7.png)

If the installation is finished you can [start configuring](../02. getting started/01. introduction.md) your website and tools.
If the installation is finished you can [start configuring](../02.%20getting%20started/01.%20introduction.md) your website and tools.
@@ -5,11 +5,11 @@
* PHP 7.1 or higher
* The following PHP extensions should be installed and enabled: [cURL](http://php.net/curl), [libxml](http://php.net/libxml), [DOM](http://php.net/dom), [SimpleXML](http://php.net/simplexml), [SPL](http://php.net/manual/en/book.spl.php), [PDO](http://php.net/pdo) (with MySQL driver), [mb_string](http://php.net/mb_string), [iconv](http://php.net/iconv), [GD2 graphics library](http://php.net/manual/en/book.image.php), [json](http://php.net/json), [PCRE](http://php.net/pcre), [intl](http://php.net/manual/en/book.intl.php).
* MySQL 5.0 or higher
* Apache 2.0 with .htaccess, mod_rewrite, mod_expires (optional but recommended), mod_deflate (optional) enabled. A guide for alternative webservers is also [available](docs/04. webservers.md).
* Apache 2.0 with .htaccess, mod_rewrite, mod_expires (optional but recommended), mod_deflate (optional) enabled. A guide for alternative webservers is also [available](04.%20webservers.md).

If you're uncertain if your server matches these requirements you can execute the [`phpinfo()`](http://php.net/phpinfo) function.

> Please note that Fork can not be installed in [subdirectories](docs/07. faq.md).
> Please note that Fork can not be installed in [subdirectories](08.%20faq.md).

## Browser versions
@@ -29,4 +29,4 @@ composer install -o

All dependencies are now installed in the *vendors* folder.

Go through the [upgrading guide](docs/05. upgrading.md) to find out how you can keep your setup up-to-date with Git.
Go through the [upgrading guide](05.%20upgrading.md) to find out how you can keep your setup up-to-date with Git.
@@ -13,4 +13,4 @@ The reason why you don't see the installer is because the [url rewriting](http:/

If all files are uploaded, check if *mod_rewrite* is installed on your webserver and make sure your webserver accepts *.htaccess* files.

Still not working? Check the [webservers](docs/04. webservers.md) article for a full read about working with webservers.
Still not working? Check the [webservers](04.%20webservers.md) article for a full read about working with webservers.
@@ -1,6 +1,6 @@
# Getting started

We assume that you've already successfully [installed](../01. installation/01. installation.md) the software and are ready to start configuring your website. You'll find the private website configuration system in http://yourdomain.com/private.
We assume that you've already successfully [installed](../01.%20installation/01.%20installation.md) the software and are ready to start configuring your website. You'll find the private website configuration system in http://yourdomain.com/private.

Once you've logged into your account you'll see the Fork CMS dashboard. The dashboard includes a section called Analysis, which informs you of site errors or incomplete configuration items. You'll find the same list on the settings page.

@@ -8,6 +8,6 @@ Download the desired theme and upload it with the *Upload theme* button in the S

Select the uploaded theme and don't forget to click *save* afterwards.

In every theme there are templates available for different kind of pages. Templates represent the layout or structure of the page. If you're familiar with HTML you can [create your own templates](../04. theming-guide/06. creating_a_template.md) without the need for an entirely new design.
In every theme there are templates available for different kind of pages. Templates represent the layout or structure of the page. If you're familiar with HTML you can [create your own templates](../04.%20theming-guide/06.%20creating_a_template.md) without the need for an entirely new design.

You can also build completely customized website designs in Fork CMS. Take a look at our [Theme Guide](../04. theming-guide/01. introduction.md) to start transforming your design into a custom theme.
You can also build completely customized website designs in Fork CMS. Take a look at our [Theme Guide](../04.%20theming%20guide/01.%20introduction.md) to start transforming your design into a custom theme.
@@ -32,4 +32,4 @@ In your Fork CMS dashboard, go to *Settings* and enter the API key on the *Gener

![Enter the key](./assets/akismet_final.png)

If your site does receive spam, the majority will be intercepted by Akismet. You can also find information in the [user guide](../03. user guide/01. introduction.md) about manually assigning comments as spam.
If your site does receive spam, the majority will be intercepted by Akismet. You can also find information in the [user guide](../03.%20user%20guide/01.%20introduction.md) about manually assigning comments as spam.
@@ -2,7 +2,7 @@

Whether your using an existing theme or building your own, creating your own templates is an essential skill you have to learn when you want to change the layout of your website.

We assume you know what the [difference](docs/04. page_templates_positions_and_blocks.md) is between templates, positions and blocks. Also, html knowledge is required.
We assume you know what the [difference](04.%20page_templates_positions_and_blocks.md) is between templates, positions and blocks. Also, html knowledge is required.


## Create file
@@ -92,7 +92,7 @@ If a page is found (*mini-blog*), the next part of the url (if any) will be inte
in the module linked to the page, that action will be executed. If it doesn't exist, the default
action defined in the config-file of the module will be executed.

The action-part in the url (in this case: detail) will map to a matching [action-translation](docs/08. translations_or_locale.md).
The action-part in the url (in this case: detail) will map to a matching [action-translation](08.%20translations_or_locale.md).
*detail* is one of the default actions already, but if you're adding a new or uncommon action, don't
forget to create a translation for it. Internally, the action-part in the url will be searched for
in the translations, and it's reference code will be used to route to the correct action, this way
@@ -119,7 +119,7 @@ In the root folder of every module, there will be a Config.php. This is the star

For the frontend, you alter the complete navigation by dragging the page to the right places on the “pages”-page in the backend.

For the backend however, when you write a module, you need to add the backend navigation that is used to edit the module in the *backend_navigation* table. Actually, inserting the module into the backend navigation will usually be handled in the installer, which we'll get to in [Creating an installer](26. creating_an_installer.md).
For the backend however, when you write a module, you need to add the backend navigation that is used to edit the module in the *backend_navigation* table. Actually, inserting the module into the backend navigation will usually be handled in the installer, which we'll get to in [Creating an installer](24.%20creating_an_installer.md).

For the mini-blog module, you'll want to add the following array to the element “children” of the array with the label “Modules”, after which the pages will become visible on the “Modules” page.

@@ -4,4 +4,4 @@ If a certain action needs to be executed at a certain interval (ones a day, hour

## How to run a console command as a cronjob

[Configuring cronjobs](../02. getting started/07. configuring_cronjobs.md)
[Configuring cronjobs](../02.%20getting%20started/07.%20configuring_cronjobs.md)
@@ -87,12 +87,12 @@ Not all decisions can be made using lazy consensus. Issues such as those affecti

## Contribution Process

* [Testing](docs/02. testing.md)
* [Features](docs/03. features.md)
* [Translations](docs/04. translations.md)
* [User Interface](docs/05. user_interface.md)
* [Documentation](docs/06. documentation.md)
* [Spreading the word](docs/07. spreading_the_word.md)
* [Testing](02.%20testing.md)
* [Features](03.%20features.md)
* [Translations](04.%20translations.md)
* [User Interface](05.%20user_interface.md)
* [Documentation](06.%20documentation.md)
* [Spreading the word](07.%20spreading_the_word.md)


*This document is based on the [Template For A Meritocratic Governance Document](http://www.oss-watch.ac.uk/resources/meritocraticGovernanceModel) of OSS Watch*
@@ -24,4 +24,4 @@ Best practices considering security can be reported in the documentation, submit

(TODO)

While testing is one of the most valueable contributions, it doesn't allow you to build your creative ideas into reality. The next article is about [adding new features](docs/03. features.md).
While testing is one of the most valueable contributions, it doesn't allow you to build your creative ideas into reality. The next article is about [adding new features](03.%20features.md).
@@ -13,7 +13,7 @@ The first question you have to ask yourself is if you want your new feature to b

In doubt, we advice you to always choose for an extension. Extensions can still easily be integrated by default afterwards. Alternatively you can ask on the [Slack channel](https://forkcms.slack.com/) the opinion of the community.

How to make extensions can be found in our [module guide](../05. module guide/01. introduction.md) guide. For adding new features in the core, we ask to add a pull-request on GitHub.
How to make extensions can be found in our [module guide](../05.%20module%20guide/01.%20introduction.md) guide. For adding new features in the core, we ask to add a pull-request on GitHub.


## GitHub
@@ -22,10 +22,10 @@ When collaborating on the same source you need a Version Control System to keep

After you installed [Git](https://help.github.com/articles/set-up-git), start by [forking](https://help.github.com/articles/fork-a-repo) the Fork CMS [Repository](https://github.com/forkcms/forkcms). Afterwards, [create a branch](https://help.github.com/articles/fork-a-repo#create-branches), please don't work in `master` directly.

After you [comitted](https://help.github.com/articles/create-a-repo#step-2-commit-your-readme) all changes to your branch and [pushed](https://help.github.com/articles/create-a-repo#step-3-push-your-commit) them to your forked version, you'll have to do a [pull request](https://help.github.com/articles/using-pull-requests). Make sure you explain what and why you want to change a part to the core. After the pull request has been voted or discussed on the [technical board meeting](docs/01. introduction.md) it will get merged.
After you [comitted](https://help.github.com/articles/create-a-repo#step-2-commit-your-readme) all changes to your branch and [pushed](https://help.github.com/articles/create-a-repo#step-3-push-your-commit) them to your forked version, you'll have to do a [pull request](https://help.github.com/articles/using-pull-requests). Make sure you explain what and why you want to change a part to the core. After the pull request has been voted or discussed on the [technical board meeting](01.%20introduction.md) it will get merged.

More information about working with GitHub can found on the [help](https://help.github.com/) of GitHub, in the [documentation](http://git-scm.com/documentation) of Git, in the [Git Workflows](http://documentup.com/skwp/git-workflows-book) book or learn Git Branching [interactively](http://pcottle.github.io/learnGitBranching/).



When you edit something in the core we will ask you to update the documentation too. Read our [documentation](docs/06. documentation.md) article to find some tips.
When you edit something in the core we will ask you to update the documentation too. Read our [documentation](06.%20documentation.md) article to find some tips.
@@ -1,18 +1,39 @@
# Introduction

The Media library is a module that allows you to put all your image/files/movies/audio files in it. These files can then easily be connected to entities from custom modules. There are also widgets to show these files as you like, f.e.: slider, lightbox, listing, ... and you can easily create your own type of widget (in your own custom module).
The MediaLibrary module allows you to save all your `image`, `file`, `movie` or `audio` files in one place. We call these files `MediaItem` entities.
A `MediaGroup` is a collection of `MediaItem` entities. You can use MediaGroup entities in your custom module entities.

```php
class BlogArticle
{
/**
* @var MediaGroup
*/
private $images;
## LiipImagineBundle
/**
* @var MediaGroup
*/
private $trailers;
}
```

The media library module uses the [Liip Imagine Bundle](http://symfony.com/doc/1.0/bundles/LiipImagineBundle/index.html) to serve the images.
> [Read more about the module structure.](02.%20module%20structure.md)
The media library in fork comes with 5 predefined filters. For more information about how to configure filters you can check the [official Liip Imagine Bundle documentation](http://symfony.com/doc/1.0/bundles/LiipImagineBundle/filters.html).
## Frontend widgets

The 5 predefined filters can be found in `app/config/config.yml`, [view config.yml here](app/config/config.yml).
In the frontend you can choose how you wish to show the MediaGroup entities.

If you want to add your own filters you can append them to the config.
**Default media widgets**

## Database
* **Lightbox** ([php](../../src/Frontend/Modules/MediaLibrary/Widgets/Lightbox.php), [html](../../src/Frontend/Modules/MediaLibrary/Layout/Widgets/Lightbox.html.twig)) - clicking a thumbnail will open a lightbox
* **Listing** ([php](../../src/Frontend/Modules/MediaLibrary/Widgets/Listing.php), [html](../../src/Frontend/Modules/MediaLibrary/Layout/Widgets/Listing.html.twig)) - a list `<ul>` containing the links to the source files
* **OneImage** ([php](../../src/Frontend/Modules/MediaLibrary/Widgets/OneImage.php), [html](../../src/Frontend/Modules/MediaLibrary/Layout/Widgets/OneImage.html.twig)) - the first image will be shown
* **OneRandomImage** ([php](../../src/Frontend/Modules/MediaLibrary/Widgets/OneRandomImage.php), [html](../../src/Frontend/Modules/MediaLibrary/Layout/Widgets/OneRandomImage.html.twig)) - randomly pick one image from your MediaGroup
* **Slider** ([php](../../src/Frontend/Modules/MediaLibrary/Widgets/Slider.php), [html](../../src/Frontend/Modules/MediaLibrary/Layout/Widgets/Slider.html.twig)) - thumbnails will be created to show a slider

We have chosen to have a tight-coupled connection between your "custom entity" and the "MediaGroup". The MediaGroup entity holds all the connected media items.
**Custom media widgets**

This is the best part. Everything is so flexible. Nothing is holding you back from creating your own amazing media widget. The widget can be placed in your own custom module.

[How to create custom frontend widgets?](03.%20integrating%20in%20your%20module.md)
Oops, something went wrong.

0 comments on commit f6e0eeb

Please sign in to comment.