mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 18:24:57 +02:00
Minor updates in ProcessPageEdit "who can view" section
This commit is contained in:
@@ -90,20 +90,4 @@ function initPageEditForm() {
|
|||||||
$title.text(val.length > 0 ? val : title);
|
$title.text(val.length > 0 ? val : title);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
$('#ProcessPageEdit').on('submit', function() {
|
|
||||||
var changes = [];
|
|
||||||
$('.InputfieldStateChanged').each(function() {
|
|
||||||
var name = $(this).attr('id');
|
|
||||||
if(name.indexOf('wrap_Inputfield_') === 0) {
|
|
||||||
name = name.replace('wrap_Inputfield_', '');
|
|
||||||
} else if(name.indexOf('wrap_') === 0) {
|
|
||||||
name = name.substring(5);
|
|
||||||
}
|
|
||||||
changes.push(name);
|
|
||||||
$('#_page_edit_changes').val(changes.join(','));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
@@ -1855,6 +1855,8 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
/** @var MarkupAdminDataTable $table */
|
/** @var MarkupAdminDataTable $table */
|
||||||
$table = $this->modules->get("MarkupAdminDataTable");
|
$table = $this->modules->get("MarkupAdminDataTable");
|
||||||
|
|
||||||
|
$pageHasTemplateFile = $this->page->template->filenameExists();
|
||||||
|
|
||||||
if($this->input->get('renderInputfieldAjax') == 'ProcessPageEditRoles') {
|
if($this->input->get('renderInputfieldAjax') == 'ProcessPageEditRoles') {
|
||||||
$roles = $this->page->getAccessRoles();
|
$roles = $this->page->getAccessRoles();
|
||||||
$accessTemplate = $this->page->getAccessTemplate('edit');
|
$accessTemplate = $this->page->getAccessTemplate('edit');
|
||||||
@@ -1884,7 +1886,7 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
$permissions = array();
|
$permissions = array();
|
||||||
$roleName = $role->name;
|
$roleName = $role->name;
|
||||||
if($roleName == 'guest') $roleName .= " " . $this->_('(everyone)'); // Identifies who guest is (everyone)
|
if($roleName == 'guest') $roleName .= " " . $this->_('(everyone)'); // Identifies who guest is (everyone)
|
||||||
$permissions["page-view"] = 'view';
|
$permissions["page-view"] = 'view' . ($pageHasTemplateFile ? '' : '¹');
|
||||||
|
|
||||||
$checkEditable = true;
|
$checkEditable = true;
|
||||||
if($hasPublishPermission && !$this->page->hasStatus(Page::statusUnpublished)
|
if($hasPublishPermission && !$this->page->hasStatus(Page::statusUnpublished)
|
||||||
@@ -1938,10 +1940,13 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
|
|
||||||
$accessParent = $this->page->getAccessParent();
|
$accessParent = $this->page->getAccessParent();
|
||||||
if($accessParent === $this->page) {
|
if($accessParent === $this->page) {
|
||||||
$field->notes = sprintf($this->_('Access is defined with this page\'s template: %s'), $accessParent->template); // Where access is defined: with this page's template
|
$field->notes = sprintf($this->_('Access is defined with this page’s template: %s'), $accessParent->template); // Where access is defined: with this page's template
|
||||||
} else {
|
} else {
|
||||||
$field->notes = sprintf($this->_('Access is inherited from page "%1$s" and defined with template: %2$s'), $accessParent->path, $accessParent->template); // Where access is defined: inherited from a parent
|
$field->notes = sprintf($this->_('Access is inherited from page "%1$s" and defined with template: %2$s'), $accessParent->path, $accessParent->template); // Where access is defined: inherited from a parent
|
||||||
}
|
}
|
||||||
|
if(!$pageHasTemplateFile) {
|
||||||
|
$field->notes = trim("¹ " . $this->_('Viewable by its URL if page had a template file (it does not currently).') . "\n$field->notes");
|
||||||
|
}
|
||||||
|
|
||||||
return $field;
|
return $field;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user