I have done custom module with .class.inc and .module file. Class file is added in module info file.
Inside class file:
/**
* Controller for Language realms.
*/
class MyModuleI18nVariableLanguageRealm extends I18nVariableLanguageRealm {
public function getKey() {
return isset($this->current_key) ? $this->current_key : FALSE;
}
}
Inside module file:
/**
* Implements hook_variable_realm_info
*/
function mymodule_i18n_variable_variable_realm_info() {
$realm['language'] = array(
'title' => t('Language'),
'weight' => 1,
'controller class' => 'MyModuleI18nVariableLanguageRealm',
'store class' => 'VariableStoreRealmStore',
// Variables for this realm can be selected from a list.
'select' => TRUE,
'select path' => 'admin/config/regional/i18n/variable',
// Name for variables that belong to this realm: 'multilingual' variable/s
'variable name' => t('multilingual'),
'variable class' => 'i18n-variable',
// Automatically handle these variables in system settings forms.
'form settings' => TRUE,
'form switcher' => TRUE,
);
return $realm;
}
but debugging shows that custom controller isn't in use. What am I doing wrong here?