function lingotek_config_build_column_checkboxes in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lingotek.bulk_grid.inc \lingotek_config_build_column_checkboxes()
1 call to lingotek_config_build_column_checkboxes()
File
- ./
lingotek.bulk_grid.inc, line 732
Code
function lingotek_config_build_column_checkboxes($form_state) {
$prefix = '';
$suffix = '__custom';
// Suffix specified because the filter submit function differentiates based on this tag and puts the keys into the session variable as such
$columns = lingotek_config_define_columns();
// Allowed columns and defaults for source and target grids are defined here
$column_elements = array(
'lid' => array(
'#type' => 'checkbox',
'#title' => t('ID'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'lid' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'lid' . $suffix] : in_array('lid', $columns['defaults']),
),
'set_name' => array(
'#type' => 'checkbox',
'#title' => t('Config Set Name'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'set_name' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'set_name' . $suffix] : in_array('set_name', $columns['defaults']),
),
'source' => array(
'#type' => 'checkbox',
'#title' => t('Source'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'source' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'source' . $suffix] : in_array('source', $columns['defaults']),
),
'source_uploaded' => array(
'#type' => 'checkbox',
'#title' => t('Source Uploaded'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'source_uploaded' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'source_uploaded' . $suffix] : in_array('source_uploaded', $columns['defaults']),
),
'translations' => array(
'#type' => 'checkbox',
'#title' => t('Translations'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'translations' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'translations' . $suffix] : in_array('translations', $columns['defaults']),
),
'location' => array(
'#type' => 'checkbox',
'#title' => t('Location'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'location' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'location' . $suffix] : in_array('location', $columns['defaults']),
),
'context' => array(
'#type' => 'checkbox',
'#title' => t('Context'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'context' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'context' . $suffix] : in_array('context', $columns['defaults']),
),
'doc_id' => array(
'#type' => 'checkbox',
'#title' => t('Document ID'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'doc_id' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'doc_id' . $suffix] : in_array('doc_id', $columns['defaults']),
),
'textgroup' => array(
'#type' => 'checkbox',
'#title' => t('Textgroup'),
'#default_value' => isset($_SESSION['config_custom'][$prefix . 'textgroup' . $suffix]) ? $_SESSION['config_custom'][$prefix . 'textgroup' . $suffix] : in_array('textgroup', $columns['defaults']),
),
);
$column_elements = array_intersect_key($column_elements, $columns['columns']);
// Reduces the output columns to the defaults specified in 'lingotek_grid_define_columns'
return lingotek_grid_process_elements($column_elements, $prefix, $suffix);
// adds prefixes and suffixes to the elements
}