ILIAS  release_8 Revision v8.24
ilObjLanguageFolderGUI Class Reference

Class ilObjLanguageFolderGUI. More...

+ Inheritance diagram for ilObjLanguageFolderGUI:
+ Collaboration diagram for ilObjLanguageFolderGUI:

Public Member Functions

 __construct (?array $a_data, int $a_id, bool $a_call_by_reference)
 Constructor. More...
 
 viewObject ()
 show installed languages More...
 
 installObject ()
 install languages More...
 
 installLocalObject ()
 Install local language modifications. More...
 
 uninstallObject ()
 uninstall language More...
 
 uninstallChangesObject ()
 Uninstall local changes in the database. More...
 
 refreshObject ()
 update all installed languages More...
 
 refreshSelectedObject ()
 update selected languages More...
 
 setUserLanguageObject ()
 set user language More...
 
 setSystemLanguageObject ()
 set the system language More...
 
 checkLanguageObject ()
 check all languages More...
 
 out ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 executeCommand ()
 
 confirmRefreshObject ()
 
 confirmRefreshSelectedObject (array $a_ids=array())
 
 confirmUninstallObject ()
 
 confirmUninstallChangesObject ()
 
 getActions ()
 Get Actions. More...
 
 listDeprecatedObject ()
 Download deprecated lang entries. More...
 
 downloadDeprecatedObject ()
 Download deprecated lang entries. More...
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $desc)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 getTabs ()
 get tabs More...
 
 disableLanguageDetectionObject ()
 Disable language detection. More...
 
 enableLanguageDetectionObject ()
 Enable language detection. More...
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

HTTPServices $http
 
Refinery $refinery
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
int $id
 
bool $referenced
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 getPostId ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjLanguageFolderGUI::__construct ( ?array  $a_data,
int  $a_id,
bool  $a_call_by_reference 
)

Constructor.

Definition at line 42 of file class.ilObjLanguageFolderGUI.php.

43 {
44 global $DIC;
45 $this->type = "lngf";
46 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
47 //$_GET["sort_by"] = "language";
48 $this->lng->loadLanguageModule("lng");
49 $this->http = $DIC->http();
50 $this->refinery = $DIC->refinery();
51 }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkLanguageObject()

ilObjLanguageFolderGUI::checkLanguageObject ( )

check all languages

Definition at line 396 of file class.ilObjLanguageFolderGUI.php.

396 : void
397 {
398 $this->checkPermission("write");
399 $this->data = $this->object->checkAllLanguages();
400 $this->out();
401 }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ilObjectGUI\checkPermission(), and out().

+ Here is the call graph for this function:

◆ confirmRefreshObject()

ilObjLanguageFolderGUI::confirmRefreshObject ( )

Definition at line 460 of file class.ilObjLanguageFolderGUI.php.

460 : void
461 {
462 $this->checkPermission("write");
463
464 $languages = ilObject::_getObjectsByType("lng");
465
466 $ids = array();
467 foreach ($languages as $lang) {
468 $langObj = new ilObjLanguage((int) $lang["obj_id"], false);
469 if ($langObj->isInstalled()) {
470 $ids[] = $lang["obj_id"];
471 }
472 }
473 $this->confirmRefreshSelectedObject($ids);
474 }
confirmRefreshSelectedObject(array $a_ids=array())
Class ilObjLanguage.
static _getObjectsByType(string $obj_type="", int $owner=null)
$lang
Definition: xapiexit.php:26

References $lang, ilObject\_getObjectsByType(), ilObjectGUI\checkPermission(), and confirmRefreshSelectedObject().

+ Here is the call graph for this function:

◆ confirmRefreshSelectedObject()

ilObjLanguageFolderGUI::confirmRefreshSelectedObject ( array  $a_ids = array())

Definition at line 476 of file class.ilObjLanguageFolderGUI.php.

