42 private $published = array();
49 private $hidden = array();
67 $pd_router->add_interest(
'published');
68 $pd_router->add_interest(
'publication_date');
69 $pd_router->add_interest(
'expires');
70 $pd_router->add_interest(
'linked_to_menu');
72 $this->hidden = array_fill(0, $cl,
false);
73 $this->published = array_fill(0, $cl,
true);
75 foreach ($pd_router->find_all() as $index => $data) {
76 $this->hidden[$index] = $data[
'linked_to_menu'] ==
'0' 77 || !$removed[$index] &&
hide($index);
78 $this->published[$index] = !$removed[$index]
79 && $this->isPublishedInPageData($data);
82 $this->pages =
new Pages;
100 while (isset($parent) && $this->published[$parent]) {
101 $parent = $this->pages->parent($parent,
false);
103 if (isset($parent)) {
106 return $this->published[$index];
124 while (isset($parent) && !$this->hidden[$parent]) {
125 $parent = $this->pages->parent($parent,
false);
127 if (isset($parent)) {
130 return $this->hidden[$index];
140 for (
$i = 0;
$i < $this->pages->getCount();
$i++) {
141 if ($this->isPublished(
$i)) {
155 private function isPublishedInPageData(array $data)
157 if ($data[
'published'] ==
'0') {
160 $publication_date = isset($data[
'publication_date'])
161 ? trim($data[
'publication_date'])
163 $expires = isset($data[
'expires']) ? trim($data[
'expires']) :
'';
164 if ($expires !=
'' || $publication_date !=
'') {
166 $maxInt = defined(
'PHP_INT_MAX') ? PHP_INT_MAX : 2147483647;
167 $int_publication_date = ($publication_date !=
'')
168 ? strtotime($publication_date) : 0;
169 $int_expiration_date = ($expires !=
'')
170 ? strtotime($expires) : $maxInt;
171 if ($current <= $int_publication_date
172 || $current >= $int_expiration_date
__construct(array $removed)