public function getTimezones($element) { $translator = \Eva\Api::_()->getServiceManager()->get('translator'); $locale = $translator->getLocale(); $languages = \Eva\Locale\Data::getList($locale, 'citytotimezone'); $element['options']['value_options'] = $languages; return $element; }
public function getCountries($element) { $translator = \Eva\Api::_()->getServiceManager()->get('translator'); $locale = $translator->getLocale(); $countries = \Eva\Locale\Data::getList($locale, 'territory'); $element['options']['value_options'] = $countries; return $element; }
public function getLanguages($element) { $translator = \Eva\Api::_()->getServiceManager()->get('translator'); $locale = $translator->getLocale(); $languages = \Eva\Locale\Data::getList($locale, 'language'); $element['options']['value_options'] = $languages; $element['attributes']['value'] = $locale; return $element; }
public function __invoke($dataType, $dataKey, $locale = null) { if (!$locale) { $locale = $this->translator->getLocale(); } $list = Data::getList($locale, $dataType); if (isset($list[$dataKey])) { return $list[$dataKey]; } }