Created
September 25, 2012 00:04
-
-
Save nlively/3779204 to your computer and use it in GitHub Desktop.
service_form.inc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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