{/hascontent}
</footer>
+{if $page->showShareButtons()}
+ {capture assign='footerBoxes'}
+ <section class="box boxFullWidth jsOnly">
+ <h2 class="boxTitle">{lang}wcf.message.share{/lang}</h2>
+
+ <div class="boxContent">
+ {include file='shareButtons'}
+ </div>
+ </section>
+ {/capture}
+{/if}
+
{include file='footer'}
</dd>
</dl>
- {if $action == 'add'}
+ {if $action === 'add'}
<dl>
<dt></dt>
<dd>
</dl>
{/if}
+ {if $pageType !== 'system'}
+ <dl>
+ <dt></dt>
+ <dd>
+ <label><input type="checkbox" id="enableShareButtons" name="enableShareButtons" value="1"{if $enableShareButtons} checked{/if}> {lang}wcf.acp.page.enableShareButtons{/lang}</label>
+ </dd>
+ </dl>
+ {/if}
+
{event name='dataFields'}
</div>
</div>
* parent menu item id
* @var integer
*/
- public $parentMenuItemID = null;
+ public $parentMenuItemID;
/**
* menu item node tree
* @var MenuItemNodeTree
*/
- public $menuItems = null;
+ public $menuItems;
+
+ /**
+ * @var bool
+ * @since 3.2
+ */
+ public $enableShareButtons = 0;
/**
* @inheritDoc
if (isset($_POST['addPageToMainMenu'])) $this->addPageToMainMenu = 1;
if (isset($_POST['applicationPackageID'])) $this->applicationPackageID = intval($_POST['applicationPackageID']);
if (!empty($_POST['parentMenuItemID'])) $this->parentMenuItemID = intval($_POST['parentMenuItemID']);
+ if (isset($_POST['enableShareButtons'])) $this->enableShareButtons = 1;
if (isset($_POST['customURL']) && is_array($_POST['customURL'])) $this->customURL = array_map('mb_strtolower', ArrayUtil::trim($_POST['customURL']));
if (isset($_POST['title']) && is_array($_POST['title'])) $this->title = ArrayUtil::trim($_POST['title']);
$this->validateBoxIDs();
- if ($this->pageType == 'text') {
+ if ($this->pageType === 'text') {
if ($this->isMultilingual) {
foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
$this->htmlInputProcessors[$language->languageID] = new HtmlInputProcessor();
'isLandingPage' => 0,
'availableDuringOfflineMode' => $this->availableDuringOfflineMode,
'allowSpidersToIndex' => $this->allowSpidersToIndex,
+ 'enableShareButtons' => $this->enableShareButtons,
'applicationPackageID' => $this->applicationPackageID,
'lastUpdateTime' => TIME_NOW,
'isMultilingual' => $this->isMultilingual,
WCF::getTPL()->assign('success', true);
// reset variables
- $this->parentPageID = $this->isDisabled = $this->isLandingPage = $this->availableDuringOfflineMode = 0;
+ $this->parentPageID = $this->isDisabled = $this->isLandingPage = $this->availableDuringOfflineMode = $this->enableShareButtons = 0;
$this->applicationPackageID = 1;
$this->cssClassName = $this->name = '';
$this->customURL = $this->title = $this->content = $this->metaDescription = $this->metaKeywords = $this->aclValues = [];
'aclValues' => SimpleAclHandler::getInstance()->getOutputValues($this->aclValues),
'addPageToMainMenu' => $this->addPageToMainMenu,
'parentMenuItemID' => $this->parentMenuItemID,
- 'menuItemNodeList' => $this->menuItems->getNodeList()
+ 'menuItemNodeList' => $this->menuItems->getNodeList(),
+ 'enableShareButtons' => $this->enableShareButtons
]);
}
}
'parentPageID' => $this->parentPageID ?: null,
'applicationPackageID' => $this->applicationPackageID,
'availableDuringOfflineMode' => $this->availableDuringOfflineMode,
- 'allowSpidersToIndex' => $this->allowSpidersToIndex
+ 'allowSpidersToIndex' => $this->allowSpidersToIndex,
+ 'enableShareButtons' => $this->enableShareButtons
];
if ($this->pageType == 'system') {
if ($this->page->availableDuringOfflineMode) $this->availableDuringOfflineMode = 1;
if ($this->page->allowSpidersToIndex) $this->allowSpidersToIndex = 1;
else $this->allowSpidersToIndex = 0;
+ $this->enableShareButtons = $this->page->enableShareButtons;
foreach ($this->page->getPageContents() as $languageID => $content) {
$this->title[$languageID] = $content->title;
* @property-read string $availableDuringOfflineMode is `1` if the page is available during offline mode, otherwise `0`
* @property-read string $allowSpidersToIndex is `1` if the page is accessible for search spiders, otherwise `0`
* @property-read string $excludeFromLandingPage is `1` if the page can never be set as landing page, otherwise `0`
+ * @property-read string $enableShareButtons is `1` if the page should display share buttons, 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
*/
return $pageLanguages;
}
+ /**
+ * Returns true if the share buttons are enabled and this is not a system-type page.
+ *
+ * @return bool
+ * @since 3.2
+ */
+ public function showShareButtons(): bool {
+ return $this->enableShareButtons && $this->pageType !== 'system';
+ }
+
/**
* Returns the page with the given identifier.
*
<item name="wcf.acp.page.addPageToMainMenu"><![CDATA[Seite automatisch in das Hauptmenü aufnehmen]]></item>
<item name="wcf.acp.page.lastVersion"><![CDATA[Es gibt <a href="{link controller='VersionTrackerList' objectType='com.woltlab.wcf.page' objectID=$page->pageID}{/link}">vorherige Versionen</a> dieser Seite, die letzte Änderung erfolgte durch <a href="{link controller='UserEdit' id=$lastVersion->userID}{/link}">{$lastVersion->username}</a> ({@$lastVersion->time|time}).]]></item>
<item name="wcf.acp.page.originIsNotSystem"><![CDATA[Eigene Seiten]]></item>
+ <item name="wcf.acp.page.enableShareButtons"><![CDATA[Teilen-Buttons für diese Seite aktivieren]]></item>
</category>
<category name="wcf.acp.paidSubscription">
<item name="wcf.acp.page.addPageToMainMenu"><![CDATA[Add page to main menu]]></item>
<item name="wcf.acp.page.lastVersion"><![CDATA[There are <a href="{link controller='VersionTrackerList' objectType='com.woltlab.wcf.page' objectID=$page->pageID}{/link}">previous versions</a> of this page, the last change was by <a href="{link controller='UserEdit' id=$lastVersion->userID}{/link}">{$lastVersion->username}</a> ({@$lastVersion->time|time}).]]></item>
<item name="wcf.acp.page.originIsNotSystem"><![CDATA[Custom pages only]]></item>
+ <item name="wcf.acp.page.enableShareButtons"><![CDATA[Enable the share buttons for this page]]></item>
</category>
<category name="wcf.paidSubscription">
availableDuringOfflineMode TINYINT(1) NOT NULL DEFAULT 0,
allowSpidersToIndex TINYINT(1) NOT NULL DEFAULT 0,
excludeFromLandingPage TINYINT(1) NOT NULL DEFAULT 0,
+ enableShareButtons TINYINT(1) NOT NULL DEFAULT 0,
permissions TEXT NULL,
options TEXT NULL
);