mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 11:14:12 +02:00
Fix issue processwire/processwire-issues#819
This commit is contained in:
@@ -307,6 +307,18 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
'editCrumbs' => false,
|
'editCrumbs' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Other core page classes
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected $otherCorePageClasses = array(
|
||||||
|
'User',
|
||||||
|
'Role',
|
||||||
|
'Permission',
|
||||||
|
'Language'
|
||||||
|
);
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
/***********************************************************************************************************************
|
||||||
* METHODS
|
* 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->viewable() && !$this->requestModal) $this->buildFormView($this->getViewUrl());
|
||||||
|
|
||||||
if($this->page->hasStatus(Page::statusUnpublished)) {
|
if($this->page->hasStatus(Page::statusUnpublished)) {
|
||||||
|
$pageClassName = wireClassName($this->page, false);
|
||||||
if(wireClassName($this->page, false) == 'Page') {
|
$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 */
|
/** @var InputfieldSubmit $submit2 */
|
||||||
$submit2 = $this->modules->get('InputfieldSubmit');
|
$submit2 = $this->modules->get('InputfieldSubmit');
|
||||||
$submit2->attr('name', 'submit_save');
|
$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';
|
$saveName = 'submit_publish';
|
||||||
$saveLabel = $this->_("Publish"); // Button: publish
|
$saveLabel = $this->_("Publish"); // Button: publish
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user