Close #77: Partially integrate page_params into the core #189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At least the basic functionality regarding publishing and hiding of
pages (i.e. the page_params alternatives to
#cmsimple hide#
and#cmsimple remove#
) shouldn't be handled by a plugin, but rather bythe core, because:
#cmsimple remove#
can't be detected by a plugin as it is alreadyconverted during content loading
hide()
may yield wrong resultshidden or unpublished
Therefore, we extract the functionality to detect whether a page is
hidden and published into the new class Publisher whose sole instance
is globally available as
$xh_publisher
. As Publisher is perfectlycapable to determine the first published page, we don't have to track
that in the global
$_XH_firstPublishedPage
anymore, so we remove thisvariable, what is a potential BC break, but we're convinced that the
benefits of encapsulating the hide/unpublish functionality in a class
clearly outweighs the drawbacks of this BC break.
Future scope: Publisher may also take the responsibility to modify the
page content for unpublished and hidden pages, and might offer an API
for third-party plugins to mark pages as hidden or unpublished.