mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 16:54:44 +02:00
Fix issue where language on/off checkbox in ProcessPageAdd wasn't always mirring parent page language on/off status for initial/recommended setting
This commit is contained in:
@@ -200,9 +200,11 @@ class InputfieldPageName extends InputfieldName implements ConfigurableModule {
|
||||
$name = $sanitizer->entities($this->checkboxName);
|
||||
$value = $sanitizer->entities($this->checkboxValue);
|
||||
$label = $sanitizer->entities($this->checkboxLabel);
|
||||
$adminTheme = $this->wire()->adminTheme;
|
||||
$checkboxClass = $adminTheme ? $adminTheme->getClass('input-checkbox') : '';
|
||||
$box =
|
||||
"<label class='checkbox detail'>" .
|
||||
"<input type='checkbox' name='$name{$this->checkboxSuffix}' value='$value'$checked$disabled /> $label" .
|
||||
"<input type='checkbox' class='$checkboxClass' name='$name{$this->checkboxSuffix}' value='$value'$checked$disabled /> $label" .
|
||||
"</label>";
|
||||
}
|
||||
|
||||
|
@@ -521,7 +521,11 @@ class LanguageSupportPageNames extends WireData implements Module, ConfigurableM
|
||||
$inputfield->checkboxName = "status" . $language->id;
|
||||
$inputfield->checkboxValue = 1;
|
||||
$inputfield->checkboxLabel = $checkboxLabel;
|
||||
if($page->id > 0) $inputfield->checkboxChecked = $page->get($inputfield->checkboxName) > 0;
|
||||
if($page->id > 0) {
|
||||
$inputfield->checkboxChecked = $page->get($inputfield->checkboxName) > 0;
|
||||
} else if($inputfield->parentPage) {
|
||||
$inputfield->checkboxChecked = $inputfield->parentPage->get($inputfield->checkboxName) > 0;
|
||||
}
|
||||
if(!$editable) $inputfield->attr('disabled', 'disabled');
|
||||
$out .= $inputfield->render();
|
||||
}
|
||||
|
@@ -835,10 +835,6 @@ class ProcessPageAdd extends Process implements ConfigurableModule, WirePageEdit
|
||||
|
||||
/** @var Languages $languages */
|
||||
if($languages && $this->parent && $this->parent_id > 0) {
|
||||
foreach($languages as $language) {
|
||||
if($language->isDefault()) continue;
|
||||
$field->checkboxChecked = $this->parent->get("status$language") ? true : false;
|
||||
}
|
||||
if($this->template) {
|
||||
// dummy edit page for examination by InputfieldPageName
|
||||
$editPage = $this->wire('pages')->newPage(array(
|
||||
|
Reference in New Issue
Block a user