function fontyourface_ui_admin_edit_form_submit in @font-your-face 7.2
Edit form submit handler.
File
- modules/
fontyourface_ui/ fontyourface_ui.module, line 1239
Code
function fontyourface_ui_admin_edit_form_submit($form, &$form_state) {
$font = fontyourface_get_font($form['fid']['#value']);
if ($form_state['clicked_button']['#value'] == t('Cancel changes')) {
drupal_goto('admin/appearance/fontyourface');
}
else {
if ($form['enabled']['#value'] > $font->enabled) {
fontyourface_enable_font($font);
}
elseif ($form['enabled']['#value'] < $font->enabled) {
fontyourface_disable_font($font);
}
// elseif
if ($font->css_selector != $form['css']['#value']) {
fontyourface_set_css_selector($font, $form['css']['#value']);
}
// if
$tags = drupal_explode_tags($form_state['values']['tags']);
if ($tags != $font->tags) {
db_delete('fontyourface_tag_font')
->condition('fid', $font->fid)
->execute();
fontyourface_add_tags_to_font($tags, $font->fid);
$font->tags = $tags;
fontyourface_delete_unused_tags();
}
// if
drupal_set_message(t('Updated') . ' <i>' . $font->name . '</i>.');
}
// else
}