Skip to content

Instantly share code, notes, and snippets.

@nlively
Created September 25, 2012 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nlively/3779204 to your computer and use it in GitHub Desktop.
Save nlively/3779204 to your computer and use it in GitHub Desktop.
service_form.inc
<?php
$services = array (
"Sunday School" => "Sunday School",
"11AM" => "11AM",
"6PM" => "6PM",
"7PM (Tuesday)" => "7PM (Tuesday)"
);
$ratio = array (
50 => "Standard (4:3)", // put in the real term IDs here
51 => "Widescreen (16:9)",
);
$form['service_name'] = form_helper_textfield(t('Service Name'), $node->service_name, TRUE, 20);
$form['date'] = form_helper_textfield(t('Last Name'), $node->date, TRUE, 20);
$form['description'] = form_helper_textarea(t('Description (optional)'), $node->description);
$form['mp4_filename'] = form_helper_textfield(t('MP4 Filename'), $node->mp4_filename, TRUE, 20);
$form['message_topic'] = form_helper_textfield(t('Message Topic'), $node->message_topic, TRUE, 20);
$form['service'] = form_helper_select(t('Service'), $services, $node->service, FALSE, FALSE);
$form['still_image'] = array(
'#title' => t('Image'),
'#type' => 'managed_file',
'#description' => t('The uploaded image will be displayed on this page using the image style choosen below.'),
'#upload_location' => 'public://files',
);
$form['ratio'] = form_helper_radios(t('Video Ratio'), $ratio, NULL, FALSE);
function service_form_submit(&$form, &$form_state) {
$v = &$form_state['values'];
$node = new stdClass();
$node->type = 'on_demand';
$node->service_name = $v['service_name'];
$node->date = $v['date'];
$node->description = $v['description'];
$node->mp4_filename = $v['mp4_filename'];
$node->message_topic = $v['message_topic'];
$node->service = $v['service'];
$node->ratio = $v['ratio'];
$node2 = new stdClass();
$node2->type = 'service';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment