Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close #77: Partially integrate page_params into the core #189

Merged
merged 1 commit into from
Apr 21, 2017

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Apr 2, 2017

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 by
the core, because:

  • #cmsimple remove# can't be detected by a plugin as it is already
    converted during content loading
  • during plugin loading hide() may yield wrong results
  • other plugins should have a simple means to detect whether a page is
    hidden 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 perfectly
capable to determine the first published page, we don't have to track
that in the global $_XH_firstPublishedPage anymore, so we remove this
variable, 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.

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 by
the core, because:

* `#cmsimple remove#` can't be detected by a plugin as it is already
  converted during content loading
* during plugin loading `hide()` may yield wrong results
* other plugins should have a simple means to detect whether a page is
  hidden 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 perfectly
capable to determine the first published page, we don't have to track
that in the global `$_XH_firstPublishedPage` anymore, so we remove this
variable, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant