Skip to content

Commit 9062ad3

Browse files
author
mutec
committed
fix PHP 5 issue
1 parent 60207ad commit 9062ad3

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

files/lib/data/content/Content.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Content extends DatabaseObject implements IRouteController, IPollObject, I
5252
/**
5353
* @var string[]
5454
*/
55-
const AVAILABLE_POSITIONS = ['hero', 'headerBoxes', 'top', 'sidebarLeft', 'body', 'sidebarRight', 'bottom', 'footerBoxes', 'footer'];
55+
public static $AVAILABLE_POSITIONS = ['hero', 'headerBoxes', 'top', 'sidebarLeft', 'body', 'sidebarRight', 'bottom', 'footerBoxes', 'footer'];
5656

5757
/**
5858
* @var \wcf\data\object\type\ObjectType

files/lib/data/content/ContentAction.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function validateGetAddDialog() {
207207

208208
//validate position
209209
else if (!empty($this->parameters['position']) && $this->parameters['position'] == 'sidebar') $this->parameters['position'] = 'sidebarRight';
210-
if (!isset($this->parameters['position']) || !in_array($this->parameters['position'], Content::AVAILABLE_POSITIONS)) throw new UserInputException('position');
210+
if (!isset($this->parameters['position']) || !in_array($this->parameters['position'], Content::$AVAILABLE_POSITIONS)) throw new UserInputException('position');
211211

212212
//validate parent
213213
if (isset($this->parameters['parentID']) && $this->parameters['parentID'] != 0) {

files/lib/data/page/Page.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public function getChildrenTree($maxDepth = -1) {
210210
* @return \cms\data\content\DrainedPositionContentNodeTree[]
211211
*/
212212
public function getContents() {
213-
$availablePositions = Content::AVAILABLE_POSITIONS;
213+
$availablePositions = Content::$AVAILABLE_POSITIONS;
214214
$contentList = [];
215215

216216
foreach ($availablePositions as $position) {

files/lib/data/page/PageAction.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ public function getContentTypes() {
647647
$types = ObjectTypeCache::getInstance()->getObjectTypes('de.codequake.cms.content.type');
648648
foreach ($types as $key => $type) {
649649
if (!$this->parameters['position'] == 'both') {
650-
foreach (Content::AVAILABLE_POSITIONS as $position) {
650+
foreach (Content::$AVAILABLE_POSITIONS as $position) {
651651
if (!$type->getProcessor()->isAvailableToAdd($position)) break;
652652
}
653653
} else if (!$type->getProcessor()->isAvailableToAdd($this->parameters['position'])) {

files/lib/page/AbstractCMSPage.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function readData() {
140140
$this->contentNodeTrees = $this->page->getContents();
141141
} else {
142142
$contents = $this->page->getContents();
143-
foreach (Content::AVAILABLE_POSITIONS as $position) {
143+
foreach (Content::$AVAILABLE_POSITIONS as $position) {
144144
$this->contentNodeTrees[$position] = !empty($contents[$position]) ? $contents[$position] : [];
145145
}
146146
}

0 commit comments

Comments
 (0)