class i18n_path_translation_set in Internationalization 7
@file Internationalization (i18n) module - Translation set
Hierarchy
- class \i18n_translation_set
- class \i18n_path_translation_set
Expanded class hierarchy of i18n_path_translation_set
1 string reference to 'i18n_path_translation_set'
- i18n_path_i18n_translation_set_info in i18n_path/
i18n_path.module - Implements hook_i18n_translation_set_info()
File
- i18n_path/
i18n_path.inc, line 6 - Internationalization (i18n) module - Translation set
View source
class i18n_path_translation_set extends i18n_translation_set {
/**
* Add translation item
*/
public function add_item($path, $langcode = NULL) {
// Path may be object or plain string
$item = is_object($path) ? $path : (object) array(
'path' => $path,
'language' => $langcode,
);
return parent::add_item($item, $langcode);
}
/**
* Clean path translations.
*
* Unlike other translation sets this actually deletes paths
*/
public function clean_translations() {
$delete = db_delete('i18n_path')
->condition('tsid', $this->tsid)
->condition('language', array_keys($this
->get_translations()), 'NOT IN')
->execute();
}
/**
* Delete translation set
*/
public function delete_translations() {
return db_delete('i18n_path')
->condition('tsid', $this->tsid)
->execute();
}
/**
* Save all path translations
*/
public function save_translations() {
foreach ($this
->get_translations() as $lang => $path) {
$path = is_object($path) ? $path : (object) array(
'path' => $path,
'language' => $lang,
'tsid' => $this->tsid,
);
drupal_write_record('i18n_path', $path, !empty($path->tpid) ? 'tpid' : array());
$this
->add_item($path, $lang);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
i18n_path_translation_set:: |
public | function |
Add translation item Overrides i18n_translation_set:: |
|
i18n_path_translation_set:: |
public | function |
Clean path translations. Overrides i18n_translation_set:: |
|
i18n_path_translation_set:: |
public | function |
Delete translation set Overrides i18n_translation_set:: |
|
i18n_path_translation_set:: |
public | function |
Save all path translations Overrides i18n_translation_set:: |
|
i18n_translation_set:: |
public | property | ||
i18n_translation_set:: |
public | property | ||
i18n_translation_set:: |
protected | property | ||
i18n_translation_set:: |
protected | property | ||
i18n_translation_set:: |
public | property | ||
i18n_translation_set:: |
public | property | ||
i18n_translation_set:: |
protected | property | ||
i18n_translation_set:: |
public | property | ||
i18n_translation_set:: |
public | property | ||
i18n_translation_set:: |
public | function | Add array of translation items | |
i18n_translation_set:: |
public | function | Delete a translation set | |
i18n_translation_set:: |
public | function | Get delete path for this translation set | |
i18n_translation_set:: |
public | function | Get edit path for this translation set | |
i18n_translation_set:: |
protected | function | Get field on translations table that stores the translation set id (tsid) | |
i18n_translation_set:: |
public | function | Get property from translation set info | |
i18n_translation_set:: |
public | function | Get item for language | |
i18n_translation_set:: |
public | function | Get items as renderable links | |
i18n_translation_set:: |
public | function | Get overview (list) path for this translation set | |
i18n_translation_set:: |
public | function | Get translations as i18n objects, indexed by language | |
i18n_translation_set:: |
public | function | Get operations as renderable links | |
i18n_translation_set:: |
function | Get placeholder values for path replacement | 1 | |
i18n_translation_set:: |
protected | function | Get table name, where translation items are stored. | |
i18n_translation_set:: |
public | function | Get title for this set | |
i18n_translation_set:: |
public | function | Get translations, indexed by language | |
i18n_translation_set:: |
public | function | Get translations keys, indexed by language | |
i18n_translation_set:: |
public | function | Create a new translation set | |
i18n_translation_set:: |
public | function | Invoke all modules | |
i18n_translation_set:: |
public | function | Get item list | |
i18n_translation_set:: |
protected | function | Get key field for this translation items | |
i18n_translation_set:: |
public | function | Load all translations as objects indexed by language | 2 |
i18n_translation_set:: |
public | function | Remove item / language from translation set | |
i18n_translation_set:: |
public | function | Remove language from translation set. | |
i18n_translation_set:: |
public | function | Remove i18n object from translation set. | |
i18n_translation_set:: |
public | function | Reset translations, set empty array or new array of translations. | |
i18n_translation_set:: |
public | function | Save translation set | |
i18n_translation_set:: |
public | function | Update a translation set | |
i18n_translation_set:: |
public | function | Update a translation set or delete if empty. | |
i18n_translation_set:: |
protected | function | Update related translation sets | |
i18n_translation_set:: |
public | function | Constructor from object/array |