function globallink_block_dashboard_filter_form in GlobalLink Connect for Drupal 7.6
Same name and namespace in other branches
- 7.7 globallink_block/globallink_block_send.inc \globallink_block_dashboard_filter_form()
- 7.5 globallink_block/globallink_block_send.inc \globallink_block_dashboard_filter_form()
Builds form to filter blocks to send for translation on dashboard.
1 string reference to 'globallink_block_dashboard_filter_form'
- globallink_block_dashboard in globallink_block/
globallink_block_send.inc - Builds forms on block send dashboard.
File
- globallink_block/
globallink_block_send.inc, line 27
Code
function globallink_block_dashboard_filter_form() {
module_load_include('inc', 'globallink', 'globallink');
$form = array();
$locales = globallink_get_mapped_drupal_locales(FALSE);
if (isset($locales) && count($locales) > 1) {
$filter = FALSE;
$default_info = '';
if (!empty($_SESSION['globallink_selected_block_info'])) {
$default_info = $_SESSION['globallink_selected_block_info'];
$filter = TRUE;
}
$form['block_info_filter'] = array(
'#type' => 'fieldset',
'#title' => t('FILTER BLOCKS'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['block_info_filter']['filters'] = array(
'#type' => 'container',
'#attributes' => array(
'class' => array(
'container-inline',
),
),
);
$form['block_info_filter']['filters']['info'] = array(
'#type' => 'textfield',
'#title' => 'Block Info' . ': ',
'#attributes' => array(
'size' => 30,
),
'#default_value' => $default_info,
'#field_suffix' => ' ',
);
$disable_submit = $filter ? TRUE : FALSE;
$form['block_info_filter']['filters']['filter'] = array(
'#type' => 'submit',
'#value' => t('Filter'),
'#disabled' => $disable_submit,
);
if ($filter) {
$form['filter-search'] = array(
'#type' => 'fieldset',
'#title' => t('FILTER CRITERIA'),
);
$form['filter-search']['filter-markup'] = array(
'#type' => 'container',
);
$form['filter-search']['filter-markup'][] = array(
'#markup' => '<table>',
);
$form['filter-search']['filter-markup'][] = array(
'#markup' => '<tr><td style="text-align: left;width: 15%;vertical-align: middle;border: none;"><b>' . 'Block Info' . '</b>: </td><td style="text-align: left;width: 85%;vertical-align: middle;border: none;">' . $default_info . '</td></tr>',
);
$form['filter-search']['filter-markup'][] = array(
'#markup' => '</table>',
);
$form['filter-search']['status']['actions'] = array(
'#type' => 'actions',
'#attributes' => array(
'class' => array(
'container-inline',
),
),
);
$form['filter-search']['status']['actions']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset'),
);
}
}
else {
$form['locale_mapping']['no_mapping'] = array(
'#type' => 'markup',
'#markup' => t('<br/><b><i>No GlobalLink locale mapping found.</i></b>'),
);
}
return $form;
}