ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilCountrySelectInputGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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  {
42  $lng = $this->lng;
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.
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.
loadLanguageModule(string $a_module)
Load language module.
__construct(string $a_title="", string $a_postvar="")
$c
Definition: deliver.php:25
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
static getCountryCodes()
Get country codes (DIN EN 3166-1)