<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Eric<br>
<br>
There is a bit of magic for that form, the values in the form
are automatically<br>
stored as Drupal variables use the form elements name plus the
node type<br>
So by using<br>
<pre> '#default_value' => variable_get('scheduler_'.$form['#node_type']->type, 0),</pre>
the default value uses the previous stored value if available,
otherwise 0.<br>
The 'scheduler' comes from the form element name
($form['workflow']['scheduler'])<br>
<br>
You can add new elements to existing field sets or add your own
field set.<br>
<br>
Nevets<br>
<br>
On 10/6/2010 12:27 PM, Eric Schaefer wrote:
<blockquote
cite="mid:AANLkTikQsxWkYtm70PEsfwYXvPSpkbV8=m+niQ8zReQ8@mail.gmail.com"
type="cite">
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 13px;"
lang="x-western">
<pre wrap="">Hi List!
Maybe I just can't see the forest for the trees:
In scheduler.module (<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://drupal.org/project/scheduler">http://drupal.org/project/scheduler</a>) in
scheduler_form_alter() the following code can be found (D6):
if ('node_type_form' == $form_id) {
$form['workflow']['scheduler'] = array(
'#type' => 'checkbox',
'#title' => t('Enable scheduled (un)publishing'),
'#default_value' => variable_get('scheduler_'.
$form['#node_type']->type, 0),
'#description' => t('Check this box to enable scheduled
(un)publishing for this node type.')
);
$form['workflow']['scheduler_touch'] = array(
'#type' => 'checkbox',
'#title' => t('Alter published on time'),
'#default_value' => variable_get('scheduler_touch_'.
$form['#node_type']->type, 0),
'#description' => t('Check this box to alter the published on
time to match the scheduled time ("touch feature").')
);
}
I am trying to understand this. I can't figure out how the values of
the two checkboxes get validated and persisted back to
"scheduler_story" and "scheduler_touch_story". Is there some magic
involved that guesses the variable names from $form['workflow']?
How would I add my own fieldset?
Thanks,
Eric
</pre>
</div>
</blockquote>
<br>
</body>
</html>