class TMGMTTestTranslatorUIController in Translation Management Tool 7
@file Contains the test translator UI plugin.
Hierarchy
- class \TMGMTPluginBase implements TMGMTPluginBaseInterface
- class \TMGMTDefaultTranslatorUIController implements TMGMTTranslatorUIControllerInterface
Expanded class hierarchy of TMGMTTestTranslatorUIController
2 string references to 'TMGMTTestTranslatorUIController'
- hook_tmgmt_translator_plugin_info in ./
tmgmt.api.php - Provide information about translator plugins.
- tmgmt_test_tmgmt_translator_plugin_info in tests/
tmgmt_test.module - Implements hook_tmgmt_translator_plugin_info().
File
- tests/
tmgmt_test.ui.translator.inc, line 8 - Contains the test translator UI plugin.
View source
class TMGMTTestTranslatorUIController extends TMGMTDefaultTranslatorUIController {
/**
* {@inheritdoc}
*/
public function pluginSettingsForm($form, &$form_state, TMGMTTranslator $translator, $busy = FALSE) {
$form['expose_settings'] = array(
'#type' => 'checkbox',
'#title' => t('Display settings'),
'#default_value' => TRUE,
);
$form['action'] = array(
'#type' => 'select',
'#title' => t('Default action'),
'#options' => array(
'translate' => t('Translate'),
'submit' => t('Submit'),
'reject' => t('Reject'),
'fail' => t('Fail'),
'not_translatable' => t('Not translatable'),
),
);
return parent::pluginSettingsForm($form, $form_state, $translator, $busy);
}
/**
* {@inheritdoc}
*/
public function checkoutSettingsForm($form, &$form_state, TMGMTJob $job) {
if ($job
->getTranslator()
->getSetting('expose_settings')) {
$form['action'] = array(
'#type' => 'select',
'#title' => t('Action'),
'#options' => array(
'translate' => t('Translate'),
'submit' => t('Submit'),
'reject' => t('Reject'),
'fail' => t('Fail'),
'not_translatable' => t('Not translatable'),
),
'#default_value' => $job
->getTranslator()
->getSetting('action'),
);
}
return $form;
}
/**
* {@inheritdoc}
*/
public function reviewDataItemElement($form, &$form_state, $data_item_key, $parent_key, array $data_item, TMGMTJobItem $item) {
$form['below'] = array(
'#markup' => t('Testing output of review data item element @key from the testing translator.', array(
'@key' => $data_item_key,
)),
);
return $form;
}
}