function fontyourface_ui_admin_disable_ajax in @font-your-face 7.2
Disables font based on POSTed fid.
1 string reference to 'fontyourface_ui_admin_disable_ajax'
- fontyourface_ui_menu in modules/
fontyourface_ui/ fontyourface_ui.module - Implements hook_menu().
File
- modules/
fontyourface_ui/ fontyourface_ui.module, line 1490
Code
function fontyourface_ui_admin_disable_ajax() {
$fid = intval($_POST['fid']);
$output = array(
'fid' => $fid,
'complete' => 0,
);
if ($fid > 0) {
$font = fontyourface_get_font($fid);
if (fontyourface_disable_font($font)) {
drupal_set_message(t('Disabled @font.', array(
'@font' => $font->name,
)));
$output['complete'] = 1;
}
// if
}
else {
drupal_set_message(t('Font not found. Could not disable.'), 'error');
}
// else
$output['status'] = theme_status_messages(array()) . '<p>' . fontyourface_ui_enabled_count() . '</p>';
drupal_json_output($output);
}