UTS Live Text

  1. function uts_live_text_menu() {
  2.   $items = array();
  3.   $items['uts/data/live_text'] = array(
  4.     'title' => 'Collect live text',
  5.     'description' => 'Record form submission from user.',
  6.     'page callback' => 'uts_live_text_record',
  7.     'access callback' => TRUE,
  8.     'type' => MENU_CALLBACK
  9.   );
  10.  
  11.   return $items;
  12. }
  13.  
  14. function uts_live_text_theme() {
  15.   return array(
  16.     'uts_live_text_feedback' => array(
  17.       'arguments' => array('form' => NULL),
  18.       'template' => 'uts_live_text_feedback'
  19.     )
  20.   );
  21. }
  22.  
  23. .....
  24.  
  25. function uts_live_text_preprocess_page(&$variables) {
  26.   $variables['content'] .= theme('uts_live_text_feedback', drupal_get_form('uts_live_text_feedback_form'));
  27. }
  28.  
  29.  
  30. function uts_live_text_feedback_form() {
  31.   $form = array();
  32.   $form['feedback'] = array(
  33.     '#type' => 'textarea',
  34.     '#title' => t('Feedback'),
  35.   );
  36.   $form['submit'] = array(
  37.     '#type' => 'submit',
  38.     '#value' => t('Send'),
  39.     '#ahah' => array(
  40.       'path' => 'uts/data/live_text',
  41.       'wrapper' => 'uts_live_text_result',
  42.       'method' => 'replace',
  43.     )
  44.   );
  45.  
  46.   return $form;
  47. }