ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 administration tabs show only permissions and trash folder More...
 
 getTabs ()
 get tabs @access public More...
 
 executeCommand ()
 execute command More...
 
 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 @access 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 @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access 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 @access public More...
 
 getLastUpdateDate ()
 get last update date @access 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...
 
 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) @access 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 @access 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 ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 

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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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@access public 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 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 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
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

@access public

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

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)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ checkLanguageObject()

ilObjLanguageFolderGUI::checkLanguageObject ( )

check all languages

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

388 {
389 $this->checkPermission('write');
390 $this->data = $this->object->checkAllLanguages();
391 $this->out();
392 }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.

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

+ Here is the call graph for this function:

◆ confirmRefreshObject()

ilObjLanguageFolderGUI::confirmRefreshObject ( )

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

455 {
456 $this->checkPermission('write');
457
458 $languages = ilObject::_getObjectsByType("lng");
459
460 $ids = array();
461 foreach ($languages as $lang) {
462 $langObj = new ilObjLanguage($lang["obj_id"], false);
463 if ($langObj->isInstalled() == true) {
464 $ids[] = $lang["obj_id"];
465 }
466 }
467 $this->confirmRefreshSelectedObject($ids);
468 }
Class ilObjLanguage.
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
$lang
Definition: xapiexit.php:8

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

+ Here is the call graph for this function:

◆ confirmRefreshSelectedObject()

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

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

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

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

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 533 of file class.ilObjLanguageFolderGUI.php.

534 {
535 $this->checkPermission('write');
536
537 if (!isset($_POST["id"])) {
538 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
539 }
540
541 $this->lng->loadLanguageModule("meta");
542 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
543 $conf_screen = new ilConfirmationGUI();
544 $conf_screen->setFormAction($this->ctrl->getFormAction($this));
545 $conf_screen->setHeaderText($this->lng->txt("lang_uninstall_changes_confirm"));
546 foreach ($_POST["id"] as $id) {
547 $lang_title = ilObject::_lookupTitle($id);
548 $conf_screen->addItem("id[]", $id, $this->lng->txt("meta_l_" . $lang_title));
549 }
550 $conf_screen->setCancel($this->lng->txt("cancel"), "view");
551 $conf_screen->setConfirm($this->lng->txt("ok"), "uninstallChanges");
552 $this->tpl->setContent($conf_screen->getHTML());
553 }

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

+ Here is the call graph for this function:

◆ confirmUninstallObject()

ilObjLanguageFolderGUI::confirmUninstallObject ( )

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

511 {
512 $this->checkPermission('write');
513
514 if (!isset($_POST["id"])) {
515 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
516 }
517
518 $this->lng->loadLanguageModule("meta");
519 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
520 $conf_screen = new ilConfirmationGUI();
521 $conf_screen->setFormAction($this->ctrl->getFormAction($this));
522 $conf_screen->setHeaderText($this->lng->txt("lang_uninstall_confirm"));
523 foreach ($_POST["id"] as $id) {
524 $lang_title = ilObject::_lookupTitle($id);
525 $conf_screen->addItem("id[]", $id, $this->lng->txt("meta_l_" . $lang_title));
526 }
527 $conf_screen->setCancel($this->lng->txt("cancel"), "view");
528 $conf_screen->setConfirm($this->lng->txt("ok"), "uninstall");
529 $this->tpl->setContent($conf_screen->getHTML());
530 }

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

+ Here is the call graph for this function:

◆ disableLanguageDetectionObject()

ilObjLanguageFolderGUI::disableLanguageDetectionObject ( )
protected

Disable language detection.

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

576 {
577 $this->settings->set('lang_detection', 0);
578 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
579 $this->viewObject();
580 }
viewObject()
show installed languages
settings()
Definition: settings.php:2

References settings(), and viewObject().

+ Here is the call graph for this function:

◆ downloadDeprecatedObject()

ilObjLanguageFolderGUI::downloadDeprecatedObject ( )

Download deprecated lang entries.

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

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

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

+ Here is the call graph for this function:

◆ enableLanguageDetectionObject()

