You are here

abstract class TMGMTDefaultSourcePluginController in Translation Management Tool 7

Default controller class for source plugins.

Hierarchy

Expanded class hierarchy of TMGMTDefaultSourcePluginController

Related topics

File

plugin/tmgmt.plugin.source.inc, line 13
Contains the abstract source base plugin class.

View source
abstract class TMGMTDefaultSourcePluginController extends TMGMTPluginBase implements TMGMTSourcePluginControllerInterface {

  /**
   * {@inheritdoc}
   */
  public function getLabel(TMGMTJobItem $job_item) {
    return t('@plugin item unavailable (@item)', array(
      '@plugin' => $this->pluginInfo['label'],
      '@item' => $job_item->item_type . ':' . $job_item->item_id,
    ));
  }

  /**
   * {@inheritdoc}
   */
  public function getUri(TMGMTJobItem $job_item) {
    return array(
      'path' => '',
      'options' => array(),
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getItemTypes() {
    return isset($this->pluginInfo['item types']) ? $this->pluginInfo['item types'] : array();
  }

  /**
   * {@inheritdoc}
   */
  public function getItemTypeLabel($type) {
    $types = $this
      ->getItemTypes();
    if (isset($types[$type])) {
      return $types[$type];
    }
    return '';
  }

  /**
   * {@inheritdoc}
   */
  public function getType(TMGMTJobItem $job_item) {
    return ucfirst($job_item->item_type);
  }

  /**
   * {@inheritdoc}
   */
  public function getExistingLangCodes(TMGMTJobItem $job_item) {
    return array();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TMGMTDefaultSourcePluginController::getExistingLangCodes public function Gets existing translation language codes of the job item source. Overrides TMGMTSourcePluginControllerInterface::getExistingLangCodes 5
TMGMTDefaultSourcePluginController::getItemTypeLabel public function Returns the label of a source item type. Overrides TMGMTSourcePluginControllerInterface::getItemTypeLabel
TMGMTDefaultSourcePluginController::getItemTypes public function Returns an array of translatable source item types. Overrides TMGMTSourcePluginControllerInterface::getItemTypes
TMGMTDefaultSourcePluginController::getLabel public function Return a title for this job item. Overrides TMGMTSourcePluginControllerInterface::getLabel 5
TMGMTDefaultSourcePluginController::getType public function Returns the type of a job item. Overrides TMGMTSourcePluginControllerInterface::getType 4
TMGMTDefaultSourcePluginController::getUri public function Returns the Uri for this job item. Overrides TMGMTSourcePluginControllerInterface::getUri 4
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
TMGMTSourcePluginControllerInterface::getData public function Returns an array with the data structured for translation. 5
TMGMTSourcePluginControllerInterface::getSourceLangCode public function Gets language code of the job item source. 5
TMGMTSourcePluginControllerInterface::saveTranslation public function Saves a translation. 5