Commit Graph

160 Commits

Author SHA1 Message Date
Matteo 678916854e Add config to enable Twig strict_variables (#3370)
Adds the cms.enableTwigStrictVariables config option to enable strict_variables in Twig for debugging purposes. See https://twig.symfony.com/doc/2.x/api.html#environment-options. Credit to @matteotrubini
2018-01-26 10:59:45 -06:00
Samuel Georges e6de2a5521 Fixes exception on empty token 2017-11-02 19:53:20 +11:00
Samuel Georges 4a6e0e1e0e Implement CSRF token by default
Implement CSRF protection on CMS for postback handling
2017-10-30 09:00:17 +11:00
Luke Towers 08f9cd8448 Moved the |media twig filter from the CMS module to the System module 2017-09-27 22:15:01 -06:00
Samuel Georges 96d0535d09 Add generic onAjax handler that does nothing 2017-07-29 22:55:58 +10:00
Samuel Georges 1db67af8e8 Merge remote-tracking branch 'remotes/origin/develop' into l55upgrade
Conflicts:
	modules/system/lang/en/lang.php
2017-07-11 10:48:54 +10:00
Max Schmitt aeba740243 Add getStatusCode() in Cms\Classes\Controller (#2959)
Related: #2953. Provide a method to access the current statusCode of a CMS controller.
2017-07-08 08:53:08 -06:00
Samuel Georges d1c160f9dc Check both instances to fix #1854
It appears there is no way around this. All directories should be lower case in October, prior to this, October wanted uppercase characters. Make up your mind guy, come on! ;-)
2017-07-01 12:26:55 +10:00
Samuel Georges 87f8f8feb1 Fixes inconsistency in component partial folder names
This is a breaking change that will require further attention - refs #1854

Eg: myComponent, the default component partial would use lower case folders
- /plugins/acme/test/components/mycomponent/default.htm

The theme component partial override would use case sensitive folders
- /themes/foobar/partials/myComponent/default.htm

This is fixed as
- /themes/foobar/partials/mycomponent/default.htm

Minor code fix to ModelBehavior class
2017-06-27 05:34:13 +10:00
Quezler cc17b679f1 Code dusting (#2826)
Code cleaning according to PSR-2 w/ exemptions (mostly dust).
2017-04-24 21:38:19 +10:00
Samuel Georges b2301a8056 Add new config cms.forceBytecodeInvalidation
Refs #2385
2017-01-31 07:23:58 +11:00
Samuel Georges 60c322cf46 Add note from #2620 2017-01-21 11:30:19 +11:00
Luke Towers 8fcc80b9e1 Support nested components
This adds proper support for nested components by saving the value of the existing component context and restoring it after rendering the desired component. Fixes octobercms/october#2619
2017-01-20 14:34:48 -06:00
Samuel Georges 0a2b343047 Simplify system events
This pipes all event calls through a new EventEmitter trait, which substitutes the October Rain event emitter trait. The view event has been moved to this trait also.
Pass some variables by reference to allow multi-extension.
Fixes #2420
2016-12-10 09:02:06 +11:00
Samuel Georges 1bdedb5584 Add renderPartial event to match renderContent
Fixes #2519
Fixes #2533
2016-12-09 08:15:32 +11:00
Samuel Georges 10326c2d63 Framework supports passing a "flash" option
This will request the Flash contents, if they are available. It also clears the flash bag contents, which is why this is an optional feature.
Introduced "ajaxValidation" event for capturing all invalid fields at once
2016-11-18 07:39:54 +11:00
Samuel Georges c8d8d4e931 Introduce new Cms helper
This is modeled after the Backend helper. Primarily used to generate URLs for the frontend, these are piped through the CmsController action. It would also be a good place to add a hook, if necessary later.
2016-08-20 14:43:49 +10:00
Samuel Georges 3698f13acb URL -> Url 2016-08-20 14:26:21 +10:00
Samuel Georges 556b951e63 Calling dynamic methods for extended components
In the spirit of #2288
2016-08-06 09:55:42 +10:00
Samuel Georges 78a4067564 Make logic more explicit
This tightens up the rules of 7baea87068
2016-07-23 15:50:48 +10:00
Samuel Georges 7baea87068 Allow AJAX handlers to pipe objects to Laravel
Treat non scalar, non array, non RedirectResponse, non null as a Laravel compatible response
This brings AJAX handlers in line with page cycles, which do the same thing if the response is not a string. However in AJAX we should treat any scalar as a "result", not just a string. For all else (where not null), let Laravel handle it as a custom response object -- could be a model for serialization, or anything compatible.
Importantly to note when a custom redirect is sent, October's workflow is completely wiped out, so any partial updates, redirects, etc. will not occur. This is a normal and fair expectation.
Fixes #1784
2016-07-23 11:57:15 +10:00
Samuel Georges e970d80443 Align AJAX logic: merge custom response last
This is to allow overriding the standard values
Refs #2209
2016-07-16 13:11:10 +10:00
Samuel Georges 0111100990 Shared view vars now passed to content blocks and mail templates 2016-06-04 07:26:16 +10:00
Samuel Georges ebc7929ada MaintenanceSettings -> MaintenanceSetting 2016-05-27 07:49:13 +10:00
Pásztor Gábor 9f3fcf27ed Update AssetsList 2016-03-30 18:17:18 +02:00
Samuel Georges 24a620e890 Convert CmsObject and CmsCompoundObject to use Halcyon
getFullPath -> getFilePath
2016-03-12 15:32:16 +11:00
Samuel Georges c34f72b821 Decouple ComponentPartial from CmsObject 2016-03-09 21:01:57 +11:00
Samuel Georges 07132ffbd6 Returns original setter functionality
To protected things like $this->page->title = "foo";
Template -> Bracket
2016-03-05 10:49:24 +11:00
Samuel Georges 136ec18084 This allows AJAX to function on maintenance and 404 pages 2016-02-27 22:39:26 +11:00
Samuel Georges d76863a3ec Merge branch 'develop' into stable
Conflicts:
	composer.json
2016-02-27 14:55:52 +11:00
Samuel Georges b88e78ffb4 Minor 2016-02-27 14:22:56 +11:00
Breno Douglas Araujo Souza ec03b7b2f8 Access paramater in onStart method in the partial
Variables passed in parameter partils not accessed in onStart method in the partial.

With merged vars before render partial, stays like this::

```php
function onStart() {
   $this['param'];
}
```
2016-02-27 14:18:22 +11:00
Samuel Georges acfb35cbed Merge branch 'develop' into stable 2016-02-10 20:03:51 +11:00
Samuel Georges 03e7c19a5d Fixes issue where twig passed null
Minor update to dropdown docs
2016-02-09 17:58:37 +11:00
Jens Herlevsen 2350e30853 Make default 404 page use 404 status code 2016-01-24 19:04:22 +01:00
Samuel Georges af4f42e208 Add 503 header when maintenance mode enabled.
Fixes #1655
2016-01-21 20:16:53 +11:00
Daniel Müller 01c63d6e32 fixed some PHPDocs
removed my prior changes to the code behaviour

removed errorous PHPDocs

fixed some PHPDocs

removed my prior changes to the code behaviour

removed errorous PHPDocs
2015-12-12 11:34:27 +11:00
Samuel Georges 3b4ee3340e * Build 305
Fix bug when property values are array
2015-10-17 14:52:50 +11:00
Vojta Svoboda 16eb704793 Add missing PHPDoc @return tag 2015-10-17 09:17:37 +11:00
Samuel Georges 91d3d4dbde Swap FileHelper methods for new Ini parser 2015-10-03 07:30:11 +10:00
Samuel Georges 51c7878e8f Fixes rendering 2 shared component partials nukes context 2015-08-30 11:56:44 +10:00
Samuel Georges 85933facbc Stack partials, store components, unstack partials - Fixes #1373
Fixes instances where nested repeating partials are destroying the partial component stack and causing breaking errors.
Nesting example:

Partial (with components)
^-> Calls component default markup
^-> Refers to partial override (with repeating partial calls)
^-> Calls another partial (with components)
^-> Components not found (destroyed by repeating calls above)
2015-08-15 11:05:30 +10:00
Samuel Georges f9c921a797 Adds getAjaxHandler() API to controllers
Fixes bug where update process fails midway
2015-06-30 08:56:53 +10:00
Samuel Georges cd1d62d8d7 AJAX requests can only use the POST method 2015-06-20 20:18:58 +10:00
Samuel Georges 8c6a58981e Roll back the changes from #852 in the name of KISS
The page vars are just that, view variables, if used incorrectly (relaxed) they can leech out
2015-06-17 18:50:51 +10:00
Samuel Georges 9e6d0a660c Simplify visibleViewBag + visibleSettings
hidden -> is_hidden
2015-06-05 17:24:27 +10:00
Samuel Georges 84da449d05 Fixes an infinite loop 2015-06-03 17:24:22 +10:00
Samuel Georges 4d057ba266 Fixes flaw in logic
Recompile JS from #1135
2015-05-16 09:57:40 +10:00
Samuel Georges 8b3ab93786 Component variables set with `$this->page` no longer leech in to other component partials.
Fixes #852
2015-05-16 09:29:27 +10:00
Samuel Georges e675866284 The |page filter now supports passing an empty string to generate a link to the current page. 2015-05-15 20:18:40 +10:00