function tmgmt_local_translation_assign_form in Translation Management Tool 7
Form for assigning multiple tasks to translator.
_state
Parameters
array $form:
string $tasks: Comma separated tasks ids.
Return value
array Drupal form definition.
1 string reference to 'tmgmt_local_translation_assign_form'
- tmgmt_local_menu in translators/
tmgmt_local/ tmgmt_local.module - Implements hook_menu().
File
- translators/
tmgmt_local/ includes/ tmgmt_local.pages.inc, line 407 - Provides page and forms callbacks.
Code
function tmgmt_local_translation_assign_form($form, &$form_state, $tasks) {
$form_state['tasks'] = explode(',', $tasks);
$roles = tmgmt_local_translator_roles();
if (empty($roles)) {
drupal_set_message(t('No user role has the "provide translation services" permission. <a href="@url">Configure permissions</a> for the Local translator module.', array(
'@url' => url('admin/people/permissions'),
)), 'warning');
}
$form['tuid'] = array(
'#title' => t('Assign to'),
'#type' => 'select',
'#empty_option' => t('Select user'),
'#options' => tmgmt_local_get_translators_for_tasks($form_state['tasks']),
'#required' => TRUE,
);
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Assign tasks'),
);
return $form;
}