diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2024-08-19 07:49:14 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2024-08-19 07:49:14 +0000 |
commit | d44e6bc2dd86001fadf5592bffb67064c4ed45b0 (patch) | |
tree | e4c4f3b8cb5edd0629c45f35a953a6ce85334bef /scripts | |
parent | 518816864cb94c38a7ececcff8d86e4752ba6734 (diff) | |
download | pmwiki.svn-d44e6bc2dd86001fadf5592bffb67064c4ed45b0.tar.bz2 |
(:input e_minorcheckbox:) to include label and title per $EnableMergeLastMinorEdit, update Site.EditForm.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4789 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/forms.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/forms.php b/scripts/forms.php index 3c700415..cca5064a 100644 --- a/scripts/forms.php +++ b/scripts/forms.php @@ -394,9 +394,25 @@ SDVA($InputTags['e_changesummary'], array( 'value' => PHSC(stripmagic(@$_POST['csum']), ENT_QUOTES))); SDVA($InputTags['e_minorcheckbox'], array( ':html' => "<input type='checkbox' \$InputFormArgs />\$InputFormLabel", - 'name' => 'diffclass', 'value' => 'minor')); + 'name' => 'diffclass', 'value' => 'minor', + 'label'=>PHSC(XL('This is a minor edit'), ENT_QUOTES))); if (@$_POST['diffclass']=='minor') SDV($InputTags['e_minorcheckbox']['checked'], 'checked'); + +if (IsEnabled($EnableMergeLastMinorEdit, 0)>=1 && @$Author && PageExists($pagename)) { + if ($EnableMergeLastMinorEdit >= 120) { + $ltime = intval(PageVar($pagename, '$LastModifiedTime'))+$EnableMergeLastMinorEdit; + $samehost = PageVar($pagename, '$LastModifiedHost') == $_SERVER['REMOTE_ADDR']; + } + if ($EnableMergeLastMinorEdit < 120 || ($ltime>$Now && $samehost)) { + $InputTags['e_minorcheckbox']['label'] .= + " " . PHSC(XL('(merge with previous edit)'), ENT_QUOTES); + SDV($InputTags['e_minorcheckbox']['title'], + PHSC(XL('Merge the new edit with the last one, if by the same author, and reuse the change summary if left empty'), ENT_QUOTES)); + } +} +unset($ltime, $sameby, $samehost); + SDVA($InputTags['e_savebutton'], array( ':html' => "<input type='submit' \$InputFormArgs />", 'name' => 'post', 'value' => ' '.XL('Save').' ', |