class i18n_menu_link in Internationalization 7
Menu link object
Hierarchy
- class \i18n_object_wrapper
- class \i18n_string_object_wrapper
- class \i18n_menu_link
- class \i18n_string_object_wrapper
Expanded class hierarchy of i18n_menu_link
1 string reference to 'i18n_menu_link'
- i18n_menu_i18n_object_info in i18n_menu/
i18n_menu.i18n.inc - Implements hook_i18n_object_info().
File
- i18n_menu/
i18n_menu.inc, line 31 - Internationalization (i18n) module - Translation set
View source
class i18n_menu_link extends i18n_string_object_wrapper {
/**
* Class constructor
*/
public function __construct($type, $key, $object) {
// Unserialize options if not done
if (isset($object['options']) && !is_array($object['options'])) {
$object['options'] = unserialize($object['options']);
}
parent::__construct($type, $key, $object);
}
/**
* Get path for item
*/
public function get_path() {
return $this->object['link_path'];
}
/**
* Get title from item
*/
public function get_title() {
return $this->object['title'];
}
/**
* Translation mode for object
*/
public function get_translate_mode() {
$mode = i18n_menu_mode($this->object['menu_name']);
if ($this
->get_langcode()) {
return $mode & I18N_MODE_TRANSLATE;
}
elseif (!empty($this->object['customized'])) {
return $mode & I18N_MODE_LOCALIZE;
}
else {
return I18N_MODE_NONE;
}
}
/**
* Access to object translation. This should check object properties and permissions
*/
protected function translate_access() {
return user_access('administer menu') && user_access('translate interface');
}
/**
* Get translatable properties.
*
* Check whether title or description are to be translated by default menu
* system.
*/
protected function build_properties() {
$properties = parent::build_properties();
if ($properties) {
$strings =& $properties['menu']['item'][$this
->get_key()];
$localizable = _i18n_menu_link_localizable_properties($this->object);
foreach ($strings as $key => $data) {
if (!in_array($key, $localizable)) {
unset($strings[$key]);
}
}
}
return $properties;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
i18n_menu_link:: |
protected | function |
Get translatable properties. Overrides i18n_string_object_wrapper:: |
|
i18n_menu_link:: |
public | function |
Get path for item Overrides i18n_object_wrapper:: |
|
i18n_menu_link:: |
public | function |
Get title from item Overrides i18n_object_wrapper:: |
|
i18n_menu_link:: |
public | function |
Translation mode for object Overrides i18n_string_object_wrapper:: |
|
i18n_menu_link:: |
protected | function |
Access to object translation. This should check object properties and permissions Overrides i18n_object_wrapper:: |
|
i18n_menu_link:: |
public | function |
Class constructor Overrides i18n_object_wrapper:: |
|
i18n_object_wrapper:: |
protected | property | ||
i18n_object_wrapper:: |
protected | property | ||
i18n_object_wrapper:: |
protected | property | ||
i18n_object_wrapper:: |
protected | property | ||
i18n_object_wrapper:: |
function | Get edit path for object | 2 | |
i18n_object_wrapper:: |
function | Get field value from object/array | ||
i18n_object_wrapper:: |
function | Get string numeric key for indexing. | ||
i18n_object_wrapper:: |
public | function | Get object info | |
i18n_object_wrapper:: |
function | Get key value from object/array | ||
i18n_object_wrapper:: |
public | function | Get language code | |
i18n_object_wrapper:: |
public | function | Get real object or array. | |
i18n_object_wrapper:: |
protected | function | Get menu placehoders for object | |
i18n_object_wrapper:: |
public | function | Get object string translation info | |
i18n_object_wrapper:: |
function | Menu access callback for mixed translation tab | ||
i18n_object_wrapper:: |
public | function | Get object translation set info | |
i18n_object_wrapper:: |
function | Get translation set id if any | ||
i18n_object_wrapper:: |
public | function | Get object type | |
i18n_object_wrapper:: |
function | Load real object or array. | 1 | |
i18n_object_wrapper:: |
function | Localize object if localizable. | ||
i18n_object_wrapper:: |
protected | function | Replace path with placeholders | |
i18n_object_wrapper:: |
function | Set field value to object/array | ||
i18n_object_wrapper:: |
function | Set translation set id | ||
i18n_string_object_wrapper:: |
protected | property | ||
i18n_string_object_wrapper:: |
protected | property | ||
i18n_string_object_wrapper:: |
public | function | Get object translatable properties | |
i18n_string_object_wrapper:: |
public | function | Get object strings for translation | |
i18n_string_object_wrapper:: |
public | function | Get string context | 3 |
i18n_string_object_wrapper:: |
public | function | Get textgroup name | |
i18n_string_object_wrapper:: |
protected | function | Context to be pre-loaded before translation. | 2 |
i18n_string_object_wrapper:: |
public | function | Get translate path for object | 2 |
i18n_string_object_wrapper:: |
public | function | Load all existing strings for this object. | |
i18n_string_object_wrapper:: |
protected | function |
Translate access (localize strings) Overrides i18n_object_wrapper:: |
|
i18n_string_object_wrapper:: |
public | function | Remove all strings for this object. | |
i18n_string_object_wrapper:: |
public | function | Update all strings for this object. | |
i18n_string_object_wrapper:: |
protected | function | Get textgroup object | |
i18n_string_object_wrapper:: |
public | function |
Translate object. Overrides i18n_object_wrapper:: |
|
i18n_string_object_wrapper:: |
protected | function | Translate object property. | 2 |
i18n_string_object_wrapper:: |
protected | function | Translate all properties for object. |