function message_admin_text_copy in Message 7
Menu callback; Texts copying settings form.
1 string reference to 'message_admin_text_copy'
- message_menu in ./
message.module - Implements hook_menu().
File
- includes/
message.admin.inc, line 121 - Message type editing UI.
Code
function message_admin_text_copy($form, $form_state) {
// Only display the form if the locale module is enabled.
if (!module_exists('locale')) {
$form['_notice'] = array(
'#markup' => t('Copying messages text fields is dependent on the locale module.'),
);
return $form;
}
$languages = language_list();
$language_options = array(
LANGUAGE_NONE => t('"Language none"'),
);
foreach ($languages as $langcode => $language) {
$language_options[$langcode] = $language->name;
}
$form['origin'] = array(
'#type' => 'select',
'#title' => t('Select a language to copy from'),
'#options' => $language_options,
'#required' => TRUE,
);
$form['destinations'] = array(
'#type' => 'select',
'#title' => t('Select languages to copy to'),
'#multiple' => TRUE,
'#options' => $language_options,
'#required' => TRUE,
);
$form['override'] = array(
'#type' => 'checkbox',
'#title' => t('Override existing text'),
'#description' => t('When checked, existing text in the destination languages will be overriden by the origin language.'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Copy'),
);
return $form;
}