On this page
function locale_translation_filter_form
locale_translation_filter_form()
Return form for locale translation filters.
Related topics
File
- modules/locale/locale.admin.inc, line 843
- Administration functions for locale.module.
Code
function locale_translation_filter_form() {
$filters = locale_translation_filters();
$form['filters'] = array(
'#type' => 'fieldset',
'#title' => t('Filter translatable strings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
foreach ($filters as $key => $filter) {
// Special case for 'string' filter.
if ($key == 'string') {
$form['filters']['status']['string'] = array(
'#type' => 'textfield',
'#title' => $filter['title'],
'#description' => $filter['description'],
);
}
else {
$form['filters']['status'][$key] = array(
'#title' => $filter['title'],
'#type' => 'select',
'#empty_value' => 'all',
'#empty_option' => $filter['options']['all'],
'#size' => 0,
'#options' => $filter['options'],
);
}
if (!empty($_SESSION['locale_translation_filter'][$key])) {
$form['filters']['status'][$key]['#default_value'] = $_SESSION['locale_translation_filter'][$key];
}
}
$form['filters']['actions'] = array(
'#type' => 'actions',
'#attributes' => array('class' => array('container-inline')),
);
$form['filters']['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Filter'),
);
if (!empty($_SESSION['locale_translation_filter'])) {
$form['filters']['actions']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset')
);
}
return $form;
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!locale!locale.admin.inc/function/locale_translation_filter_form/7.x