You are here

class i18n_menu_link_translation_set in Internationalization 7

@file Internationalization (i18n) module - Translation set

Hierarchy

Expanded class hierarchy of i18n_menu_link_translation_set

1 string reference to 'i18n_menu_link_translation_set'
i18n_menu_i18n_translation_set_info in i18n_menu/i18n_menu.i18n.inc
Implements hook_i18n_translation_set_info()

File

i18n_menu/i18n_menu.inc, line 6
Internationalization (i18n) module - Translation set

View source
class i18n_menu_link_translation_set extends i18n_translation_set {

  /**
   * Load all path translations
   */
  public function load_translations() {
    $translations = array();
    $query = db_select('menu_links', 'ml');
    $query
      ->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
    $query
      ->fields('ml');

    // Weight should be taken from {menu_links}, not {menu_router}.
    $query
      ->addField('ml', 'weight', 'link_weight');
    $query
      ->fields('m');
    $query
      ->condition('ml.i18n_tsid', $this->tsid);
    foreach ($query
      ->execute()
      ->fetchAll(PDO::FETCH_ASSOC) as $item) {
      $item['weight'] = $item['link_weight'];
      _menu_link_translate($item);
      $translations[$item['language']] = $item;
    }
    return $translations;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
i18n_menu_link_translation_set::load_translations public function Load all path translations Overrides i18n_translation_set::load_translations
i18n_translation_set::$bundle public property
i18n_translation_set::$master_id public property
i18n_translation_set::$object_languages protected property
i18n_translation_set::$related_translations protected property
i18n_translation_set::$status public property
i18n_translation_set::$title public property
i18n_translation_set::$translations protected property
i18n_translation_set::$tsid public property
i18n_translation_set::$type public property
i18n_translation_set::add_item public function Add translation item 1
i18n_translation_set::add_translations public function Add array of translation items
i18n_translation_set::clean_translations public function Clean all items in this translation set 1
i18n_translation_set::delete public function Delete a translation set
i18n_translation_set::delete_translations public function Delete translations in this translation set 1
i18n_translation_set::get_delete_path public function Get delete path for this translation set
i18n_translation_set::get_edit_path public function Get edit path for this translation set
i18n_translation_set::get_field protected function Get field on translations table that stores the translation set id (tsid)
i18n_translation_set::get_info public function Get property from translation set info
i18n_translation_set::get_item public function Get item for language
i18n_translation_set::get_links public function Get items as renderable links
i18n_translation_set::get_list_path public function Get overview (list) path for this translation set
i18n_translation_set::get_objects public function Get translations as i18n objects, indexed by language
i18n_translation_set::get_operations public function Get operations as renderable links
i18n_translation_set::get_path_placeholders function Get placeholder values for path replacement 1
i18n_translation_set::get_table protected function Get table name, where translation items are stored.
i18n_translation_set::get_title public function Get title for this set
i18n_translation_set::get_translations public function Get translations, indexed by language
i18n_translation_set::get_translations_keys public function Get translations keys, indexed by language
i18n_translation_set::insert public function Create a new translation set
i18n_translation_set::invoke_all public function Invoke all modules
i18n_translation_set::item_list public function Get item list
i18n_translation_set::key_field protected function Get key field for this translation items
i18n_translation_set::remove_item public function Remove item / language from translation set
i18n_translation_set::remove_language public function Remove language from translation set.
i18n_translation_set::remove_object public function Remove i18n object from translation set.
i18n_translation_set::reset_translations public function Reset translations, set empty array or new array of translations.
i18n_translation_set::save public function Save translation set
i18n_translation_set::save_translations public function Save translations in this translation set 1
i18n_translation_set::update public function Update a translation set
i18n_translation_set::update_delete public function Update a translation set or delete if empty.
i18n_translation_set::update_related protected function Update related translation sets
i18n_translation_set::__construct public function Constructor from object/array