ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjLanguageFolderGUI Class Reference

Class ilObjLanguageFolderGUI. More...

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

Public Member Functions

 __construct ($a_data, $a_id, $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 ()
 
 getTabs ()
 get tabs public More...
 
 executeCommand ()
 
 confirmRefreshObject ()
 
 confirmRefreshSelectedObject ($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 ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 setOfflineStatus ($a_status)
 Set offline status. More...
 
 getOfflineStatus ()
 Get offline status. More...
 
 supportsOfflineHandling ()
 Check whether object supports offline handling. More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 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 If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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 public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 disableLanguageDetectionObject ()
 Disable language detection. More...
 
 enableLanguageDetectionObject ()
 Enable language detection. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_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...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static lookupOfflineStatus ($a_obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id, $a_deleted_by)
 
static setDeletedDates ($a_ref_ids, $a_user_id)
 Set deleted date. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjLanguageFolderGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Constructor.

public

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

References $_GET, and ILIAS\GlobalScreen\Provider\__construct().

28  {
29  $this->type = "lngf";
30  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
31  $_GET["sort_by"] = "language";
32  $this->lng->loadLanguageModule('lng');
33  }
$_GET["client_id"]
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkLanguageObject()

ilObjLanguageFolderGUI::checkLanguageObject ( )

check all languages

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

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

392  {
393  $this->checkPermission('write');
394  $this->data = $this->object->checkAllLanguages();
395  $this->out();
396  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ confirmRefreshObject()

ilObjLanguageFolderGUI::confirmRefreshObject ( )

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

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

459  {
460  $this->checkPermission('write');
461 
462  $languages = ilObject::_getObjectsByType("lng");
463 
464  $ids = array();
465  foreach ($languages as $lang) {
466  $langObj = new ilObjLanguage($lang["obj_id"], false);
467  if ($langObj->isInstalled() == true) {
468  $ids[] = $lang["obj_id"];
469  }
470  }
471  $this->confirmRefreshSelectedObject($ids);
472  }
Class ilObjLanguage.
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
$lang
Definition: xapiexit.php:8
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ confirmRefreshSelectedObject()

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

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

References $_POST, ilObject\$id, ilObjLanguage\_getLastLocalChange(), ilObject\_lookupTitle(), ilObjectGUI\checkPermission(), ilDatePresentation\formatDate(), and IL_CAL_DATETIME.

Referenced by confirmRefreshObject().

475  {
476  $this->checkPermission('write');
477  $this->lng->loadLanguageModule("meta");
478 
479  if (!empty($a_ids)) {
480  $ids = $a_ids;
481  $header = $this->lng->txt("lang_refresh_confirm");
482  } elseif (!empty($_POST["id"])) {
483  $ids = $_POST["id"];
484  $header = $this->lng->txt("lang_refresh_confirm_selected");
485  } else {
486  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
487  }
488 
489 
490  $conf_screen = new ilConfirmationGUI();
491  $some_changed = false;
492  foreach ($ids as $id) {
493  $lang_key = ilObject::_lookupTitle($id);
494  $lang_title = $this->lng->txt('meta_l_' . $lang_key);
495  $last_change = ilObjLanguage::_getLastLocalChange($lang_key);
496  if (!empty($last_change)) {
497  $some_changed = true;
498  $lang_title .= ' (' . $this->lng->txt("last_change") . ' '
499  . ilDatePresentation::formatDate(new ilDateTime($last_change, IL_CAL_DATETIME)) . ')';
500  }
501  $conf_screen->addItem("id[]", $id, $lang_title);
502  }
503 
504  $conf_screen->setFormAction($this->ctrl->getFormAction($this));
505  if ($some_changed) {
506  $header .= '<br />' . $this->lng->txt("lang_refresh_confirm_info");
507  }
508  $conf_screen->setHeaderText($header);
509  $conf_screen->setCancel($this->lng->txt("cancel"), "view");
510  $conf_screen->setConfirm($this->lng->txt("ok"), "refreshSelected");
511  $this->tpl->setContent($conf_screen->getHTML());
512  }
const IL_CAL_DATETIME
static _lookupTitle($a_id)
lookup object title
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
redirection script todo: (a better solution should control the processing via a xml file) ...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _getLastLocalChange($a_key)
get the date of the last local change
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmUninstallChangesObject()

ilObjLanguageFolderGUI::confirmUninstallChangesObject ( )

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

References $_POST, ilObject\$id, ilObject\_lookupTitle(), and ilObjectGUI\checkPermission().

538  {
539  $this->checkPermission('write');
540 
541  if (!isset($_POST["id"])) {
542  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
543  }
544 
545  $this->lng->loadLanguageModule("meta");
546  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
547  $conf_screen = new ilConfirmationGUI();
548  $conf_screen->setFormAction($this->ctrl->getFormAction($this));
549  $conf_screen->setHeaderText($this->lng->txt("lang_uninstall_changes_confirm"));
550  foreach ($_POST["id"] as $id) {
551  $lang_title = ilObject::_lookupTitle($id);
552  $conf_screen->addItem("id[]", $id, $this->lng->txt("meta_l_" . $lang_title));
553  }
554  $conf_screen->setCancel($this->lng->txt("cancel"), "view");
555  $conf_screen->setConfirm($this->lng->txt("ok"), "uninstallChanges");
556  $this->tpl->setContent($conf_screen->getHTML());
557  }
static _lookupTitle($a_id)
lookup object title
redirection script todo: (a better solution should control the processing via a xml file) ...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmUninstallObject()

ilObjLanguageFolderGUI::confirmUninstallObject ( )

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

References $_POST, ilObject\$id, ilObject\_lookupTitle(), and ilObjectGUI\checkPermission().

515  {
516  $this->checkPermission('write');
517 
518  if (!isset($_POST["id"])) {
519  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
520  }
521 
522  $this->lng->loadLanguageModule("meta");
523  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
524  $conf_screen = new ilConfirmationGUI();
525  $conf_screen->setFormAction($this->ctrl->getFormAction($this));
526  $conf_screen->setHeaderText($this->lng->txt("lang_uninstall_confirm"));
527  foreach ($_POST["id"] as $id) {
528  $lang_title = ilObject::_lookupTitle($id);
529  $conf_screen->addItem("id[]", $id, $this->lng->txt("meta_l_" . $lang_title));
530  }
531  $conf_screen->setCancel($this->lng->txt("cancel"), "view");
532  $conf_screen->setConfirm($this->lng->txt("ok"), "uninstall");
533  $this->tpl->setContent($conf_screen->getHTML());
534  }
static _lookupTitle($a_id)
lookup object title
redirection script todo: (a better solution should control the processing via a xml file) ...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ disableLanguageDetectionObject()

ilObjLanguageFolderGUI::disableLanguageDetectionObject ( )
protected

Disable language detection.

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

References settings(), and viewObject().

580  {
581  $this->settings->set('lang_detection', 0);
582  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
583  $this->viewObject();
584  }
settings()
Definition: settings.php:2
viewObject()
show installed languages
+ Here is the call graph for this function:

◆ downloadDeprecatedObject()

ilObjLanguageFolderGUI::downloadDeprecatedObject ( )

Download deprecated lang entries.

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

References $d, $res, and ilUtil\deliverData().

621  {
622  include_once("./Services/Language/classes/class.ilLangDeprecated.php");
623  $d = new ilLangDeprecated();
624  $res = "";
625  foreach ($d->getDeprecatedLangVars() as $key => $mod) {
626  $res .= $mod . "," . $key . "\n";
627  }
628 
629  ilUtil::deliverData($res, "lang_deprecated.csv");
630  }
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
Search for deprecated lang vars.
foreach($_POST as $key=> $value) $res
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

◆ enableLanguageDetectionObject()

ilObjLanguageFolderGUI::enableLanguageDetectionObject ( )
protected

Enable language detection.

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

References settings(), and viewObject().

590  {
591  $this->settings->set('lang_detection', 1);
592  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
593  $this->viewObject();
594  }
settings()
Definition: settings.php:2
viewObject()
show installed languages
+ Here is the call graph for this function:

◆ executeCommand()

ilObjLanguageFolderGUI::executeCommand ( )

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

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

427  {
428  // always check read permission, needed write permissions are checked in the *Object functions
429  $this->checkPermission('read', '', $this->type, $this->ref_id);
430 
431  $next_class = $this->ctrl->getNextClass($this);
432  $cmd = $this->ctrl->getCmd();
433  $this->prepareOutput();
434 
435  switch ($next_class) {
436  case 'ilpermissiongui':
437  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
438  $perm_gui = new ilPermissionGUI($this);
439  $this->tabs_gui->activateTab('perm_settings');
440  $this->ctrl->forwardCommand($perm_gui);
441  break;
442 
443  default:
444  $this->tabs_gui->activateTab('settings');
445 
446  if (!$cmd) {
447  $cmd = "view";
448  }
449 
450  $cmd .= "Object";
451  $this->$cmd();
452 
453  break;
454  }
455  return true;
456  }
prepareOutput($a_show_subobjects=true)
prepare output
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getActions()

ilObjLanguageFolderGUI::getActions ( )

Get Actions.

Deprecated:
seems to be not needed anymore

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

564  {
565  // standard actions for container
566  return array(
567  "install" => array("name" => "install", "lng" => "install"),
568  "installLocal" => array("name" => "installLocal", "lng" => "install_local"),
569  "uninstall" => array("name" => "uninstall", "lng" => "uninstall"),
570  "refresh" => array("name" => "confirmRefreshSelected", "lng" => "refresh"),
571  "setSystemLanguage" => array("name" => "setSystemLanguage", "lng" => "setSystemLanguage"),
572  "setUserLanguage" => array("name" => "setUserLanguage", "lng" => "setUserLanguage")
573  );
574  }

◆ getAdminTabs()

ilObjLanguageFolderGUI::getAdminTabs ( )

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

References getTabs().

406  {
407  $this->getTabs();
408  }
+ Here is the call graph for this function:

◆ getTabs()

ilObjLanguageFolderGUI::getTabs ( )

get tabs public

Parameters
objecttabs gui object

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

References ilObjectGUI\checkPermissionBool().

Referenced by getAdminTabs().

416  {
417  if ($this->checkPermissionBool("read")) {
418  $this->tabs_gui->addTab('settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, "view"));
419  }
420 
421  if ($this->checkPermissionBool('edit_permission')) {
422  $this->tabs_gui->addTab('perm_settings', $this->lng->txt('perm_settings'), $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
423  }
424  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ 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 130 of file class.ilObjLanguageFolderGUI.php.

References $_POST, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), and out().

131  {
132  $this->checkPermission('write');
133  $this->lng->loadLanguageModule("meta");
134 
135  if (!isset($_POST["id"])) {
136  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
137  }
138 
139  foreach ($_POST["id"] as $obj_id) {
140  $langObj = new ilObjLanguage($obj_id);
141  $key = $langObj->install();
142 
143  if ($key != "") {
144  $lang_installed[] = $key;
145  }
146 
147  unset($langObj);
148 
149  $langObj = new ilObjLanguage($obj_id);
150  $key = $langObj->install('local');
151 
152  if ($key != "") {
153  $local_installed[] = $key;
154  }
155 
156  unset($langObj);
157  }
158 
159  if (isset($lang_installed)) {
160  if (count($lang_installed) == 1) {
161  $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
162  } else {
163  foreach ($lang_installed as $lang_key) {
164  $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
165  }
166  $this->data = implode(", ", $langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
167  }
168  }
169 
170  if (isset($local_installed)) {
171  if (count($local_installed) == 1) {
172  $this->data .= " " . $this->lng->txt("meta_l_" . $local_installed[0]) . " " . $this->lng->txt("local_language_file") . " " . strtolower($this->lng->txt("installed")) . ".";
173  } else {
174  foreach ($local_installed as $lang_key) {
175  $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
176  }
177  $this->data .= " " . implode(", ", $langnames) . " " . $this->lng->txt("local_language_files") . " " . strtolower($this->lng->txt("installed")) . ".";
178  }
179  } else {
180  $this->data .= " " . $this->lng->txt("local_languages_already_installed");
181  }
182 
183  $this->out();
184  }
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
+ Here is the call graph for this function:

◆ installObject()

ilObjLanguageFolderGUI::installObject ( )

install languages

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

References $_POST, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), and out().

91  {
92  $this->checkPermission('write');
93  $this->lng->loadLanguageModule("meta");
94 
95  if (!isset($_POST["id"])) {
96  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
97  }
98 
99  foreach ($_POST["id"] as $obj_id) {
100  $langObj = new ilObjLanguage($obj_id);
101  $key = $langObj->install();
102 
103  if ($key != "") {
104  $lang_installed[] = $key;
105  }
106 
107  unset($langObj);
108  }
109 
110  if (isset($lang_installed)) {
111  if (count($lang_installed) == 1) {
112  $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
113  } else {
114  foreach ($lang_installed as $lang_key) {
115  $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
116  }
117  $this->data = implode(", ", $langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
118  }
119  } else {
120  $this->data = $this->lng->txt("languages_already_installed");
121  }
122 
123  $this->out();
124  }
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
+ Here is the call graph for this function:

◆ listDeprecatedObject()

ilObjLanguageFolderGUI::listDeprecatedObject ( )

Download deprecated lang entries.

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

References $d, $res, and ilLinkButton\getInstance().

600  {
601  $button = ilLinkButton::getInstance();
602  $button->setCaption("download");
603  $button->setUrl($this->ctrl->getLinkTarget($this, "downloadDeprecated"));
604  $this->toolbar->addButtonInstance($button);
605 
606  include_once("./Services/Language/classes/class.ilLangDeprecated.php");
607 
608  $d = new ilLangDeprecated();
609  $res = "";
610  foreach ($d->getDeprecatedLangVars() as $key => $mod) {
611  $res .= $mod . "," . $key . "\n";
612  }
613 
614  $this->tpl->setContent("<pre>" . $res . "</pre>");
615  }
Search for deprecated lang vars.
foreach($_POST as $key=> $value) $res
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

◆ out()

ilObjLanguageFolderGUI::out ( )

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

References ilUtil\sendInfo().

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

400  {
401  ilUtil::sendInfo($this->data, true);
402  $this->ctrl->redirect($this, "view");
403  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ 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 270 of file class.ilObjLanguageFolderGUI.php.

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

271  {
272  $this->checkPermission('write');
273 
275  $this->data = $this->lng->txt("languages_updated");
276  $this->out();
277  }
static refreshAll()
Refresh all installed languages.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ refreshSelectedObject()

ilObjLanguageFolderGUI::refreshSelectedObject ( )

update selected languages

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

References $_POST, ilObject\$id, ilObjectGUI\checkPermission(), out(), and ilObjLanguage\refreshPlugins().

284  {
285  $this->checkPermission('write');
286  $this->data = $this->lng->txt("selected_languages_updated");
287  $this->lng->loadLanguageModule("meta");
288 
289  $refreshed = array();
290  foreach ($_POST["id"] as $id) {
291  $langObj = new ilObjLanguage($id, false);
292  if ($langObj->refresh()) {
293  $refreshed[] = $langObj->getKey();
294  $this->data .= "<br />" . $this->lng->txt("meta_l_" . $langObj->getKey());
295  }
296  unset($langObj);
297  }
298 
299  ilObjLanguage::refreshPlugins($refreshed);
300  $this->out();
301  }
Class ilObjLanguage.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static refreshPlugins($a_lang_keys=null)
$_POST["username"]
+ Here is the call graph for this function:

◆ setSystemLanguageObject()

ilObjLanguageFolderGUI::setSystemLanguageObject ( )

set the system language

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

References $_POST, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), and out().

352  {
353  $this->checkPermission('write');
354  $this->lng->loadLanguageModule("meta");
355 
356  if (!isset($_POST["id"])) {
357  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
358  }
359 
360  if (count($_POST["id"]) != 1) {
361  $this->ilias->raiseError($this->lng->txt("choose_only_one_language") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE);
362  }
363 
364  $obj_id = $_POST["id"][0];
365 
366  $newSysLangObj = new ilObjLanguage($obj_id);
367 
368  if ($newSysLangObj->isSystemLanguage()) {
369  $this->ilias->raiseError($this->lng->txt("meta_l_" . $newSysLangObj->getKey()) . " is already the system language!<br>Action aborted!", $this->ilias->error_obj->MESSAGE);
370  }
371 
372  if ($newSysLangObj->isInstalled() == false) {
373  $this->ilias->raiseError($this->lng->txt("meta_l_" . $newSysLangObj->getKey()) . " is not installed. Please install that language first.<br>Action aborted!", $this->ilias->error_obj->MESSAGE);
374  }
375 
376  $this->ilias->setSetting("language", $newSysLangObj->getKey());
377 
378  // update ini-file
379  $this->ilias->ini->setVariable("language", "default", $newSysLangObj->getKey());
380  $this->ilias->ini->write();
381 
382  $this->data = $this->lng->txt("system_language") . " " . $this->lng->txt("changed_to") . " " . $this->lng->txt("meta_l_" . $newSysLangObj->getKey()) . ".";
383 
384  $this->out();
385  }
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
+ Here is the call graph for this function:

◆ setUserLanguageObject()

ilObjLanguageFolderGUI::setUserLanguageObject ( )

set user language

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

References $_POST, $DIC, $ilUser, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), and out().

308  {
309  global $DIC;
310  $ilUser = $DIC->user();
311 
312  $this->checkPermission('write');
313  $this->lng->loadLanguageModule("meta");
314 
315  require_once './Services/User/classes/class.ilObjUser.php';
316 
317  if (!isset($_POST["id"])) {
318  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
319  }
320 
321  if (count($_POST["id"]) != 1) {
322  $this->ilias->raiseError($this->lng->txt("choose_only_one_language") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE);
323  }
324 
325  $obj_id = $_POST["id"][0];
326 
327  $newUserLangObj = new ilObjLanguage($obj_id);
328 
329  if ($newUserLangObj->isUserLanguage()) {
330  $this->ilias->raiseError($this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . " " . $this->lng->txt("is_already_your") . " " . $this->lng->txt("user_language") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE);
331  }
332 
333  if ($newUserLangObj->isInstalled() == false) {
334  $this->ilias->raiseError($this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . " " . $this->lng->txt("language_not_installed") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE);
335  }
336 
337 
338  $curUser = new ilObjUser($ilUser->getId());
339  $curUser->setLanguage($newUserLangObj->getKey());
340  $curUser->update();
341 
342  $this->data = $this->lng->txt("user_language") . " " . $this->lng->txt("changed_to") . " " . $this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . ".";
343 
344  $this->out();
345  }
Class ilObjLanguage.
global $DIC
Definition: goto.php:24
redirection script todo: (a better solution should control the processing via a xml file) ...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ uninstallChangesObject()

ilObjLanguageFolderGUI::uninstallChangesObject ( )

Uninstall local changes in the database.

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

References $_POST, ilObject\$id, ilObjectGUI\checkPermission(), and out().

240  {
241  $this->checkPermission('write');
242 
243  $this->data = $this->lng->txt("selected_languages_updated");
244  $this->lng->loadLanguageModule("meta");
245 
246  foreach ($_POST["id"] as $id) {
247  $langObj = new ilObjLanguage($id, false);
248 
249  if ($langObj->isInstalled() == true) {
250  if ($langObj->check()) {
251  $langObj->flush('all');
252  $langObj->insert();
253  $langObj->setTitle($langObj->getKey());
254  $langObj->setDescription('installed');
255  $langObj->update();
256  }
257  $this->data .= "<br />" . $this->lng->txt("meta_l_" . $langObj->getKey());
258  }
259 
260  unset($langObj);
261  }
262 
263  $this->out();
264  }
Class ilObjLanguage.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
+ Here is the call graph for this function:

◆ uninstallObject()

ilObjLanguageFolderGUI::uninstallObject ( )

uninstall language

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

References $_POST, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), and out().

191  {
192  $this->checkPermission('write');
193  $this->lng->loadLanguageModule("meta");
194 
195  if (!isset($_POST["id"])) {
196  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
197  }
198 
199  // uninstall all selected languages
200  foreach ($_POST["id"] as $obj_id) {
201  $langObj = new ilObjLanguage($obj_id);
202  if (!($sys_lang = $langObj->isSystemLanguage())) {
203  if (!($usr_lang = $langObj->isUserLanguage())) {
204  $key = $langObj->uninstall();
205  if ($key != "") {
206  $lang_uninstalled[] = $key;
207  }
208  }
209  }
210  unset($langObj);
211  }
212 
213  // generate output message
214  if (isset($lang_uninstalled)) {
215  if (count($lang_uninstalled) == 1) {
216  $this->data = $this->lng->txt("meta_l_" . $lang_uninstalled[0]) . " " . $this->lng->txt("uninstalled");
217  } else {
218  foreach ($lang_uninstalled as $lang_key) {
219  $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
220  }
221 
222  $this->data = implode(", ", $langnames) . " " . $this->lng->txt("uninstalled");
223  }
224  } elseif ($sys_lang) {
225  $this->data = $this->lng->txt("cannot_uninstall_systemlanguage");
226  } elseif ($usr_lang) {
227  $this->data = $this->lng->txt("cannot_uninstall_language_in_use");
228  } else {
229  $this->data = $this->lng->txt("languages_already_uninstalled");
230  }
231 
232  $this->out();
233  }
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
+ Here is the call graph for this function:

◆ viewObject()

ilObjLanguageFolderGUI::viewObject ( )

show installed languages

public

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

References $DIC, ilObjectGUI\checkPermissionBool(), ilLinkButton\getInstance(), and settings().

Referenced by disableLanguageDetectionObject(), and enableLanguageDetectionObject().

41  {
42  global $DIC;
43 
44  if ($this->checkPermissionBool('write')) {
45  // refresh
46  $refresh = ilLinkButton::getInstance();
47  $refresh->setUrl($this->ctrl->getLinkTarget($this, "confirmRefresh"));
48  $refresh->setCaption("refresh_languages");
49  $this->toolbar->addButtonInstance($refresh);
50 
51  // check languages
52  $check = ilLinkButton::getInstance();
53  $check->setUrl($this->ctrl->getLinkTarget($this, "checkLanguage"));
54  $check->setCaption("check_languages");
55  $this->toolbar->addButtonInstance($check);
56 
57  }
58 
59  $ilClientIniFile = $DIC['ilClientIniFile'];
60  if ($ilClientIniFile->variableExists('system', 'LANGUAGE_LOG')) {
61  $download = ilLinkButton::getInstance();
62  $download->setUrl($this->ctrl->getLinkTarget($this, "listDeprecated"));
63  $download->setCaption("lng_download_deprecated");
64  $this->toolbar->addButtonInstance($download);
65  }
66 
67  if ($this->checkPermissionBool('write')) {
68  if (!$this->settings->get('lang_detection')) {
69 
70  // Toggle Button for auto language detection (toggle off)
71  $toggleButton = $DIC->ui()->factory()->button()->toggle("", $DIC->ctrl()->getLinkTarget($this, "enableLanguageDetection"), $DIC->ctrl()->getLinkTarget($this, "disableLanguageDetection"), false)
72  ->withLabel($this->lng->txt("language_detection"))->withAriaLabel($this->lng->txt("lng_enable_language_detection"));
73  $this->toolbar->addComponent($toggleButton);
74  } else {
75 
76  // Toggle Button for auto language detection (toggle on)
77  $toggleButton = $DIC->ui()->factory()->button()->toggle("", $DIC->ctrl()->getLinkTarget($this, "enableLanguageDetection"), $DIC->ctrl()->getLinkTarget($this, "disableLanguageDetection"), true)
78  ->withLabel($this->lng->txt("language_detection"))->withAriaLabel($this->lng->txt("lng_disable_language_detection"));
79  $this->toolbar->addComponent($toggleButton);
80  }
81  }
82 
83  $ltab = new ilLanguageTableGUI($this, "view", $this->object);
84  $this->tpl->setContent($ltab->getHTML());
85  }
settings()
Definition: settings.php:2
global $DIC
Definition: goto.php:24
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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