ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
 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) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 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...
 
 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...
 

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
 
 $ilias
 
 $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
 
 $ilias
 
 $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 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...
 
 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...
 
 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...
 
- Protected Attributes inherited from ilObjectGUI
 $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 426 of file class.ilObjLanguageFolderGUI.php.

427 {
428 //$langFoldObj = new ilObjLanguageFolder($_GET["obj_id"]);
429 //$this->data = $langFoldObj->checkAllLanguages();
430 $this->data = $this->object->checkAllLanguages();
431 $this->out();
432 }

References out().

+ Here is the call graph for this function:

◆ confirmRefreshObject()

ilObjLanguageFolderGUI::confirmRefreshObject ( )

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

496 {
498
499 $ids = array();
500 foreach ($languages as $lang)
501 {
502 $langObj = new ilObjLanguage($lang["obj_id"],false);
503 if ($langObj->isInstalled() == true)
504 {
505 $ids[] = $lang["obj_id"];
506 }
507 }
508 $this->confirmRefreshSelectedObject($ids);
509 }
Class ilObjLanguage.
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
$languages
Definition: cssgen2.php:34
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349

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

+ Here is the call graph for this function:

◆ confirmRefreshSelectedObject()

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

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

512 {
513 global $ilCtrl, $lng;
514
515 if (!empty($a_ids))
516 {
517 $ids = $a_ids;
518 $header = $lng->txt("lang_refresh_confirm");
519 }
520 elseif (!empty($_POST["id"]))
521 {
522 $ids = $_POST["id"];
523 $header = $lng->txt("lang_refresh_confirm_selected");
524 }
525 else
526 {
527 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
528 }
529
530 $lng->loadLanguageModule("meta");
531 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
532
533 $conf_screen = new ilConfirmationGUI();
534 $some_changed = false;
535 foreach ($ids as $id)
536 {
537 $lang_key = ilObject::_lookupTitle($id);
538 $lang_title = $lng->txt('meta_l_'.$lang_key);
539 $last_change = ilObjLanguage::_getLastLocalChange($lang_key);
540 if (!empty($last_change))
541 {
542 $some_changed = true;
543 $lang_title .= ' ('. $this->lng->txt("last_change"). ' '
545 }
546 $conf_screen->addItem("id[]", $id, $lang_title);
547 }
548
549 $conf_screen->setFormAction($ilCtrl->getFormAction($this));
550 if ($some_changed)
551 {
552 $header .= '<br />' . $lng->txt("lang_refresh_confirm_info");
553 }
554 $conf_screen->setHeaderText($header);
555 $conf_screen->setCancel($lng->txt("cancel"), "view");
556 $conf_screen->setConfirm($lng->txt("ok"), "refreshSelected");
557 $this->tpl->setContent($conf_screen->getHTML());
558 }
$_POST["username"]
const IL_CAL_DATETIME
Confirmation screen class.
static formatDate(ilDateTime $date)
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
$header
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)

References $_POST, $header, ilObject\$id, $ilCtrl, ilObject\$lng, ilObjLanguage\_getLastLocalChange(), ilObject\_lookupTitle(), 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 585 of file class.ilObjLanguageFolderGUI.php.

586 {
587 global $ilCtrl, $lng;
588
589 if (!isset($_POST["id"]))
590 {
591 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
592 }
593
594 $lng->loadLanguageModule("meta");
595 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
596 $conf_screen = new ilConfirmationGUI();
597 $conf_screen->setFormAction($ilCtrl->getFormAction($this));
598 $conf_screen->setHeaderText($lng->txt("lang_uninstall_changes_confirm"));
599 foreach ($_POST["id"] as $id)
600 {
601 $lang_title = ilObject::_lookupTitle($id);
602 $conf_screen->addItem("id[]", $id, $lng->txt("meta_l_".$lang_title));
603 }
604 $conf_screen->setCancel($lng->txt("cancel"), "view");
605 $conf_screen->setConfirm($lng->txt("ok"), "uninstallChanges");
606 $this->tpl->setContent($conf_screen->getHTML());
607 }

References $_POST, ilObject\$id, $ilCtrl, ilObject\$lng, and ilObject\_lookupTitle().

+ Here is the call graph for this function:

◆ confirmUninstallObject()

ilObjLanguageFolderGUI::confirmUninstallObject ( )

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

561 {
562 global $ilCtrl, $lng;
563
564 if (!isset($_POST["id"]))
565 {
566 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
567 }
568
569 $lng->loadLanguageModule("meta");
570 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
571 $conf_screen = new ilConfirmationGUI();
572 $conf_screen->setFormAction($ilCtrl->getFormAction($this));
573 $conf_screen->setHeaderText($lng->txt("lang_uninstall_confirm"));
574 foreach ($_POST["id"] as $id)
575 {
576 $lang_title = ilObject::_lookupTitle($id);
577 $conf_screen->addItem("id[]", $id, $lng->txt("meta_l_".$lang_title));
578 }
579 $conf_screen->setCancel($lng->txt("cancel"), "view");
580 $conf_screen->setConfirm($lng->txt("ok"), "uninstall");
581 $this->tpl->setContent($conf_screen->getHTML());
582 }

