You are here

class TMGMTTestTranslatorUIController in Translation Management Tool 7

@file Contains the test translator UI plugin.

Hierarchy

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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TMGMTDefaultTranslatorUIController::checkoutInfo public function Retrieves information about a translation job. Overrides TMGMTTranslatorUIControllerInterface::checkoutInfo 2
TMGMTDefaultTranslatorUIController::checkoutInfoWrapper public function Provides a simple wrapper for the checkout info fieldset.
TMGMTDefaultTranslatorUIController::reviewForm public function Form callback for the job item review form. Overrides TMGMTTranslatorUIControllerInterface::reviewForm
TMGMTDefaultTranslatorUIController::reviewFormSubmit public function Submit callback for the job item review form. Overrides TMGMTTranslatorUIControllerInterface::reviewFormSubmit
TMGMTDefaultTranslatorUIController::reviewFormValidate public function Validation callback for the job item review form. Overrides TMGMTTranslatorUIControllerInterface::reviewFormValidate
TMGMTPluginBase::$pluginInfo protected property
TMGMTPluginBase::$pluginType protected property
TMGMTPluginBase::pluginInfo public function Returns the info of the type of the plugin. Overrides TMGMTPluginBaseInterface::pluginInfo
TMGMTPluginBase::pluginType public function Returns the type of the plugin. Overrides TMGMTPluginBaseInterface::pluginType
TMGMTPluginBase::__construct public function Constructor. Overrides TMGMTPluginBaseInterface::__construct
TMGMTTestTranslatorUIController::checkoutSettingsForm public function Form callback for the checkout settings form. Overrides TMGMTDefaultTranslatorUIController::checkoutSettingsForm
TMGMTTestTranslatorUIController::pluginSettingsForm public function Form callback for the plugin settings form. Overrides TMGMTDefaultTranslatorUIController::pluginSettingsForm
TMGMTTestTranslatorUIController::reviewDataItemElement public function Form callback for the data item element form. Overrides TMGMTDefaultTranslatorUIController::reviewDataItemElement