ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilCountrySelectInputGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 
6 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
7 
16 {
20  protected $lng;
21 
22 
29  public function __construct($a_title = "", $a_postvar = "")
30  {
31  global $DIC;
32 
33  $this->lng = $DIC->language();
34  parent::__construct($a_title, $a_postvar);
35  $this->setType("cselect");
36  }
37 
43  public function getOptions()
44  {
45  $lng = $this->lng;
46 
47  $lng->loadLanguageModule("meta");
48  $lng->loadLanguageModule("form");
49 
50  include_once("./Services/Utilities/classes/class.ilCountry.php");
51 
52  foreach (ilCountry::getCountryCodes() as $c) {
53  $options[$c] = $lng->txt("meta_c_" . $c);
54  }
55  asort($options);
56 
57  $options = array("" => "- " . $lng->txt("form_please_select") . " -")
58  + $options;
59 
60  return $options;
61  }
62 }
This class represents a selection list property in a property form.
global $DIC
Definition: saml.php:7
This class represents a selection list property in a property form.
__construct($a_title="", $a_postvar="")
Constructor.
setType($a_type)
Set Type.
static getCountryCodes()
Get country codes (DIN EN 3166-1)