You are here

function smileys_admin_delete in Smileys 6

Same name and namespace in other branches
  1. 5 smileys.module \smileys_admin_delete()
2 calls to smileys_admin_delete()
smileys_admin_delete_confirm_submit in ./smileys.admin.inc
smileys_admin_form_delete in ./smileys.admin.inc
1 string reference to 'smileys_admin_delete'
smileys_admin_delete_confirm in ./smileys.admin.inc

File

./smileys.admin.inc, line 329

Code

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