References $_POST, ilObject\$id, $ilCtrl, ilObject\$lng, and ilObject\_lookupTitle().

+ Here is the call graph for this function:

◆ downloadDeprecatedObject()

ilObjLanguageFolderGUI::downloadDeprecatedObject ( )

Download deprecated lang entries.

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

694 {
695 global $DIC;
696
697 $rbacsystem = $DIC->rbac()->system();
698
699 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
700 {
701 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
702 }
703
704 include_once("./Services/Language/classes/class.ilLangDeprecated.php");
705 $d = new ilLangDeprecated();
706 $res = "";
707 foreach ($d->getDeprecatedLangVars() as $key => $mod)
708 {
709 $res.= $mod.",".$key."\n";
710 }
711
712 ilUtil::deliverData($res, "lang_deprecated.csv");
713 }
for($col=0; $col< 50; $col++) $d
Search for deprecated lang vars.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
global $DIC

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

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLanguageFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

469 {
470 $next_class = $this->ctrl->getNextClass($this);
471 $cmd = $this->ctrl->getCmd();
472 $this->prepareOutput();
473
474 switch($next_class)
475 {
476 case 'ilpermissiongui':
477 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
478 $perm_gui = new ilPermissionGUI($this);
479 $ret =& $this->ctrl->forwardCommand($perm_gui);
480 break;
481
482 default:
483 if(!$cmd)
484 {
485 $cmd = "view";
486 }
487 $cmd .= "Object";
488 $this->$cmd();
489
490 break;
491 }
492 return true;
493 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getActions()

ilObjLanguageFolderGUI::getActions ( )

Get Actions.

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

613 {
614 global $ilSetting;
615
616 // standard actions for container
617 return array(
618 "install" => array("name" => "install", "lng" => "install"),
619 "installLocal" => array("name" => "installLocal", "lng" => "install_local"),
620 "uninstall" => array("name" => "uninstall", "lng" => "uninstall"),
621 "refresh" => array("name" => "confirmRefreshSelected", "lng" => "refresh"),
622 "setSystemLanguage" => array("name" => "setSystemLanguage", "lng" => "setSystemLanguage"),
623 "setUserLanguage" => array("name" => "setUserLanguage", "lng" => "setUserLanguage")
624 );
625 }
global $ilSetting
Definition: privfeed.php:17

References $ilSetting.

◆ getAdminTabs()

ilObjLanguageFolderGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

442 {
443 $this->getTabs();
444 }
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 451 of file class.ilObjLanguageFolderGUI.php.

452 {
453 global $rbacsystem;
454
455 if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
456 {
457 $this->tabs_gui->addTarget("settings",
458 $this->ctrl->getLinkTarget($this, "view"), array("view",""), "", "");
459 }
460
461 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
462 {
463 $this->tabs_gui->addTarget("perm_settings",
464 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
465 }
466 }

Referenced by getAdminTabs().

+ Here is the caller graph for this function:

◆ installLocalObject()

ilObjLanguageFolderGUI::installLocalObject ( )

Install local language modifications.

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

133 {
134 $this->lng->loadLanguageModule("meta");
135
136 if (!isset($_POST["id"]))
137 {
138 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
139 }
140
141 foreach ($_POST["id"] as $obj_id)
142 {
143 $langObj = new ilObjLanguage($obj_id);
144 $key = $langObj->install();
145
146 if ($key != "")
147 {
148 $lang_installed[] = $key;
149 }
150
151 unset($langObj);
152
153 $langObj = new ilObjLanguage($obj_id);
154 $key = $langObj->install('local');
155
156 if ($key != "")
157 {
158 $local_installed[] = $key;
159 }
160
161 unset($langObj);
162 }
163
164 if (isset($lang_installed))
165 {
166 if (count($lang_installed) == 1)
167 {
168 $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
169 }
170 else
171 {
172 foreach ($lang_installed as $lang_key)
173 {
174 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
175 }
176 $this->data = implode(", ",$langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
177 }
178 }
179
180 if (isset($local_installed))
181 {
182 if (count($local_installed) == 1)
183 {
184 $this->data .= " " . $this->lng->txt("meta_l_" . $local_installed[0]) . " " . $this->lng->txt("local_language_file") . " " . strtolower($this->lng->txt("installed")) . ".";
185 }
186 else
187 {
188 foreach ($local_installed as $lang_key)
189 {
190 $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
191 }
192 $this->data .= " " . implode(", ",$langnames) . " " . $this->lng->txt("local_language_files") . " " . strtolower($this->lng->txt("installed")) . ".";
193 }
194 }
195 else
196 {
197 $this->data .= " " . $this->lng->txt("local_languages_already_installed");
198 }
199
200 $this->out();
201 }

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

+ Here is the call graph for this function:

◆ installObject()

ilObjLanguageFolderGUI::installObject ( )

install languages

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

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

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

+ Here is the call graph for this function:

◆ listDeprecatedObject()

ilObjLanguageFolderGUI::listDeprecatedObject ( )

Download deprecated lang entries.

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

661 {
662 global $DIC;
663
664 $rbacsystem = $DIC->rbac()->system();
665 $tpl = $DIC["tpl"];
666 $ilToolbar = $DIC->toolbar();
667 $ctrl = $DIC->ctrl();
668 $lng = $DIC->language();
669
670 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
671 {
672 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
673 }
674
675 $ilToolbar->addButton($lng->txt("download"),
676 $ctrl->getLinkTarget($this, "downloadDeprecated"));
677
678 include_once("./Services/Language/classes/class.ilLangDeprecated.php");
679
680 $d = new ilLangDeprecated();
681 $res = "";
682 foreach ($d->getDeprecatedLangVars() as $key => $mod)
683 {
684 $res.= $mod.",".$key."\n";
685 }
686
687 $tpl->setContent("<pre>".$res."</pre>");
688 }

References ilObjectGUI\$ctrl, $d, $DIC, ilObject\$lng, $res, and ilObjectGUI\$tpl.

◆ out()

ilObjLanguageFolderGUI::out ( )

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

436 {
437 ilUtil::sendInfo($this->data,true);
438 $this->ctrl->redirect($this, "view");
439 }
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 301 of file class.ilObjLanguageFolderGUI.php.

302 {
304 $this->data = $this->lng->txt("languages_updated");
305 $this->out();
306 }
static refreshAll()
Refresh all installed languages.

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

+ Here is the call graph for this function:

◆ refreshSelectedObject()

ilObjLanguageFolderGUI::refreshSelectedObject ( )

update selected languages

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

313 {
314 global $lng;
315
316 $this->data = $this->lng->txt("selected_languages_updated");
317 $lng->loadLanguageModule("meta");
318
319 $refreshed = array();
320 foreach ($_POST["id"] as $id)
321 {
322 $langObj = new ilObjLanguage($id, false);
323 if ($langObj->refresh())
324 {
325 $refreshed[] = $langObj->getKey();
326 $this->data .= "<br />". $lng->txt("meta_l_".$langObj->getKey());
327 }
328 unset($langObj);
329 }
330
332 $this->out();
333 }
static refreshPlugins($a_lang_keys=null)

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

+ Here is the call graph for this function:

◆ setSystemLanguageObject()

ilObjLanguageFolderGUI::setSystemLanguageObject ( )

set the system language

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

384 {
385 $this->lng->loadLanguageModule("meta");
386
387 if (!isset($_POST["id"]))
388 {
389 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
390 }
391
392 if (count($_POST["id"]) != 1)
393 {
394 $this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
395 }
396
397 $obj_id = $_POST["id"][0];
398
399 $newSysLangObj = new ilObjLanguage($obj_id);
400
401 if ($newSysLangObj->isSystemLanguage())
402 {
403 $this->ilias->raiseError($this->lng->txt("meta_l_".$newSysLangObj->getKey())." is already the system language!<br>Action aborted!",$this->ilias->error_obj->MESSAGE);
404 }
405
406 if ($newSysLangObj->isInstalled() == false)
407 {
408 $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);
409 }
410
411 $this->ilias->setSetting("language", $newSysLangObj->getKey());
412
413 // update ini-file
414 $this->ilias->ini->setVariable("language","default",$newSysLangObj->getKey());
415 $this->ilias->ini->write();
416
417 $this->data = $this->lng->txt("system_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newSysLangObj->getKey()).".";
418
419 $this->out();
420 }

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

+ Here is the call graph for this function:

◆ setUserLanguageObject()

ilObjLanguageFolderGUI::setUserLanguageObject ( )

set user language

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

340 {
341 $this->lng->loadLanguageModule("meta");
342
343 require_once './Services/User/classes/class.ilObjUser.php';
344
345 if (!isset($_POST["id"]))
346 {
347 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
348 }
349
350 if (count($_POST["id"]) != 1)
351 {
352 $this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
353 }
354
355 $obj_id = $_POST["id"][0];
356
357 $newUserLangObj = new ilObjLanguage($obj_id);
358
359 if ($newUserLangObj->isUserLanguage())
360 {
361 $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);
362 }
363
364 if ($newUserLangObj->isInstalled() == false)
365 {
366 $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);
367 }
368
369 $curUser = new ilObjUser($GLOBALS['DIC']['ilUser']->getId());
370 $curUser->setLanguage($newUserLangObj->getKey());
371 $curUser->update();
372 //$this->setUserLanguage($new_lang_key);
373
374 $this->data = $this->lng->txt("user_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newUserLangObj->getKey()).".";
375
376 $this->out();
377 }
getId()
get object id @access public
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $_POST, $GLOBALS, ilObjectGUI\$obj_id, ilObject\getId(), and out().

+ Here is the call graph for this function:

◆ uninstallChangesObject()

ilObjLanguageFolderGUI::uninstallChangesObject ( )

Uninstall local changes in the database.

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

268 {
269 global $lng;
270
271 $this->data = $this->lng->txt("selected_languages_updated");
272 $lng->loadLanguageModule("meta");
273
274 foreach ($_POST["id"] as $id)
275 {
276 $langObj = new ilObjLanguage($id, false);
277
278 if ($langObj->isInstalled() == true)
279 {
280 if ($langObj->check())
281 {
282 $langObj->flush('all');
283 $langObj->insert();
284 $langObj->setTitle($langObj->getKey());
285 $langObj->setDescription('installed');
286 $langObj->update();
287 }
288 $this->data .= "<br />". $lng->txt("meta_l_".$langObj->getKey());
289 }
290
291 unset($langObj);
292 }
293
294 $this->out();
295 }

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

+ Here is the call graph for this function:

◆ uninstallObject()

ilObjLanguageFolderGUI::uninstallObject ( )

uninstall language

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

208 {
209 $this->lng->loadLanguageModule("meta");
210
211 if (!isset($_POST["id"]))
212 {
213 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
214 }
215
216 // uninstall all selected languages
217 foreach ($_POST["id"] as $obj_id)
218 {
219 $langObj = new ilObjLanguage($obj_id);
220 if (!($sys_lang = $langObj->isSystemLanguage()))
221 if (!($usr_lang = $langObj->isUserLanguage()))
222 {
223 $key = $langObj->uninstall();
224 if ($key != "")
225 $lang_uninstalled[] = $key;
226 }
227 unset($langObj);
228 }
229
230 // generate output message
231 if (isset($lang_uninstalled))
232 {
233 if (count($lang_uninstalled) == 1)
234 {
235 $this->data = $this->lng->txt("meta_l_".$lang_uninstalled[0])." ".$this->lng->txt("uninstalled");
236 }
237 else
238 {
239 foreach ($lang_uninstalled as $lang_key)
240 {
241 $langnames[] = $this->lng->txt("meta_l_".$lang_key);
242 }
243
244 $this->data = implode(", ",$langnames)." ".$this->lng->txt("uninstalled");
245 }
246 }
247 elseif ($sys_lang)
248 {
249 $this->data = $this->lng->txt("cannot_uninstall_systemlanguage");
250 }
251 elseif ($usr_lang)
252 {
253 $this->data = $this->lng->txt("cannot_uninstall_language_in_use");
254 }
255 else
256 {
257 $this->data = $this->lng->txt("languages_already_uninstalled");
258 }
259
260 $this->out();
261 }

References $_POST, ilObjectGUI\$obj_id, 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 $rbacsystem, $ilSetting, $tpl, $ilToolbar, $lng, $ilClientIniFile;
43
44 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
45 {
46 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
47 }
48
49 // refresh
50 $ilToolbar->addButton($lng->txt("refresh_languages"),
51 $this->ctrl->getLinkTarget($this, "confirmRefresh"));
52
53 // check languages
54 $ilToolbar->addButton($lng->txt("check_languages"),
55 $this->ctrl->getLinkTarget($this, "checkLanguage"));
56
57 // extended language maintenance
58 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
59 {
60 if(!$ilSetting->get('lang_detection'))
61 {
62 $ilToolbar->addButton($lng->txt('lng_enable_language_detection'), $this->ctrl->getLinkTarget($this, 'enableLanguageDetection'));
63 }
64 else
65 {
66 $ilToolbar->addButton($lng->txt('lng_disable_language_detection'), $this->ctrl->getLinkTarget($this, 'disableLanguageDetection'));
67 }
68 }
69
70 if($ilClientIniFile->variableExists('system', 'LANGUAGE_LOG'))
71 {
72 $ilToolbar->addButton($lng->txt('lng_download_deprecated'), $this->ctrl->getLinkTarget($this, 'listDeprecated'));
73 }
74
75 include_once("./Services/Language/classes/class.ilLanguageTableGUI.php");
76 $ltab = new ilLanguageTableGUI($this, "view", $this->object);
77 $tpl->setContent($ltab->getHTML());
78 }

References $ilSetting, ilObject\$lng, and ilObjectGUI\$tpl.


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