You are here

class TMGMTDefaultSourceUIController in Translation Management Tool 7

Default ui controller class for source plugin.

Hierarchy

Expanded class hierarchy of TMGMTDefaultSourceUIController

Related topics

1 string reference to 'TMGMTDefaultSourceUIController'
tmgmt_source_ui_controller in ./tmgmt.module
Get the ui controller class for a given source plugin.

File

plugin/tmgmt.ui.source.inc, line 9

View source
class TMGMTDefaultSourceUIController extends TMGMTPluginBase implements TMGMTSourceUIControllerInterface {

  /**
   * {@inheritdoc}
   */
  public function reviewForm($form, &$form_state, TMGMTJobItem $item) {
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function reviewDataItemElement($form, &$form_state, $data_item_key, $parent_key, array $data_item, TMGMTJobItem $item) {
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function reviewFormValidate($form, &$form_state, TMGMTJobItem $item) {

    // Nothing to do here by default.
  }

  /**
   * {@inheritdoc}
   */
  public function reviewFormSubmit($form, &$form_state, TMGMTJobItem $item) {

    // Nothing to do here by default.
  }

  /**
   * {@inheritdoc}
   */
  public function overviewForm($form, &$form_state, $type) {
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function overviewFormValidate($form, &$form_state, $type) {

    // Nothing to do here by default.
  }

  /**
   * {@inheritdoc}
   */
  public function overviewFormSubmit($form, &$form_state, $type) {

    // Nothing to do here by default.
  }

  /**
   * {@inheritdoc}
   */
  public function hook_menu() {
    $items = array();
    if ($types = tmgmt_source_translatable_item_types($this->pluginType)) {
      $defaults = array(
        'page callback' => 'drupal_get_form',
        'access callback' => 'tmgmt_job_access',
        'access arguments' => array(
          'create',
        ),
      );
      if (isset($this->pluginInfo['file'])) {
        $defaults['file'] = $this->pluginInfo['file'];
      }
      if (isset($this->pluginInfo['file path'])) {
        $defaults['file path'] = $this->pluginInfo['file path'];
      }
      foreach ($types as $type => $name) {
        $items['admin/tmgmt/sources/' . $this->pluginType . '_' . $type] = $defaults + array(
          'title' => check_plain($name),
          'page arguments' => array(
            'tmgmt_ui_' . $this->pluginType . '_source_' . $type . '_overview_form',
            $this->pluginType,
            $type,
          ),
          'type' => MENU_LOCAL_TASK,
        );
      }
    }
    return $items;
  }

  /**
   * {@inheritdoc}
   */
  public function hook_forms() {
    $info = array();
    if ($types = tmgmt_source_translatable_item_types($this->pluginType)) {
      foreach (array_keys($types) as $type) {
        $info['tmgmt_ui_' . $this->pluginType . '_source_' . $type . '_overview_form'] = array(
          'callback' => 'tmgmt_ui_source_overview_form',
          'wrapper_callback' => 'tmgmt_ui_source_overview_form_defaults',
        );
      }
    }
    return $info;
  }

  /**
   * {@inheritdoc}
   */
  public function hook_views_default_views() {
    return array();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TMGMTDefaultSourceUIController::hook_forms public function Overrides TMGMTSourceUIControllerInterface::hook_forms 1
TMGMTDefaultSourceUIController::hook_menu public function Overrides TMGMTSourceUIControllerInterface::hook_menu 2
TMGMTDefaultSourceUIController::hook_views_default_views public function Overrides TMGMTSourceUIControllerInterface::hook_views_default_views 1
TMGMTDefaultSourceUIController::overviewForm public function 3
TMGMTDefaultSourceUIController::overviewFormSubmit public function 3
TMGMTDefaultSourceUIController::overviewFormValidate public function 1
TMGMTDefaultSourceUIController::reviewDataItemElement public function Form callback for the data item element form. Overrides TMGMTSourceUIControllerInterface::reviewDataItemElement
TMGMTDefaultSourceUIController::reviewForm public function Form callback for the job item review form. Overrides TMGMTSourceUIControllerInterface::reviewForm
TMGMTDefaultSourceUIController::reviewFormSubmit public function Submit callback for the job item review form. Overrides TMGMTSourceUIControllerInterface::reviewFormSubmit
TMGMTDefaultSourceUIController::reviewFormValidate public function Validation callback for the job item review form. Overrides TMGMTSourceUIControllerInterface::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