| 24 |
elseif (isset($form['type']) && $form['type']['#value'].'_node_form' === $form_id && isset($form['author']) && isset($form['author']['date'])) { |
elseif (isset($form['type']) && $form['type']['#value'].'_node_form' === $form_id && isset($form['author']) && isset($form['author']['date'])) { |
| 25 |
yuicalendar_build_form($form['author'], 'date', $form['created']['#value'], 5, variable_get('yuicalendar_edit_drop_down', '1'), NULL); |
yuicalendar_build_form($form['author'], 'date', $form['created']['#value'], 5, variable_get('yuicalendar_edit_drop_down', '1'), NULL); |
| 26 |
} |
} |
|
$form['yuicalendar'] = Array('#type' => 'weight'); |
|
| 27 |
} |
} |
| 28 |
|
|
| 29 |
|
/** |
| 30 |
|
* Implementation of hook_nodeapi(). |
| 31 |
|
*/ |
| 32 |
function yuicalendar_nodeapi($node, $op) { |
function yuicalendar_nodeapi($node, $op) { |
| 33 |
switch ($op) { |
switch ($op) { |
| 34 |
case 'validate': |
case 'validate': |
| 77 |
'#value' => $date_only); |
'#value' => $date_only); |
| 78 |
} |
} |
| 79 |
|
|
| 80 |
|
$form['yuicalendar'] = Array('#type' => 'hidden'); |
| 81 |
|
|
| 82 |
// Wrap and set the weight of the form element being transformed into a calendar/date |
// Wrap and set the weight of the form element being transformed into a calendar/date |
| 83 |
$form[$id]['#attributes'] = array('class' => 'yuicalendar'); |
$form[$id]['#attributes'] = array('class' => 'yuicalendar'); |
| 84 |
$form[$id]['#prefix'] = '<div class="yuicalendar-wrapper"><div class="yuicalendar-date">'; |
$form[$id]['#prefix'] = '<div class="yuicalendar-wrapper"><div class="yuicalendar-date">'; |
| 176 |
|
|
| 177 |
$path = drupal_get_path('module', 'yuicalendar'); |
$path = drupal_get_path('module', 'yuicalendar'); |
| 178 |
|
|
| 179 |
$yui_source = variable_get('yui_source', 'http://yui.yahooapis.com/2.3.1'); |
$yui_source = variable_get('yui_source', 'http://yui.yahooapis.com/2.5.1'); |
| 180 |
|
|
| 181 |
yui_add_js('calendar', $yui_source, '/build/yahoo/yahoo-min.js'); |
yui_add_js('calendar', $yui_source, '/build/yahoo/yahoo-min.js'); |
| 182 |
yui_add_js('calendar', $yui_source, '/build/yahoo-dom-event/yahoo-dom-event.js'); |
yui_add_js('calendar', $yui_source, '/build/yahoo-dom-event/yahoo-dom-event.js'); |