1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 10:15:28 +02:00
This commit is contained in:
Ryan Cramer
2019-02-28 12:59:32 -05:00
parent e73c2343d1
commit 7dbdcec2a0

View File

@@ -307,6 +307,18 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
'editCrumbs' => false,
);
/**
* Other core page classes
*
* @var array
*
*/
protected $otherCorePageClasses = array(
'User',
'Role',
'Permission',
'Language'
);
/***********************************************************************************************************************
* METHODS
@@ -911,8 +923,12 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
if($this->page->viewable() && !$this->requestModal) $this->buildFormView($this->getViewUrl());
if($this->page->hasStatus(Page::statusUnpublished)) {
if(wireClassName($this->page, false) == 'Page') {
$pageClassName = wireClassName($this->page, false);
$publishable = $this->page->publishable();
if($publishable && (in_array($pageClassName, $this->otherCorePageClasses) || $this->page->template->noUnpublish)) {
// Do not show a button allowing page to remain unpublished for User, Permission, Role, Language or
// if the page's template indicates it cannot be unpublished
} else {
/** @var InputfieldSubmit $submit2 */
$submit2 = $this->modules->get('InputfieldSubmit');
$submit2->attr('name', 'submit_save');
@@ -926,7 +942,7 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
}
}
if($this->page->publishable()) {
if($publishable) {
$saveName = 'submit_publish';
$saveLabel = $this->_("Publish"); // Button: publish
} else {