$limit_language);
drupal_add_js(array('modalFrameLocale' => $js_settings), 'setting');
}
}
}
elseif (!empty($_GET['modalframe']) && in_array($form_id, array('locale_translate_edit_form', 'locale_translate_delete_form'))) {
if (!empty($_GET['modalframe-language'])) {
$form['modalframe-language'] = array('#type' => 'value', '#value' => $_GET['modalframe-language']);
}
$form['#submit'][] = 'modalframe_locale_form_submit';
// For delete forms, render the page title in the content area as well.
if ($form_id == 'locale_translate_delete_form') {
$form['#prefix'] = '
'. drupal_get_title() .'
';
}
}
}
}
/**
* Process the string related forms implemented by the translation interface.
*/
function modalframe_locale_form_submit($form, &$form_state) {
$form_values = $form_state['values'];
$modalframe_args = array(
'submitted' => TRUE,
);
if ($form_values['form_id'] == 'locale_translate_edit_form') {
// Rebuild the list of languages in the search results page for this string.
$translations = array();
$result = db_query('SELECT language, translation FROM {locales_target} WHERE lid = %d', $form_values['lid']);
while ($row = db_fetch_object($result)) {
$translations[$row->language] = $row->translation;
}
$limit_language = (!empty($form_values['modalframe-language']) ? $form_values['modalframe-language'] : FALSE);
$modalframe_args['languages'] = _locale_translate_language_list($translations, $limit_language);
}
modalframe_close_dialog($modalframe_args);
}