476 : void
477 {
478 $this->checkPermission("write");
479 $this->lng->loadLanguageModule("meta");
480
481 $header = '';
482 $ids = [];
483 if (!empty($a_ids)) {
484 $ids = $a_ids;
485 $header = $this->lng->txt("lang_refresh_confirm");
486 } elseif (!empty($post_id = $this->getPostId())) {
487 $ids = $post_id;
488 $header = $this->lng->txt("lang_refresh_confirm_selected");
489 } else {
490 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
491 $this->ctrl->redirect($this, "view");
492 }
493
494 $conf_screen = new ilConfirmationGUI();
495 $some_changed = false;
496 foreach ($ids as $id) {
497 $lang_key = ilObject::_lookupTitle((int) $id);
498 $lang_title = $this->lng->txt("meta_l_" . $lang_key);
499 $last_change = ilObjLanguage::_getLastLocalChange($lang_key);
500 if (!empty($last_change)) {
501 $some_changed = true;
502 $lang_title .= " (" . $this->lng->txt("last_change") . " "
504 }
505 $conf_screen->addItem("id[]", (string) $id, $lang_title);
506 }
507
508 $conf_screen->setFormAction($this->ctrl->getFormAction($this));
509 if ($some_changed) {
510 $header .= "<br />" . $this->lng->txt("lang_refresh_confirm_info");
511 }
512 $conf_screen->setHeaderText($header);
513 $conf_screen->setCancel($this->lng->txt("cancel"), "view");
514 $conf_screen->setConfirm($this->lng->txt("ok"), "refreshSelected");
515 $this->tpl->setContent($conf_screen->getHTML());
516 }
const IL_CAL_DATETIME
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static _getLastLocalChange(string $a_key)
get the date of the last local change $a_key language key Return change_date "yyyy-mm-dd hh:mm:ss"
static _lookupTitle(int $obj_id)

References ilObject\$id, ilObjLanguage\_getLastLocalChange(), ilObject\_lookupTitle(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), getPostId(), IL_CAL_DATETIME, and ILIAS\Repository\lng().

Referenced by confirmRefreshObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmUninstallChangesObject()

ilObjLanguageFolderGUI::confirmUninstallChangesObject ( )

Definition at line 535 of file class.ilObjLanguageFolderGUI.php.

535 : void
536 {
537 $this->checkPermission('write');
538
539 $this->lng->loadLanguageModule("meta");
540 $conf_screen = new ilConfirmationGUI();
541 $conf_screen->setFormAction($this->ctrl->getFormAction($this));
542 $conf_screen->setHeaderText($this->lng->txt("lang_uninstall_changes_confirm"));
543 foreach ($this->getPostId() as $id) {
544 $lang_title = ilObject::_lookupTitle($id);
545 $conf_screen->addItem("id[]", (string) $id, $this->lng->txt("meta_l_" . $lang_title));
546 }
547 $conf_screen->setCancel($this->lng->txt("cancel"), "view");
548 $conf_screen->setConfirm($this->lng->txt("ok"), "uninstallChanges");
549 $this->tpl->setContent($conf_screen->getHTML());
550 }

References ilObject\$id, ilObject\_lookupTitle(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), getPostId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmUninstallObject()

ilObjLanguageFolderGUI::confirmUninstallObject ( )

Definition at line 518 of file class.ilObjLanguageFolderGUI.php.

518 : void
519 {
520 $this->checkPermission("write");
521
522 $this->lng->loadLanguageModule("meta");
523 $conf_screen = new ilConfirmationGUI();
524 $conf_screen->setFormAction($this->ctrl->getFormAction($this));
525 $conf_screen->setHeaderText($this->lng->txt("lang_uninstall_confirm"));
526 foreach ($this->getPostId() as $id) {
527 $lang_title = ilObject::_lookupTitle($id);
528 $conf_screen->addItem("id[]", (string) $id, $this->lng->txt("meta_l_" . $lang_title));
529 }
530 $conf_screen->setCancel($this->lng->txt("cancel"), "view");
531 $conf_screen->setConfirm($this->lng->txt("ok"), "uninstall");
532 $this->tpl->setContent($conf_screen->getHTML());
533 }

References ilObject\$id, ilObject\_lookupTitle(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), getPostId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ disableLanguageDetectionObject()

ilObjLanguageFolderGUI::disableLanguageDetectionObject ( )
protected

Disable language detection.

Definition at line 572 of file class.ilObjLanguageFolderGUI.php.

572 : void
573 {
574 $this->settings->set("lang_detection", '0');
575 $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
576 $this->viewObject();
577 }
viewObject()
show installed languages

References ILIAS\Repository\lng(), ILIAS\Repository\settings(), and viewObject().

+ Here is the call graph for this function:

◆ downloadDeprecatedObject()

ilObjLanguageFolderGUI::downloadDeprecatedObject ( )

Download deprecated lang entries.

Definition at line 613 of file class.ilObjLanguageFolderGUI.php.

613 : void
614 {
615 include_once "./Services/Language/classes/class.ilLangDeprecated.php";
616 $d = new ilLangDeprecated();
617 $res = "";
618 foreach ($d->getDeprecatedLangVars() as $key => $mod) {
619 $res .= $mod . "," . $key . "\n";
620 }
621
622 ilUtil::deliverData($res, "lang_deprecated.csv");
623 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$res
Definition: ltiservices.php:69
string $key
Consumer key/client ID value.
Definition: System.php:193

References $d, ILIAS\LTI\ToolProvider\$key, $res, and ilUtil\deliverData().

+ Here is the call graph for this function:

◆ enableLanguageDetectionObject()

ilObjLanguageFolderGUI::enableLanguageDetectionObject ( )
protected

Enable language detection.

Definition at line 582 of file class.ilObjLanguageFolderGUI.php.

582 : void
583 {
584 $this->settings->set("lang_detection", '1');
585 $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"));
586 $this->viewObject();
587 }

References ILIAS\Repository\lng(), ILIAS\Repository\settings(), and viewObject().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLanguageFolderGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 429 of file class.ilObjLanguageFolderGUI.php.

429 : void
430 {
431 // always check read permission, needed write permissions are checked in the *Object functions
432 $this->checkPermission("read", "", $this->type, $this->ref_id);
433
434 $next_class = $this->ctrl->getNextClass($this);
435 $cmd = $this->ctrl->getCmd();
436 $this->prepareOutput();
437
438 switch ($next_class) {
439 case "ilpermissiongui":
440 include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
441 $perm_gui = new ilPermissionGUI($this);
442 $this->tabs_gui->activateTab("perm_settings");
443 $this->ctrl->forwardCommand($perm_gui);
444 break;
445
446 default:
447 $this->tabs_gui->activateTab("settings");
448
449 if (!$cmd) {
450 $cmd = "view";
451 }
452
453 $cmd .= "Object";
454 $this->$cmd();
455
456 break;
457 }
458 }
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getActions()

ilObjLanguageFolderGUI::getActions ( )

Get Actions.

Deprecated:
seems to be not needed anymore

Definition at line 556 of file class.ilObjLanguageFolderGUI.php.

556 : array
557 {
558 // standard actions for container
559 return array(
560 "install" => array("name" => "install", "lng" => "install"),
561 "installLocal" => array("name" => "installLocal", "lng" => "install_local"),
562 "uninstall" => array("name" => "uninstall", "lng" => "uninstall"),
563 "refresh" => array("name" => "confirmRefreshSelected", "lng" => "refresh"),
564 "setSystemLanguage" => array("name" => "setSystemLanguage", "lng" => "setSystemLanguage"),
565 "setUserLanguage" => array("name" => "setUserLanguage", "lng" => "setUserLanguage")
566 );
567 }

◆ getAdminTabs()

ilObjLanguageFolderGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 409 of file class.ilObjLanguageFolderGUI.php.

409 : void
410 {
411 $this->getTabs();
412 }

References getTabs().

+ Here is the call graph for this function:

◆ getPostId()

ilObjLanguageFolderGUI::getPostId ( )
private
Returns
int[]|mixed

Definition at line 628 of file class.ilObjLanguageFolderGUI.php.

629 {
630 $post_field = [];
631 if ($this->http->wrapper()->post()->has("id")) {
632 $post_field = $this->http->wrapper()->post()->retrieve(
633 "id",
634 $this->refinery->kindlyTo()->dictOf(
635 $this->refinery->kindlyTo()->int()
636 )
637 );
638 }
639 if ($post_field == null) {
640 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
641 $this->ctrl->redirect($this, "view");
642 }
643 return $post_field;
644 }

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

Referenced by confirmRefreshSelectedObject(), confirmUninstallChangesObject(), confirmUninstallObject(), installLocalObject(), installObject(), refreshSelectedObject(), setSystemLanguageObject(), setUserLanguageObject(), uninstallChangesObject(), and uninstallObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjLanguageFolderGUI::getTabs ( )
protected

get tabs

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 418 of file class.ilObjLanguageFolderGUI.php.

418 : void
419 {
420 if ($this->checkPermissionBool("read")) {
421 $this->tabs_gui->addTab("settings", $this->lng->txt("settings"), $this->ctrl->getLinkTarget($this, "view"));
422 }
423
424 if ($this->checkPermissionBool("edit_permission")) {
425 $this->tabs_gui->addTab("perm_settings", $this->lng->txt("perm_settings"), $this->ctrl->getLinkTargetByClass(array(self::class,"ilpermissiongui"), "perm"));
426 }
427 }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ilObjectGUI\checkPermissionBool(), and ILIAS\Repository\lng().

Referenced by getAdminTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ installLocalObject()

ilObjLanguageFolderGUI::installLocalObject ( )

Install local language modifications.

Definition at line 139 of file class.ilObjLanguageFolderGUI.php.

139 : void
140 {
141 $this->checkPermission("write");
142 $this->lng->loadLanguageModule("meta");
143
144 foreach ($this->getPostId() as $obj_id) {
145 $langObj = new ilObjLanguage($obj_id);
146 $key = $langObj->install();
147
148 if ($key !== "") {
149 $lang_installed[] = $key;
150 }
151
152 unset($langObj);
153
154 $langObj = new ilObjLanguage($obj_id);
155 $key = $langObj->install("local");
156
157 if ($key !== "") {
158 $local_installed[] = $key;
159 }
160
161 unset($langObj);
162 }
163
164 if (isset($lang_installed)) {
165 if (count($lang_installed) === 1) {
166 $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
167 } else {
168 $langnames = [];
169 foreach ($lang_installed as $lang_key) {
170 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
171 }
172 $this->data = implode(", ", $langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
173 }
174 }
175
176 if (isset($local_installed)) {
177 if (count($local_installed) === 1) {
178 $this->data .= " " . $this->lng->txt("meta_l_" . $local_installed[0]) . " " . $this->lng->txt("local_language_file") . " " . strtolower($this->lng->txt("installed")) . ".";
179 } else {
180 $langnames = [];
181 foreach ($local_installed as $lang_key) {
182 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
183 }
184 $this->data .= " " . implode(", ", $langnames) . " " . $this->lng->txt("local_language_files") . " " . strtolower($this->lng->txt("installed")) . ".";
185 }
186 } else {
187 $this->data .= " " . $this->lng->txt("local_languages_already_installed");
188 }
189
190 $this->out();
191 }

References ILIAS\LTI\ToolProvider\$key, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), getPostId(), ILIAS\Repository\lng(), and out().

+ Here is the call graph for this function:

◆ installObject()

ilObjLanguageFolderGUI::installObject ( )

install languages

Definition at line 102 of file class.ilObjLanguageFolderGUI.php.

102 : void
103 {
104 $this->checkPermission("write");
105 $this->lng->loadLanguageModule("meta");
106
107 foreach ($this->getPostId() as $obj_id) {
108 $langObj = new ilObjLanguage((int) $obj_id);
109 $key = $langObj->install();
110
111 if ($key !== "") {
112 $lang_installed[] = $key;
113 }
114
115 unset($langObj);
116 }
117
118 if (isset($lang_installed)) {
119 if (count($lang_installed) === 1) {
120 $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
121 } else {
122 $langnames = [];
123 foreach ($lang_installed as $lang_key) {
124 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
125 }
126 $this->data = implode(", ", $langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
127 }
128 } else {
129 $this->data = $this->lng->txt("languages_already_installed");
130 }
131
132 $this->out();
133 }

References ILIAS\LTI\ToolProvider\$key, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), getPostId(), ILIAS\Repository\lng(), and out().

+ Here is the call graph for this function:

◆ listDeprecatedObject()

ilObjLanguageFolderGUI::listDeprecatedObject ( )

Download deprecated lang entries.

Definition at line 592 of file class.ilObjLanguageFolderGUI.php.

592 : void
593 {
594 $button = ilLinkButton::getInstance();
595 $button->setCaption("download");
596 $button->setUrl($this->ctrl->getLinkTarget($this, "downloadDeprecated"));
597 $this->toolbar->addButtonInstance($button);
598
599 include_once "./Services/Language/classes/class.ilLangDeprecated.php";
600
601 $d = new ilLangDeprecated();
602 $res = "";
603 foreach ($d->getDeprecatedLangVars() as $key => $mod) {
604 $res .= $mod . "," . $key . "\n";
605 }
606
607 $this->tpl->setContent("<pre>" . $res . "</pre>");
608 }

References $d, ILIAS\LTI\ToolProvider\$key, $res, ILIAS\Repository\ctrl(), ilLinkButton\getInstance(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ out()

ilObjLanguageFolderGUI::out ( )

Definition at line 403 of file class.ilObjLanguageFolderGUI.php.

403 : void
404 {
405 $this->tpl->setOnScreenMessage('info', $this->data, true);
406 $this->ctrl->redirect($this, "view");
407 }

References ILIAS\Repository\ctrl().

Referenced by checkLanguageObject(), installLocalObject(), installObject(), refreshObject(), refreshSelectedObject(), setSystemLanguageObject(), setUserLanguageObject(), uninstallChangesObject(), and uninstallObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshObject()

ilObjLanguageFolderGUI::refreshObject ( )

update all installed languages

Definition at line 276 of file class.ilObjLanguageFolderGUI.php.

276 : void
277 {
278 $this->checkPermission("write");
279
281 $this->data = $this->lng->txt("languages_updated");
282 $this->out();
283 }
static refreshAll()
Refresh all installed languages.

References ilObjectGUI\checkPermission(), ILIAS\Repository\lng(), out(), and ilObjLanguage\refreshAll().

+ Here is the call graph for this function:

◆ refreshSelectedObject()

ilObjLanguageFolderGUI::refreshSelectedObject ( )

update selected languages

Definition at line 289 of file class.ilObjLanguageFolderGUI.php.

289 : void
290 {
291 $this->checkPermission("write");
292 $this->data = $this->lng->txt("selected_languages_updated");
293 $this->lng->loadLanguageModule("meta");
294
295 $refreshed = array();
296 foreach ($this->getPostId() as $id) {
297 $langObj = new ilObjLanguage((int) $id, false);
298 if ($langObj->refresh()) {
299 $refreshed[] = $langObj->getKey();
300 $this->data .= "<br />" . $this->lng->txt("meta_l_" . $langObj->getKey());
301 }
302 unset($langObj);
303 }
304
306 $this->out();
307 }
static refreshPlugins(array $a_lang_keys=null)
Refresh languages of activated plugins $a_lang_keys keys of languages to be refreshed (not yet suppor...

References ilObject\$id, ilObjectGUI\checkPermission(), getPostId(), ILIAS\Repository\lng(), out(), and ilObjLanguage\refreshPlugins().

+ Here is the call graph for this function:

◆ setSystemLanguageObject()

ilObjLanguageFolderGUI::setSystemLanguageObject ( )

set the system language

Definition at line 356 of file class.ilObjLanguageFolderGUI.php.

356 : void
357 {
358 $this->checkPermission("write");
359 $this->lng->loadLanguageModule("meta");
360
361 $post_id = $this->getPostId();
362
363 if (count($post_id) !== 1) {
364 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("choose_only_one_language") . "<br/>" . $this->lng->txt("action_aborted"), true);
365 $this->ctrl->redirect($this, "view");
366 }
367
368 $obj_id = $post_id[0];
369
370 $newSysLangObj = new ilObjLanguage($obj_id);
371
372 if ($newSysLangObj->isSystemLanguage()) {
373 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("meta_l_" . $newSysLangObj->getKey()) . " " . $this->lng->txt("is_already_your") . " " . $this->lng->txt("system_language") . "<br/>" . $this->lng->txt("action_aborted"), true);
374 $this->ctrl->redirect($this, "view");
375 }
376
377 if (!$newSysLangObj->isInstalled()) {
378 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("meta_l_" . $newSysLangObj->getKey()) . " " . $this->lng->txt("language_not_installed") . "<br/>" . $this->lng->txt("action_aborted"), true);
379 $this->ctrl->redirect($this, "view");
380 }
381
382 $this->ilias->setSetting("language", $newSysLangObj->getKey());
383
384 // update ini-file
385 $this->ilias->ini->setVariable("language", "default", $newSysLangObj->getKey());
386 $this->ilias->ini->write();
387
388 $this->data = $this->lng->txt("system_language") . " " . $this->lng->txt("changed_to") . " " . $this->lng->txt("meta_l_" . $newSysLangObj->getKey()) . ".";
389
390 $this->out();
391 }
header include for all ilias files.

References ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), getPostId(), ILIAS\Repository\lng(), and out().

+ Here is the call graph for this function:

◆ setUserLanguageObject()

ilObjLanguageFolderGUI::setUserLanguageObject ( )

set user language

Definition at line 312 of file class.ilObjLanguageFolderGUI.php.

312 : void
313 {
314 global $DIC;
315 $ilUser = $DIC->user();
316
317 $this->checkPermission("write");
318 $this->lng->loadLanguageModule("meta");
319
320 require_once "./Services/User/classes/class.ilObjUser.php";
321
322 $post_id = $this->getPostId();
323
324 if (count($post_id) !== 1) {
325 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("choose_only_one_language") . "<br/>" . $this->lng->txt("action_aborted"), true);
326 $this->ctrl->redirect($this, "view");
327 }
328
329 $obj_id = $post_id[0];
330
331 $newUserLangObj = new ilObjLanguage($obj_id);
332
333 if ($newUserLangObj->isUserLanguage()) {
334 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . " " . $this->lng->txt("is_already_your") . " " . $this->lng->txt("user_language") . "<br/>" . $this->lng->txt("action_aborted"), true);
335 $this->ctrl->redirect($this, "view");
336 }
337
338 if (!$newUserLangObj->isInstalled()) {
339 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . " " . $this->lng->txt("language_not_installed") . "<br/>" . $this->lng->txt("action_aborted"), true);
340 $this->ctrl->redirect($this, "view");
341 }
342
343 $curUser = new ilObjUser($ilUser->getId());
344 $curUser->setLanguage($newUserLangObj->getKey());
345 $curUser->update();
346
347 $this->data = $this->lng->txt("user_language") . " " . $this->lng->txt("changed_to") . " " . $this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . ".";
348
349 $this->out();
350 }
User class.
$ilUser
Definition: imgupload.php:34

References $DIC, $ilUser, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), getPostId(), ILIAS\Repository\lng(), and out().

+ Here is the call graph for this function:

◆ uninstallChangesObject()

ilObjLanguageFolderGUI::uninstallChangesObject ( )

Uninstall local changes in the database.

Definition at line 244 of file class.ilObjLanguageFolderGUI.php.

244 : void
245 {
246 $this->checkPermission("write");
247
248 $this->data = $this->lng->txt("selected_languages_updated");
249 $this->lng->loadLanguageModule("meta");
250 $refreshed = [];
251
252 foreach ($this->getPostId() as $id) {
253 $langObj = new ilObjLanguage((int) $id, false);
254
255 if ($langObj->isInstalled()) {
256 if ($langObj->check()) {
257 $langObj->flush("all");
258 $langObj->insert();
259 $langObj->setTitle($langObj->getKey());
260 $langObj->setDescription("installed");
261 $langObj->update();
262 $refreshed[] = $langObj->getKey();
263 }
264 $this->data .= "<br />" . $this->lng->txt("meta_l_" . $langObj->getKey());
265 }
266
267 unset($langObj);
268 }
270 $this->out();
271 }

References ilObject\$id, ilObjectGUI\checkPermission(), getPostId(), ILIAS\Repository\lng(), out(), and ilObjLanguage\refreshPlugins().

+ Here is the call graph for this function:

◆ uninstallObject()

ilObjLanguageFolderGUI::uninstallObject ( )

uninstall language

Definition at line 197 of file class.ilObjLanguageFolderGUI.php.

197 : void
198 {
199 $this->checkPermission('write');
200 $this->lng->loadLanguageModule("meta");
201
202 $sys_lang = false;
203 $usr_lang = false;
204
205 // uninstall all selected languages
206 foreach ($this->getPostId() as $obj_id) {
207 $langObj = new ilObjLanguage($obj_id);
208 if (!($sys_lang = $langObj->isSystemLanguage()) && !($usr_lang = $langObj->isUserLanguage())) {
209 $key = $langObj->uninstall();
210 if ($key !== "") {
211 $lang_uninstalled[] = $key;
212 }
213 }
214 unset($langObj);
215 }
216
217 // generate output message
218 if (isset($lang_uninstalled)) {
219 if (count($lang_uninstalled) === 1) {
220 $this->data = $this->lng->txt("meta_l_" . $lang_uninstalled[0]) . " " . $this->lng->txt("uninstalled");
221 } else {
222 $langnames = [];
223 foreach ($lang_uninstalled as $lang_key) {
224 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
225 }
226
227 $this->data = implode(", ", $langnames) . " " . $this->lng->txt("uninstalled");
228 }
229 } elseif ($sys_lang) {
230 $this->data = $this->lng->txt("cannot_uninstall_systemlanguage");
231 } elseif ($usr_lang) {
232 $this->data = $this->lng->txt("cannot_uninstall_language_in_use");
233 } else {
234 $this->data = $this->lng->txt("languages_already_uninstalled");
235 }
236
237 $this->out();
238 }

References ILIAS\LTI\ToolProvider\$key, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), getPostId(), ILIAS\Repository\lng(), and out().

+ Here is the call graph for this function:

◆ viewObject()

ilObjLanguageFolderGUI::viewObject ( )

show installed languages

Reimplemented from ilObjectGUI.

Definition at line 56 of file class.ilObjLanguageFolderGUI.php.

56 : void
57 {
58 global $DIC;
59
60 if ($this->checkPermissionBool("write")) {
61 // refresh
62 $refresh = ilLinkButton::getInstance();
63 $refresh->setUrl($this->ctrl->getLinkTarget($this, "confirmRefresh"));
64 $refresh->setCaption("refresh_languages");
65 $this->toolbar->addButtonInstance($refresh);
66
67 // check languages
69 $check->setUrl($this->ctrl->getLinkTarget($this, "checkLanguage"));
70 $check->setCaption("check_languages");
71 $this->toolbar->addButtonInstance($check);
72 }
73
74 $ilClientIniFile = $DIC["ilClientIniFile"];
75 if ($ilClientIniFile->variableExists("system", "LANGUAGE_LOG")) {
76 $download = ilLinkButton::getInstance();
77 $download->setUrl($this->ctrl->getLinkTarget($this, "listDeprecated"));
78 $download->setCaption("lng_download_deprecated");
79 $this->toolbar->addButtonInstance($download);
80 }
81
82 if ($this->checkPermissionBool("write")) {
83 if (!$this->settings->get("lang_detection")) {
84 // Toggle Button for auto language detection (toggle off)
85 $toggleButton = $DIC->ui()->factory()->button()->toggle("", $DIC->ctrl()->getLinkTarget($this, "enableLanguageDetection"), $DIC->ctrl()->getLinkTarget($this, "disableLanguageDetection"), false)
86 ->withLabel($this->lng->txt("language_detection"))->withAriaLabel($this->lng->txt("lng_enable_language_detection"));
87 } else {
88 // Toggle Button for auto language detection (toggle on)
89 $toggleButton = $DIC->ui()->factory()->button()->toggle("", $DIC->ctrl()->getLinkTarget($this, "enableLanguageDetection"), $DIC->ctrl()->getLinkTarget($this, "disableLanguageDetection"), true)
90 ->withLabel($this->lng->txt("language_detection"))->withAriaLabel($this->lng->txt("lng_disable_language_detection"));
91 }
92 $this->toolbar->addComponent($toggleButton);
93 }
94
95 $ltab = new ilLanguageTableGUI($this, "view", $this->object);
96 $this->tpl->setContent($ltab->getHTML());
97 }
$check
Definition: buildRTE.php:81

References $check, $DIC, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilLinkButton\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ILIAS\Repository\toolbar().

Referenced by disableLanguageDetectionObject(), and enableLanguageDetectionObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $http

HTTPServices ilObjLanguageFolderGUI::$http
protected

Definition at line 36 of file class.ilObjLanguageFolderGUI.php.

◆ $refinery

Refinery ilObjLanguageFolderGUI::$refinery
protected

Definition at line 37 of file class.ilObjLanguageFolderGUI.php.


The documentation for this class was generated from the following file: