function field_translation_table_filtered_form in Translation table 7
Form for field translation.
Parameters
$languages: languages to translate to
$bundle:
1 call to field_translation_table_filtered_form()
- field_translation_table_form in modules/
field.translation_table.inc - Menu callback; Admin form for field translation.
File
- modules/
field.translation_table.inc, line 80 - Translation table for fields
Code
function field_translation_table_filtered_form($languages, $bundle) {
$header = _translation_table_get_header($languages);
switch ($bundle) {
case '0':
$query = db_select('locales_source', 'ls');
$query
->fields('ls', array(
'lid',
'source',
'location',
))
->extend('PagerDefault')
->extend('TableSort')
->condition('ls.textgroup', 'field')
->orderByHeader($header)
->limit(50);
$result = $query
->execute();
break;
default:
$query = db_select('locales_source', 'ls');
$query
->join('i18n_string', 'i18ns', 'ls.lid = i18ns.lid');
$query
->fields('ls', array(
'lid',
'source',
'location',
))
->extend('PagerDefault')
->extend('TableSort')
->condition('ls.textgroup', 'field')
->condition('i18ns.objectid', $bundle)
->orderByHeader($header)
->limit(50);
$result = $query
->execute();
break;
}
$form['strings']['#tree'] = TRUE;
$form['header'] = array(
'#type' => 'value',
'#value' => $header,
);
while ($source = $result
->fetch()) {
if (drupal_strlen(trim($source->source)) > 0) {
$form['strings'][$source->lid] = _translation_table_row($source, $languages);
}
}
$form['languages'] = array(
'#type' => 'value',
'#value' => $languages,
);
$form['tt-submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
$form['pager'] = array(
'#markup' => theme('pager'),
);
$form['#theme'] = 'translation_table';
return $form;
}