[pmwiki-users] Minor edit

Hans design5 at softflow.co.uk
Mon Nov 20 11:18:12 CST 2006


Monday, November 20, 2006, 3:27:36 PM, Mark wrote:

> Is there a way I can add another button 'Major edit' ext to 'minor edit' and
> force the editor to click one of the two buttons

You could have radio buttons instead of the minor_edit checkbox.
You would need to define these in config.php:

$InputTags['e_majorradio'] = array(
  ':html' => "<input type='radio' \$InputFormArgs />",
  'name' => 'diffclass', 'value' => 'major');
$InputTags['e_minorradio'] = array(
  ':html' => "<input type='radio' \$InputFormArgs />",
  'name' => 'diffclass', 'value' => 'minor');
if (@$_POST['diffclass']=='major') 
  $InputTags['e_minorradio']['checked'] = '';     
  $InputTags['e_majorradio']['checked'] = 'checked'; 
if (@$_POST['diffclass']=='minor') 
  $InputTags['e_minorradio']['checked'] = 'checked';     
  $InputTags['e_majorradio']['checked'] = '';

and then edit your Site.EditForm or whatever editform you use,
replacing
(:input e_minorcheckbox:) $[This is a minor edit]\\

with
(:input e_minorradio:) $[This is a minor edit]\\
(:input e_majorradio:) $[This is a major edit]\\

Change the text displayed, put them on the same line or whatever you
fancy.

I don't know if this is the shortest way to code the radio buttons,
but it works.


Hans





More information about the pmwiki-users mailing list