<pageType>text</pageType>
<name language="de">Dashboard</name>
<name language="en">Dashboard</name>
+ <availableDuringOfflineMode>1</availableDuringOfflineMode>
<content>
<title>Dashboard</title>
<pageType>text</pageType>
<name language="en">Cookie Policy</name>
<name language="de">Cookie-Richtlinie</name>
+ <availableDuringOfflineMode>1</availableDuringOfflineMode>
<content language="en">
<title>Cookie Policy</title>
</dl>
{/if}
+ <dl>
+ <dt></dt>
+ <dd>
+ <label><input type="checkbox" id="availableDuringOfflineMode" name="availableDuringOfflineMode" value="1"{if $availableDuringOfflineMode} checked{/if}> {lang}wcf.acp.page.availableDuringOfflineMode{/lang}</label>
+ </dd>
+ </dl>
+
{event name='dataFields'}
</div>
</div>
*/
public $cssClassName = '';
+ /**
+ * true if the page is available during offline mode
+ * @var boolean
+ */
+ public $availableDuringOfflineMode = 0;
+
/**
* @inheritDoc
*/
if (isset($_POST['cssClassName'])) $this->cssClassName = StringUtil::trim($_POST['cssClassName']);
if (isset($_POST['isDisabled'])) $this->isDisabled = 1;
if (isset($_POST['isLandingPage'])) $this->isLandingPage = 1;
+ if (isset($_POST['availableDuringOfflineMode'])) $this->availableDuringOfflineMode = 1;
if (isset($_POST['applicationPackageID'])) $this->applicationPackageID = intval($_POST['applicationPackageID']);
if (isset($_POST['customURL']) && is_array($_POST['customURL'])) $this->customURL = array_map('mb_strtolower', ArrayUtil::trim($_POST['customURL']));
'cssClassName' => $this->cssClassName,
'isDisabled' => $this->isDisabled ? 1 : 0,
'isLandingPage' => 0,
+ 'availableDuringOfflineMode' => $this->availableDuringOfflineMode,
'applicationPackageID' => $this->applicationPackageID,
'lastUpdateTime' => TIME_NOW,
'isMultilingual' => $this->isMultilingual,
WCF::getTPL()->assign('success', true);
// reset variables
- $this->parentPageID = $this->isDisabled = $this->isLandingPage = 0;
+ $this->parentPageID = $this->isDisabled = $this->isLandingPage = $this->availableDuringOfflineMode = 0;
$this->applicationPackageID = 1;
$this->cssClassName = $this->name = '';
$this->customURL = $this->title = $this->content = $this->metaDescription = $this->metaKeywords = $this->boxIDs = $this->aclValues = [];
'cssClassName' => $this->cssClassName,
'isDisabled' => $this->isDisabled,
'isLandingPage' => $this->isLandingPage,
+ 'availableDuringOfflineMode' => $this->availableDuringOfflineMode,
'isMultilingual' => $this->isMultilingual,
'applicationPackageID' => $this->applicationPackageID,
'customURL' => $this->customURL,
'isDisabled' => $this->isDisabled ? 1 : 0,
'lastUpdateTime' => TIME_NOW,
'parentPageID' => $this->parentPageID ?: null,
- 'applicationPackageID' => $this->applicationPackageID
+ 'applicationPackageID' => $this->applicationPackageID,
+ 'availableDuringOfflineMode' => $this->availableDuringOfflineMode
];
if ($this->pageType == 'system') {
if ($this->page->controllerCustomURL) $this->customURL[0] = $this->page->controllerCustomURL;
if ($this->page->isLandingPage) $this->isLandingPage = 1;
if ($this->page->isDisabled) $this->isDisabled = 1;
+ if ($this->page->availableDuringOfflineMode) $this->availableDuringOfflineMode = 1;
foreach ($this->page->getPageContents() as $languageID => $content) {
$this->title[$languageID] = $content->title;
* @package WoltLabSuite\Core\Data\Page
* @since 3.0
*
- * @property-read integer $pageID unique id of the page
- * @property-read integer|null $parentPageID id of the page's parent page or `null` if it has no parent page
- * @property-read string $identifier unique textual identifier of the page
- * @property-read string $name monolingual name of the page shown in the ACP
- * @property-read string $pageType type of the page, default types: `text`, `html`, `tpl` `system`
- * @property-read integer $isDisabled is `1` if the page is disabled and thus cannot be accessed, otherwise `0`
- * @property-read integer $isLandingPage is `1` if the page is the landing page, otherwise `0`
- * @property-read integer $isMultilingual is `1` if the page is available in different languages, otherwise `0`
- * @property-read integer $originIsSystem is `1` if the page has been delivered by a package, otherwise `0` (i.e. the page has been created in the ACP)
- * @property-read integer $packageID id of the package the which delivers the page or `1` if it has been created in the ACP
- * @property-read integer $applicationPackageID id of the package of the application the pages belongs to
- * @property-read string $controller name of the page controller class
- * @property-read string $handler name of the page handler class for `system` pages or empty
- * @property-read string $controllerCustomURL custom url of the page
- * @property-read integer $requireObjectID is `1` if the page requires an object id parameter, otherwise `0`
- * @property-read integer $hasFixedParent is `1` if the page's parent page cannot be changed, otherwise `0`
- * @property-read integer $lastUpdateTime timestamp at which the page has been updated the last time
- * @property-read string $cssClassName css class name(s) of the page
- * @property-read string $permissions comma separated list of user group permissions of which the active user needs to have at least one to access the page
- * @property-read string $options comma separated list of options of which at least one needs to be enabled for the page to be accessible
+ * @property-read integer $pageID unique id of the page
+ * @property-read integer|null $parentPageID id of the page's parent page or `null` if it has no parent page
+ * @property-read string $identifier unique textual identifier of the page
+ * @property-read string $name monolingual name of the page shown in the ACP
+ * @property-read string $pageType type of the page, default types: `text`, `html`, `tpl` `system`
+ * @property-read integer $isDisabled is `1` if the page is disabled and thus cannot be accessed, otherwise `0`
+ * @property-read integer $isLandingPage is `1` if the page is the landing page, otherwise `0`
+ * @property-read integer $isMultilingual is `1` if the page is available in different languages, otherwise `0`
+ * @property-read integer $originIsSystem is `1` if the page has been delivered by a package, otherwise `0` (i.e. the page has been created in the ACP)
+ * @property-read integer $packageID id of the package the which delivers the page or `1` if it has been created in the ACP
+ * @property-read integer $applicationPackageID id of the package of the application the pages belongs to
+ * @property-read string $controller name of the page controller class
+ * @property-read string $handler name of the page handler class for `system` pages or empty
+ * @property-read string $controllerCustomURL custom url of the page
+ * @property-read integer $requireObjectID is `1` if the page requires an object id parameter, otherwise `0`
+ * @property-read integer $hasFixedParent is `1` if the page's parent page cannot be changed, otherwise `0`
+ * @property-read integer $lastUpdateTime timestamp at which the page has been updated the last time
+ * @property-read string $cssClassName css class name(s) of the page
+ * @property-read string $availableDuringOfflineMode is `1` if the page is available during offline mode, otherwise `0`
+ * @property-read string $permissions comma separated list of user group permissions of which the active user needs to have at least one to access the page
+ * @property-read string $options comma separated list of options of which at least one needs to be enabled for the page to be accessible
*/
class Page extends DatabaseObject implements ILinkableObject, ITitledObject {
use TDatabaseObjectOptions;
'options' => isset($data['elements']['options']) ? $data['elements']['options'] : '',
'permissions' => isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '',
'hasFixedParent' => ($pageType == 'system' && !empty($data['elements']['hasFixedParent'])) ? 1 : 0,
- 'cssClassName' => isset($data['elements']['cssClassName']) ? $data['elements']['cssClassName'] : ''
+ 'cssClassName' => isset($data['elements']['cssClassName']) ? $data['elements']['cssClassName'] : '',
+ 'availableDuringOfflineMode' => (!empty($data['elements']['availableDuringOfflineMode'])) ? 1 : 0
];
}
return true;
}
+ if ($this->getPageID() && ($page = PageCache::getInstance()->getPage($this->getPageID()))) {
+ if ($page->availableDuringOfflineMode) return true;
+ }
+
return false;
}
<item name="wcf.acp.page.type.tpl.description"><![CDATA[Eingabemöglichkeit entspricht dem Typ „HTML“, zusätzlich wird Template-Scripting unterstützt.]]></item>
<item name="wcf.acp.page.url"><![CDATA[URL]]></item>
<item name="wcf.acp.page.cssClassName"><![CDATA[CSS-Klassen]]></item>
+ <item name="wcf.acp.page.availableDuringOfflineMode"><![CDATA[Seite ist im Wartungsmodus aufrufbar]]></item>
</category>
<category name="wcf.acp.paidSubscription">
<item name="wcf.acp.page.type.tpl.description"><![CDATA[Similar to the type “HTML”, but offers additional support for template scripting.]]></item>
<item name="wcf.acp.page.url"><![CDATA[URL]]></item>
<item name="wcf.acp.page.cssClassName"><![CDATA[CSS Class Name]]></item>
+ <item name="wcf.acp.page.availableDuringOfflineMode"><![CDATA[Page is available during maintenance mode]]></item>
</category>
<category name="wcf.paidSubscription">
hasFixedParent TINYINT(1) NOT NULL DEFAULT 0,
lastUpdateTime INT(10) NOT NULL DEFAULT 0,
cssClassName VARCHAR(255) NOT NULL DEFAULT '',
+ availableDuringOfflineMode TINYINT(1) NOT NULL DEFAULT 0,
permissions TEXT NULL,
options TEXT NULL
);