ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 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 ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Protected Member Functions

 disableLanguageDetectionObject ()
 Disable language detection. More...
 
 enableLanguageDetectionObject ()
 Enable language detection. More...
 
- Protected Member Functions inherited from ilObjectGUI
 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...
 
 showMountWebfolderIcon ()
 
 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 _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)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date @global type $ilDB. 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 _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 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
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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"]

References $_GET.

Member Function Documentation

◆ checkLanguageObject()

ilObjLanguageFolderGUI::checkLanguageObject ( )

check all languages

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

385 {
386 $this->checkPermission('write');
387 $this->data = $this->object->checkAllLanguages();
388 $this->out();
389 }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$this data['403_header']

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

+ Here is the call graph for this function:

◆ confirmRefreshObject()

ilObjLanguageFolderGUI::confirmRefreshObject ( )

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

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

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

468 {
469 $this->checkPermission('write');
470 $this->lng->loadLanguageModule("meta");
471
472 if (!empty($a_ids)) {
473 $ids = $a_ids;
474 $header = $this->lng->txt("lang_refresh_confirm");
475 } elseif (!empty($_POST["id"])) {
476 $ids = $_POST["id"];
477 $header = $this->lng->txt("lang_refresh_confirm_selected");
478 } else {
479 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
480 }
481
482
483 $conf_screen = new ilConfirmationGUI();
484 $some_changed = false;
485 foreach ($ids as $id) {
486 $lang_key = ilObject::_lookupTitle($id);
487 $lang_title = $this->lng->txt('meta_l_' . $lang_key);
488 $last_change = ilObjLanguage::_getLastLocalChange($lang_key);
489 if (!empty($last_change)) {
490 $some_changed = true;
491 $lang_title .= ' (' . $this->lng->txt("last_change") . ' '
493 }
494 $conf_screen->addItem("id[]", $id, $lang_title);
495 }
496
497 $conf_screen->setFormAction($this->ctrl->getFormAction($this));
498 if ($some_changed) {
499 $header .= '<br />' . $this->lng->txt("lang_refresh_confirm_info");
500 }
501 $conf_screen->setHeaderText($header);
502 $conf_screen->setCancel($this->lng->txt("cancel"), "view");
503 $conf_screen->setConfirm($this->lng->txt("ok"), "refreshSelected");
504 $this->tpl->setContent($conf_screen->getHTML());
505 }
$_POST["username"]
const IL_CAL_DATETIME
Confirmation screen class.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=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, $header, 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 530 of file class.ilObjLanguageFolderGUI.php.

531 {
532 $this->checkPermission('write');
533
534 if (!isset($_POST["id"])) {
535 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
536 }
537
538 $this->lng->loadLanguageModule("meta");
539 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
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 ($_POST["id"] as $id) {
544 $lang_title = ilObject::_lookupTitle($id);
545 $conf_screen->addItem("id[]", $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 $_POST, ilObject\$id, ilObject\_lookupTitle(), and ilObjectGUI\checkPermission().

+ Here is the call graph for this function:

◆ confirmUninstallObject()

ilObjLanguageFolderGUI::confirmUninstallObject ( )

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

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

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

573 {
574 $this->settings->set('lang_detection', 0);
575 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
576 $this->viewObject();
577 }
viewObject()
show installed languages
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
settings()
Definition: settings.php:2

References ilUtil\sendSuccess(), 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.

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 }
Search for deprecated lang vars.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
$key
Definition: croninfo.php:18
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, $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.

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

References ilUtil\sendSuccess(), settings(), and viewObject().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLanguageFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

420 {
421 // always check read permission, needed write permissions are checked in the *Object functions
422 $this->checkPermission('read', '', $this->type, $this->ref_id);
423
424 $next_class = $this->ctrl->getNextClass($this);
425 $cmd = $this->ctrl->getCmd();
426 $this->prepareOutput();
427
428 switch ($next_class) {
429 case 'ilpermissiongui':
430 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
431 $perm_gui = new ilPermissionGUI($this);
432 $this->tabs_gui->activateTab('perm_settings');
433 $this->ctrl->forwardCommand($perm_gui);
434 break;
435
436 default:
437 $this->tabs_gui->activateTab('settings');
438
439 if (!$cmd) {
440 $cmd = "view";
441 }
442
443 $cmd .= "Object";
444 $this->$cmd();
445
446 break;
447 }
448 return true;
449 }
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 556 of file class.ilObjLanguageFolderGUI.php.

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

399 {
400 $this->getTabs();
401 }
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 408 of file class.ilObjLanguageFolderGUI.php.

409 {
410 if ($this->checkPermissionBool("read")) {
411 $this->tabs_gui->addTab('settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, "view"));
412 }
413
414 if ($this->checkPermissionBool('edit_permission')) {
415 $this->tabs_gui->addTab('perm_settings', $this->lng->txt('perm_settings'), $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
416 }
417 }
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, $key, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), data, 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, $key, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), data, 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.

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 }
static getInstance()
Factory.

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

+ Here is the call graph for this function:

◆ out()

ilObjLanguageFolderGUI::out ( )

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

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

References data, and 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(), data, 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(), data, out(), and ilObjLanguage\refreshPlugins().

+ Here is the call graph for this function:

◆ setSystemLanguageObject()

ilObjLanguageFolderGUI::setSystemLanguageObject ( )

set the system language

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

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

References $_POST, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), data, 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 $this->checkPermission('write');
306 $this->lng->loadLanguageModule("meta");
307
308 require_once './Services/User/classes/class.ilObjUser.php';
309
310 if (!isset($_POST["id"])) {
311 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
312 }
313
314 if (count($_POST["id"]) != 1) {
315 $this->ilias->raiseError($this->lng->txt("choose_only_one_language") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE);
316 }
317
318 $obj_id = $_POST["id"][0];
319
320 $newUserLangObj = new ilObjLanguage($obj_id);
321
322 if ($newUserLangObj->isUserLanguage()) {
323 $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);
324 }
325
326 if ($newUserLangObj->isInstalled() == false) {
327 $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);
328 }
329
330 $curUser = new ilObjUser($GLOBALS['DIC']['ilUser']->getId());
331 $curUser->setLanguage($newUserLangObj->getKey());
332 $curUser->update();
333 //$this->setUserLanguage($new_lang_key);
334
335 $this->data = $this->lng->txt("user_language") . " " . $this->lng->txt("changed_to") . " " . $this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . ".";
336
337 $this->out();
338 }
getId()
get object id @access public
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $_POST, $GLOBALS, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), data, ilObject\getId(), 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(), data, 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, $key, ilObjectGUI\$obj_id, ilObjectGUI\checkPermission(), data, 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 }
global $DIC
Definition: saml.php:7

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: