コード例 #1
0
 /**
  * Build the language dropdown.
  *
  * @todo do this on a page by page rather than global
  *
  * @return Form
  */
 function LanguageForm()
 {
     if ($module = $this->getModule()) {
         $langs = DocumentationService::get_registered_languages($module->getModuleFolder());
     } else {
         $langs = DocumentationService::get_registered_languages();
     }
     $fields = new FieldSet($dropdown = new DropdownField('LangCode', _t('DocumentationViewer.LANGUAGE', 'Language'), $langs, $this->Lang));
     $actions = new FieldSet(new FormAction('doLanguageForm', _t('DocumentationViewer.CHANGE', 'Change')));
     $dropdown->setDisabled(true);
     return new Form($this, 'LanguageForm', $fields, $actions);
 }