function lingotek_grid_build_column_checkboxes in Lingotek Translation 7.5
Same name and namespace in other branches
- 7.7 lingotek.bulk_grid.inc \lingotek_grid_build_column_checkboxes()
- 7.4 lingotek.bulk_grid.inc \lingotek_grid_build_column_checkboxes()
- 7.6 lingotek.bulk_grid.inc \lingotek_grid_build_column_checkboxes()
Builds the checkbox elements for customizing The Grid's columns Uses predefined defaults specified in 'lingotek_grid_define_columns'
1 call to lingotek_grid_build_column_checkboxes()
File
- ./
lingotek.bulk_grid.inc, line 583 - Bulk Grid form
Code
function lingotek_grid_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_grid_define_columns();
// Allowed columns and defaults for source and target grids are defined here
$column_elements = array(
'nid' => array(
'#type' => 'checkbox',
'#title' => t('ID'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'nid' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'nid' . $suffix] : in_array('nid', $columns['defaults']),
),
'content_type' => array(
'#type' => 'checkbox',
'#title' => t('Content Type'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'content_type' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'content_type' . $suffix] : in_array('content_type', $columns['defaults']),
),
'title' => array(
'#type' => 'checkbox',
'#title' => t('Title'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'title' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'title' . $suffix] : in_array('title', $columns['defaults']),
),
'language' => array(
'#type' => 'checkbox',
'#title' => t('Source Uploaded'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'language' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'language' . $suffix] : in_array('language', $columns['defaults']),
),
'translations' => array(
'#type' => 'checkbox',
'#title' => t('Translations'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'translations' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'translations' . $suffix] : in_array('translations', $columns['defaults']),
),
'configuration' => array(
'#type' => 'checkbox',
'#title' => t('Profile'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'configuration' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'configuration' . $suffix] : in_array('configuration', $columns['defaults']),
),
'document_id' => array(
'#type' => 'checkbox',
'#title' => t('Doc ID'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'document_id' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'document_id' . $suffix] : in_array('document_id', $columns['defaults']),
),
'workflow' => array(
'#type' => 'checkbox',
'#title' => t('Workflow'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'workflow' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'workflow' . $suffix] : in_array('workflow', $columns['defaults']),
),
'changed' => array(
'#type' => 'checkbox',
'#title' => t('Last Modified'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'changed' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'changed' . $suffix] : in_array('changed', $columns['defaults']),
),
'last_uploaded' => array(
'#type' => 'checkbox',
'#title' => t('Last Uploaded'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'last_uploaded' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'last_uploaded' . $suffix] : in_array('last_uploaded', $columns['defaults']),
),
'locale_progress_percent' => array(
'#type' => 'checkbox',
'#title' => t('Target Progress Percentage'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'locale_progress_percent' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'locale_progress_percent' . $suffix] : in_array('locale_progress_percent', $columns['defaults']),
),
'progress_updated' => array(
'#type' => 'checkbox',
'#title' => t('Progress Last Updated'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'progress_updated' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'progress_updated' . $suffix] : in_array('progress_updated', $columns['defaults']),
),
'last_downloaded' => array(
'#type' => 'checkbox',
'#title' => t('Time Last Downloaded'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'last_downloaded' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'last_downloaded' . $suffix] : in_array('last_downloaded', $columns['defaults']),
),
'actions' => array(
'#type' => 'checkbox',
'#title' => t('Actions'),
'#default_value' => isset($_SESSION['grid_custom'][$prefix . 'actions' . $suffix]) ? $_SESSION['grid_custom'][$prefix . 'actions' . $suffix] : in_array('actions', $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
}