ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCountrySelectInputGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
29 public function __construct(
30 string $a_title = "",
31 string $a_postvar = ""
32 ) {
33 global $DIC;
34
35 $this->lng = $DIC->language();
36 parent::__construct($a_title, $a_postvar);
37 $this->setType("cselect");
38 }
39
40 public function getOptions(): array
41 {
43
44 $lng->loadLanguageModule("meta");
45 $lng->loadLanguageModule("form");
46
47 foreach (ilCountry::getCountryCodes() as $c) {
48 $options[$c] = $lng->txt("meta_c_" . $c);
49 }
50 asort($options);
51
52 $options = array("" => "- " . $lng->txt("form_please_select") . " -")
53 + $options;
54
55 return $options;
56 }
57}
This class represents a selection list property in a property form.
__construct(string $a_title="", string $a_postvar="")
static getCountryCodes()
Get country codes (DIN EN 3166-1)
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a selection list property in a property form.
$c
Definition: deliver.php:25
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26