You are here

function qtip_save in qTip (Stylish jQuery Tooltips) 7.2

Create a new qtip instance.

2 calls to qtip_save()
qtip_configure_instance_form_submit in includes/forms/qtip.admin.inc
Submission handler.
qtip_update in ./qtip.module
Update an existing qtip instance.

File

./qtip.module, line 519

Code

function qtip_save($qtip) {
  module_invoke_all('qtip_presave', $qtip);
  $exists = qtip_load($qtip->machine_name);
  if ($exists && empty($exists->in_code_only)) {
    $ret = drupal_write_record('qtip', $qtip, 'machine_name');
    if ($ret == SAVED_UPDATED) {
      qtip_i18n_update_strings(array(
        $qtip->machine_name,
      ));
    }
    else {
      return FALSE;
    }
  }
  else {
    $ret = drupal_write_record('qtip', $qtip);
    if ($ret == SAVED_NEW) {
      qtip_i18n_update_strings(array(
        $qtip->machine_name,
      ));
      module_invoke_all('qtip_insert', $qtip);
    }
    else {
      return FALSE;
    }
  }
  module_invoke_all('qtip_save', $qtip);
  return $qtip;
}