You are here

function _qtip_convert_form_to_qtips in qTip (Stylish jQuery Tooltips) 7.2

Helper function to convert the data on admin form into qtip presentation.

2 calls to _qtip_convert_form_to_qtips()
qtip_configure_instance_form in includes/forms/qtip.admin.inc
Callback function for admin/config/user-interface/qtip
qtip_configure_instance_form_submit in includes/forms/qtip.admin.inc
Submission handler.

File

includes/forms/qtip.admin.inc, line 499
Administrative functions for the qTip module.

Code

function _qtip_convert_form_to_qtips($form_state) {
  $qt = new stdClass();
  $qt->name = $form_state['values']['name'];
  if (isset($form_state['values']['machine_name'])) {
    $qt->machine_name = $form_state['values']['machine_name'];
  }
  $qt->settings = array(
    'content' => array(
      'button' => $form_state['values']['miscellaneous']['button'],
    ),
    'style' => $form_state['values']['style'],
    'position' => $form_state['values']['position'],
    'show' => $form_state['values']['show'],
    'hide' => $form_state['values']['hide'],
    'miscellaneous' => array(
      'button_title_text' => $form_state['values']['miscellaneous']['button_title_text'],
    ),
  );
  return $qt;
}