You are here

function sharethis_DB_update in ShareThis 7

sharethis_DB_update

This is the Callback function when you save the options on the configuration page. All it does is update the database with all the posted values.

1 string reference to 'sharethis_DB_update'
sharethis_menu in ./sharethis.module
Implements hook_menu.

File

./sharethis.module, line 374
A module that adds one of the ShareThis widget to your website.

Code

function sharethis_DB_update($form, &$form_state) {
  foreach ($_POST as $k => $v) {
    $record = (object) NULL;
    $record->st_option = $k;
    $record->st_value = $v;
    drupal_write_record('st_table', $record, 'st_option');
  }
  echo "<p>" . t("Changes have been successfully saved!") . "</p>";
}