You are here

function smiley_admin_delete in Smiley 6

2 calls to smiley_admin_delete()
smiley_admin_delete_confirm_submit in ./smiley.admin.inc
smiley_admin_form_delete in ./smiley.admin.inc
1 string reference to 'smiley_admin_delete'
smiley_admin_delete_confirm in ./smiley.admin.inc

File

./smiley.admin.inc, line 330

Code

function smiley_admin_delete($smiley_id, $redirect = TRUE) {
  $smiley_id = $smiley_id ? $smiley_id : arg(4);
  $smiley = db_fetch_array(db_query('SELECT * FROM {smiley} WHERE id = %d', $smiley_id));
  if ($smiley_id) {
    db_query("DELETE FROM {smiley} WHERE id = %d", $smiley_id);
    $message = t('Deleted smiley: %smiley', array(
      '%smiley' => $smiley['acronyms'],
    ));
    drupal_set_message($message);
  }
  if ($redirect) {
    drupal_goto('admin/settings/smiley');
  }
}