CMSimple_XH
Public Member Functions | List of all members
XH\Publisher Class Reference

Reliable information about published and hidden pages. More...

Public Member Functions

 __construct (array $removed)
 Initializes a new instance. More...
 
 isPublished ($index)
 Returns whether a page is published. More...
 
 isHidden ($index)
 Returns whether a page is hidden. More...
 
 getFirstPublishedPage ()
 Returns the index of the first published page. More...
 

Detailed Description

Reliable information about published and hidden pages.

Publisher respects #cmsimple hide# and #cmsimple remove# as well as the page data fields linked_to_menu, published, publication_date and expires. Note that unpublishing via #cmsimple remove# cannot be detected by other means except for Publisher::isPublished(), because it is replaced during content loading. Also note that all pages are published and none is hidden in edit mode.

Author
Martin Damken konta.nosp@m.kt@z.nosp@m.eiche.nosp@m.nkom.nosp@m.binat.nosp@m..de
Jerry Jakobsfeld mail@.nosp@m.simp.nosp@m.lesol.nosp@m.utio.nosp@m.ns.dk
The CMSimple_XH developers devs@.nosp@m.cmsi.nosp@m.mple-.nosp@m.xh.o.nosp@m.rg
Since
1.7

Constructor & Destructor Documentation

◆ __construct()

XH\Publisher::__construct ( array  $removed)

Initializes a new instance.

Parameters
bool[]$removedThe removed status of the pages.

Member Function Documentation

◆ getFirstPublishedPage()

XH\Publisher::getFirstPublishedPage ( )

Returns the index of the first published page.

Returns
int -1 if no page is published

◆ isHidden()

XH\Publisher::isHidden (   $index)

Returns whether a page is hidden.

A page may be hidden either by #cmsimple hide# or via the page data field linked_to_menu. Note that unpublished pages are not reported as being hidden by this method. Note that all descendants of a hidden page are also regarded as being hidden.

Parameters
int$indexA page index.
Returns
bool

◆ isPublished()

XH\Publisher::isPublished (   $index)

Returns whether a page is published.

A page may be unpublished either by #cmsimple remove# or via the page data fields published, publication_date and expires. Note that all descendants of an unpublished page are also regarded as being unpublished.

Parameters
int$indexA page index.
Returns
bool

The documentation for this class was generated from the following file: