You are here

function i18nblocks_form_submit in Internationalization 6

Same name and namespace in other branches
  1. 5.3 i18nblocks/i18nblocks.module \i18nblocks_form_submit()
  2. 5 i18nblocks/i18nblocks.module \i18nblocks_form_submit()
  3. 5.2 i18nblocks/i18nblocks.module \i18nblocks_form_submit()

Forms api callback. Submit function.

1 string reference to 'i18nblocks_form_submit'
i18nblocks_form_alter in i18nblocks/i18nblocks.module
Implementation of block form_alter().

File

i18nblocks/i18nblocks.module, line 160
Internationalization (i18n) submodule: Multilingual meta-blocks

Code

function i18nblocks_form_submit($form, &$form_state) {
  $values = $form_state['values'];

  // Dirty trick to act on new created blocks. Delta may be zero for other modules than block.
  if (!$values['delta'] && $values['module'] == 'block') {

    // The last insert id will return a different value in mysql

    //$values['delta'] = db_last_insert_id('boxes', 'bid');
    $values['delta'] = db_result(db_query("SELECT MAX(bid) FROM {boxes}"));
  }
  i18nblocks_save($values);
}