ilObjLanguageFolderGUI::enableLanguageDetectionObject ( )
protected

Enable language detection.

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

586 {
587 $this->settings->set('lang_detection', 1);
588 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
589 $this->viewObject();
590 }

References settings(), and viewObject().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLanguageFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

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

References ilObjectGUI\checkPermission(), 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 559 of file class.ilObjLanguageFolderGUI.php.

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

◆ getAdminTabs()

ilObjLanguageFolderGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

402 {
403 $this->getTabs();
404 }
getTabs()
get tabs @access public

References getTabs().

+ Here is the call graph for this function:

◆ getTabs()

ilObjLanguageFolderGUI::getTabs ( )

get tabs @access public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

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

412 {
413 if ($this->checkPermissionBool("read")) {
414 $this->tabs_gui->addTab('settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, "view"));
415 }
416
417 if ($this->checkPermissionBool('edit_permission')) {
418 $this->tabs_gui->addTab('perm_settings', $this->lng->txt('perm_settings'), $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
419 }
420 }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.

References ilObjectGUI\checkPermissionBool().

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 126 of file class.ilObjLanguageFolderGUI.php.

127 {
128 $this->checkPermission('write');
129 $this->lng->loadLanguageModule("meta");
130
131 if (!isset($_POST["id"])) {
132 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
133 }
134
135 foreach ($_POST["id"] as $obj_id) {
136 $langObj = new ilObjLanguage($obj_id);
137 $key = $langObj->install();
138
139 if ($key != "") {
140 $lang_installed[] = $key;
141 }
142
143 unset($langObj);
144
145 $langObj = new ilObjLanguage($obj_id);
146 $key = $langObj->install('local');
147
148 if ($key != "") {
149 $local_installed[] = $key;
150 }
151
152 unset($langObj);
153 }
154
155 if (isset($lang_installed)) {
156 if (count($lang_installed) == 1) {
157 $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
158 } else {
159 foreach ($lang_installed as $lang_key) {
160 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
161 }
162 $this->data = implode(", ", $langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
163 }
164 }
165
166 if (isset($local_installed)) {
167 if (count($local_installed) == 1) {
168 $this->data .= " " . $this->lng->txt("meta_l_" . $local_installed[0]) . " " . $this->lng->txt("local_language_file") . " " . strtolower($this->lng->txt("installed")) . ".";
169 } else {
170 foreach ($local_installed as $lang_key) {
171 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
172 }
173 $this->data .= " " . implode(", ", $langnames) . " " . $this->lng->txt("local_language_files") . " " . strtolower($this->lng->txt("installed")) . ".";
174 }
175 } else {
176 $this->data .= " " . $this->lng->txt("local_languages_already_installed");
177 }
178
179 $this->out();
180 }

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

+ Here is the call graph for this function:

◆ installObject()

ilObjLanguageFolderGUI::installObject ( )

install languages

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

87 {
88 $this->checkPermission('write');
89 $this->lng->loadLanguageModule("meta");
90
91 if (!isset($_POST["id"])) {
92 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
93 }
94
95 foreach ($_POST["id"] as $obj_id) {
96 $langObj = new ilObjLanguage($obj_id);
97 $key = $langObj->install();
98
99 if ($key != "") {
100 $lang_installed[] = $key;
101 }
102
103 unset($langObj);
104 }
105
106 if (isset($lang_installed)) {
107 if (count($lang_installed) == 1) {
108 $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
109 } else {
110 foreach ($lang_installed as $lang_key) {
111 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
112 }
113 $this->data = implode(", ", $langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
114 }
115 } else {
116 $this->data = $this->lng->txt("languages_already_installed");
117 }
118
119 $this->out();
120 }

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

+ Here is the call graph for this function:

◆ listDeprecatedObject()

ilObjLanguageFolderGUI::listDeprecatedObject ( )

Download deprecated lang entries.

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

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

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

+ Here is the call graph for this function:

◆ out()

ilObjLanguageFolderGUI::out ( )

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

396 {
397 ilUtil::sendInfo($this->data, true);
398 $this->ctrl->redirect($this, "view");
399 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilUtil\sendInfo().

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 266 of file class.ilObjLanguageFolderGUI.php.

267 {
268 $this->checkPermission('write');
269
271 $this->data = $this->lng->txt("languages_updated");
272 $this->out();
273 }
static refreshAll()
Refresh all installed languages.

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

+ Here is the call graph for this function:

◆ refreshSelectedObject()

ilObjLanguageFolderGUI::refreshSelectedObject ( )

update selected languages

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

280 {
281 $this->checkPermission('write');
282 $this->data = $this->lng->txt("selected_languages_updated");
283 $this->lng->loadLanguageModule("meta");
284
285 $refreshed = array();
286 foreach ($_POST["id"] as $id) {
287 $langObj = new ilObjLanguage($id, false);
288 if ($langObj->refresh()) {
289 $refreshed[] = $langObj->getKey();
290 $this->data .= "<br />" . $this->lng->txt("meta_l_" . $langObj->getKey());
291 }
292 unset($langObj);
293 }
294
296 $this->out();
297 }
static refreshPlugins($a_lang_keys=null)

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

+ Here is the call graph for this function:

◆ setSystemLanguageObject()

ilObjLanguageFolderGUI::setSystemLanguageObject ( )

set the system language

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

348 {
349 $this->checkPermission('write');
350 $this->lng->loadLanguageModule("meta");
351
352 if (!isset($_POST["id"])) {
353 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
354 }
355
356 if (count($_POST["id"]) != 1) {
357 $this->ilias->raiseError($this->lng->txt("choose_only_one_language") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE);
358 }
359
360 $obj_id = $_POST["id"][0];
361
362 $newSysLangObj = new ilObjLanguage($obj_id);
363
364 if ($newSysLangObj->isSystemLanguage()) {
365 $this->ilias->raiseError($this->lng->txt("meta_l_" . $newSysLangObj->getKey()) . " is already the system language!<br>Action aborted!", $this->ilias->error_obj->MESSAGE);
366 }
367
368 if ($newSysLangObj->isInstalled() == false) {
369 $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);
370 }
371
372 $this->ilias->setSetting("language", $newSysLangObj->getKey());
373
374 // update ini-file
375 $this->ilias->ini->setVariable("language", "default", $newSysLangObj->getKey());
376 $this->ilias->ini->write();
377
378 $this->data = $this->lng->txt("system_language") . " " . $this->lng->txt("changed_to") . " " . $this->lng->txt("meta_l_" . $newSysLangObj->getKey()) . ".";
379
380 $this->out();
381 }

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

+ Here is the call graph for this function:

◆ setUserLanguageObject()

ilObjLanguageFolderGUI::setUserLanguageObject ( )

set user language

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

304 {
305 global $DIC;
306 $ilUser = $DIC->user();
307
308 $this->checkPermission('write');
309 $this->lng->loadLanguageModule("meta");
310
311 require_once './Services/User/classes/class.ilObjUser.php';
312
313 if (!isset($_POST["id"])) {
314 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
315 }
316
317 if (count($_POST["id"]) != 1) {
318 $this->ilias->raiseError($this->lng->txt("choose_only_one_language") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE);
319 }
320
321 $obj_id = $_POST["id"][0];
322
323 $newUserLangObj = new ilObjLanguage($obj_id);
324
325 if ($newUserLangObj->isUserLanguage()) {
326 $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);
327 }
328
329 if ($newUserLangObj->isInstalled() == false) {
330 $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);
331 }
332
333
334 $curUser = new ilObjUser($ilUser->getId());
335 $curUser->setLanguage($newUserLangObj->getKey());
336 $curUser->update();
337
338 $this->data = $this->lng->txt("user_language") . " " . $this->lng->txt("changed_to") . " " . $this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . ".";
339
340 $this->out();
341 }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46

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

+ Here is the call graph for this function:

◆ uninstallChangesObject()

ilObjLanguageFolderGUI::uninstallChangesObject ( )

Uninstall local changes in the database.

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

236 {
237 $this->checkPermission('write');
238
239 $this->data = $this->lng->txt("selected_languages_updated");
240 $this->lng->loadLanguageModule("meta");
241
242 foreach ($_POST["id"] as $id) {
243 $langObj = new ilObjLanguage($id, false);
244
245 if ($langObj->isInstalled() == true) {
246 if ($langObj->check()) {
247 $langObj->flush('all');
248 $langObj->insert();
249 $langObj->setTitle($langObj->getKey());
250 $langObj->setDescription('installed');
251 $langObj->update();
252 }
253 $this->data .= "<br />" . $this->lng->txt("meta_l_" . $langObj->getKey());
254 }
255
256 unset($langObj);
257 }
258
259 $this->out();
260 }

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

+ Here is the call graph for this function:

◆ uninstallObject()

ilObjLanguageFolderGUI::uninstallObject ( )

uninstall language

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

187 {
188 $this->checkPermission('write');
189 $this->lng->loadLanguageModule("meta");
190
191 if (!isset($_POST["id"])) {
192 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
193 }
194
195 // uninstall all selected languages
196 foreach ($_POST["id"] as $obj_id) {
197 $langObj = new ilObjLanguage($obj_id);
198 if (!($sys_lang = $langObj->isSystemLanguage())) {
199 if (!($usr_lang = $langObj->isUserLanguage())) {
200 $key = $langObj->uninstall();
201 if ($key != "") {
202 $lang_uninstalled[] = $key;
203 }
204 }
205 }
206 unset($langObj);
207 }
208
209 // generate output message
210 if (isset($lang_uninstalled)) {
211 if (count($lang_uninstalled) == 1) {
212 $this->data = $this->lng->txt("meta_l_" . $lang_uninstalled[0]) . " " . $this->lng->txt("uninstalled");
213 } else {
214 foreach ($lang_uninstalled as $lang_key) {
215 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
216 }
217
218 $this->data = implode(", ", $langnames) . " " . $this->lng->txt("uninstalled");
219 }
220 } elseif ($sys_lang) {
221 $this->data = $this->lng->txt("cannot_uninstall_systemlanguage");
222 } elseif ($usr_lang) {
223 $this->data = $this->lng->txt("cannot_uninstall_language_in_use");
224 } else {
225 $this->data = $this->lng->txt("languages_already_uninstalled");
226 }
227
228 $this->out();
229 }

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

+ Here is the call graph for this function:

◆ viewObject()

ilObjLanguageFolderGUI::viewObject ( )

show installed languages

@access public

Reimplemented from ilObjectGUI.

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

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
53 $check->setUrl($this->ctrl->getLinkTarget($this, "checkLanguage"));
54 $check->setCaption("check_languages");
55 $this->toolbar->addButtonInstance($check);
56
57
58 if (!$this->settings->get('lang_detection')) {
59 $detect = ilLinkButton::getInstance();
60 $detect->setUrl($this->ctrl->getLinkTarget($this, "enableLanguageDetection"));
61 $detect->setCaption("lng_enable_language_detection");
62 $this->toolbar->addButtonInstance($detect);
63 } else {
64 $detect = ilLinkButton::getInstance();
65 $detect->setUrl($this->ctrl->getLinkTarget($this, "disableLanguageDetection"));
66 $detect->setCaption("lng_disable_language_detection");
67 $this->toolbar->addButtonInstance($detect);
68 }
69 }
70
71 $ilClientIniFile = $DIC['ilClientIniFile'];
72 if ($ilClientIniFile->variableExists('system', 'LANGUAGE_LOG')) {
73 $download = ilLinkButton::getInstance();
74 $download->setUrl($this->ctrl->getLinkTarget($this, "listDeprecated"));
75 $download->setCaption("lng_download_deprecated");
76 $this->toolbar->addButtonInstance($download);
77 }
78
79 $ltab = new ilLanguageTableGUI($this, "view", $this->object);
80 $this->tpl->setContent($ltab->getHTML());
81 }

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

Referenced by disableLanguageDetectionObject(), and enableLanguageDetectionObject().

+ 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: