ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjLanguageFolderGUI Class Reference

Class ilObjLanguageFolderGUI. More...

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

Public Member Functions

 ilObjLanguageFolderGUI ($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...
 
 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 (&$tabs_gui)
 
 getTabs (&$tabs_gui)
 get tabs public More...
 
executeCommand ()
 
 enableExtendedLanguageMaintenanceObject ()
 Enable extended language maintenance. More...
 
 disableExtendedLanguageMaintenanceObject ()
 Disable extended language maintenance. More...
 
 confirmRefreshObject ()
 
 confirmRefreshSelectedObject ()
 
 getActions ()
 Get Actions. More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) 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...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. 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...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. 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
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 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 _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static 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
 
 $obj_data_record
 object_data record More...
 
- 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 ()
 
 prepareOutput ()
 prepare output More...
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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
 

Detailed Description

Member Function Documentation

◆ checkLanguageObject()

ilObjLanguageFolderGUI::checkLanguageObject ( )

check all languages

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

References out().

406  {
407  //$langFoldObj = new ilObjLanguageFolder($_GET["obj_id"]);
408  //$this->data = $langFoldObj->checkAllLanguages();
409  $this->data = $this->object->checkAllLanguages();
410  $this->out();
411  }
+ Here is the call graph for this function:

◆ confirmRefreshObject()

ilObjLanguageFolderGUI::confirmRefreshObject ( )

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

References $ilCtrl, and ilObject\$lng.

497  {
498  global $ilCtrl, $lng;
499 
500  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
501  $conf_screen = new ilConfirmationGUI();
502  $conf_screen->setFormAction($ilCtrl->getFormAction($this));
503  $conf_screen->setHeaderText($lng->txt("lang_refresh_confirm"));
504  $conf_screen->addItem("d", "d", $lng->txt("lang_refresh_confirm_info"));
505  $conf_screen->setCancel($lng->txt("cancel"), "view");
506  $conf_screen->setConfirm($lng->txt("ok"), "refresh");
507 
508  $this->tpl->setContent($conf_screen->getHTML());
509  }
global $ilCtrl
Definition: ilias.php:18
Confirmation screen class.

◆ confirmRefreshSelectedObject()

ilObjLanguageFolderGUI::confirmRefreshSelectedObject ( )

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

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

512  {
513  global $ilCtrl, $lng;
514 
515  if (!isset($_POST["id"]))
516  {
517  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
518  }
519 
520  $lng->loadLanguageModule("meta");
521  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
522  $conf_screen = new ilConfirmationGUI();
523  $conf_screen->setFormAction($ilCtrl->getFormAction($this));
524  $conf_screen->setHeaderText($lng->txt("lang_refresh_confirm_selected"));
525  foreach ($_POST["id"] as $id)
526  {
527  $lang_title = ilObject::_lookupTitle($id);
528  $conf_screen->addItem("id[]", $id, $lng->txt("meta_l_".$lang_title));
529  }
530  $conf_screen->addItem("d", "d", $lng->txt("lang_refresh_confirm_info"));
531  $conf_screen->setCancel($lng->txt("cancel"), "view");
532  $conf_screen->setConfirm($lng->txt("ok"), "refreshSelected");
533  $this->tpl->setContent($conf_screen->getHTML());
534  }
$_POST['username']
Definition: cron.php:12
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
Confirmation screen class.
+ Here is the call graph for this function:

◆ disableExtendedLanguageMaintenanceObject()

ilObjLanguageFolderGUI::disableExtendedLanguageMaintenanceObject ( )

Disable extended language maintenance.

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

References $ilCtrl, and $ilSetting.

489  {
490  global $ilSetting, $ilCtrl;
491 
492  $ilSetting->set("lang_ext_maintenance", 0);
493  $ilCtrl->redirect($this, "view");
494  }
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:40

◆ enableExtendedLanguageMaintenanceObject()

ilObjLanguageFolderGUI::enableExtendedLanguageMaintenanceObject ( )

Enable extended language maintenance.

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

References $ilCtrl, and $ilSetting.

478  {
479  global $ilSetting, $ilCtrl;
480 
481  $ilSetting->set("lang_ext_maintenance", 1);
482  $ilCtrl->redirect($this, "view");
483  }
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:40

◆ executeCommand()

& ilObjLanguageFolderGUI::executeCommand ( )

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

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

448  {
449  $next_class = $this->ctrl->getNextClass($this);
450  $cmd = $this->ctrl->getCmd();
451  $this->prepareOutput();
452 
453  switch($next_class)
454  {
455  case 'ilpermissiongui':
456  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
457  $perm_gui =& new ilPermissionGUI($this);
458  $ret =& $this->ctrl->forwardCommand($perm_gui);
459  break;
460 
461  default:
462  if(!$cmd)
463  {
464  $cmd = "view";
465  }
466  $cmd .= "Object";
467  $this->$cmd();
468 
469  break;
470  }
471  return true;
472  }
$cmd
Definition: sahs_server.php:35
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getActions()

ilObjLanguageFolderGUI::getActions ( )

Get Actions.

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

References $ilSetting, ilUtil\sendSuccess(), and viewObject().

540  {
541  global $ilSetting;
542 
543  // standard actions for container
544  return array(
545  "install" => array("name" => "install", "lng" => "install"),
546  "installLocal" => array("name" => "installLocal", "lng" => "install_local"),
547  "uninstall" => array("name" => "uninstall", "lng" => "uninstall"),
548  "refresh" => $ilSetting->get("lang_ext_maintenance") == "1" ?
549  array("name" => "confirmRefreshSelected", "lng" => "refresh") :
550  array("name" => "RefreshSelected", "lng" => "refresh"),
551  "setSystemLanguage" => array("name" => "setSystemLanguage", "lng" => "setSystemLanguage"),
552  "setUserLanguage" => array("name" => "setUserLanguage", "lng" => "setUserLanguage")
553  );
554  }
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjLanguageFolderGUI::getAdminTabs ( $tabs_gui)

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

References getTabs().

421  {
422  $this->getTabs($tabs_gui);
423  }
getTabs(&$tabs_gui)
get tabs public
+ Here is the call graph for this function:

◆ getTabs()

ilObjLanguageFolderGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

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

Referenced by getAdminTabs().

431  {
432  global $rbacsystem;
433 
434  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
435  {
436  $tabs_gui->addTarget("settings",
437  $this->ctrl->getLinkTarget($this, "view"), array("view",""), "", "");
438  }
439 
440  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
441  {
442  $tabs_gui->addTarget("perm_settings",
443  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
444  }
445  }
+ Here is the caller graph for this function:

◆ ilObjLanguageFolderGUI()

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

Constructor.

public

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

References $_GET, and ilObjectGUI\ilObjectGUI().

28  {
29  $this->type = "lngf";
30  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
31  $_GET["sort_by"] = "language";
32  $this->lng->loadLanguageModule('lng');
33  }
$_GET["client_id"]
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
+ Here is the call graph for this function:

◆ installLocalObject()

ilObjLanguageFolderGUI::installLocalObject ( )

Install local language modifications.

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

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

147  {
148  $this->lng->loadLanguageModule("meta");
149 
150  if (!isset($_POST["id"]))
151  {
152  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
153  }
154 
155  foreach ($_POST["id"] as $obj_id)
156  {
157  $langObj = new ilObjLanguage($obj_id);
158  $key = $langObj->install();
159 
160  if ($key != "")
161  {
162  $lang_installed[] = $key;
163  }
164 
165  unset($langObj);
166 
167  $langObj = new ilObjLanguage($obj_id);
168  $key = $langObj->install('local');
169 
170  if ($key != "")
171  {
172  $local_installed[] = $key;
173  }
174 
175  unset($langObj);
176  }
177 
178  if (isset($lang_installed))
179  {
180  if (count($lang_installed) == 1)
181  {
182  $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
183  }
184  else
185  {
186  foreach ($lang_installed as $lang_key)
187  {
188  $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
189  }
190  $this->data = implode(", ",$langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
191  }
192  }
193 
194  if (isset($local_installed))
195  {
196  if (count($local_installed) == 1)
197  {
198  $this->data .= " " . $this->lng->txt("meta_l_" . $local_installed[0]) . " " . $this->lng->txt("local_language_file") . " " . strtolower($this->lng->txt("installed")) . ".";
199  }
200  else
201  {
202  foreach ($local_installed as $lang_key)
203  {
204  $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
205  }
206  $this->data .= " " . implode(", ",$langnames) . " " . $this->lng->txt("local_language_files") . " " . strtolower($this->lng->txt("installed")) . ".";
207  }
208  }
209  else
210  {
211  $this->data .= " " . $this->lng->txt("local_languages_already_installed");
212  }
213 
214  $this->out();
215  }
$_POST['username']
Definition: cron.php:12
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ installObject()

ilObjLanguageFolderGUI::installObject ( )

install languages

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

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

98  {
99  $this->lng->loadLanguageModule("meta");
100 
101  if (!isset($_POST["id"]))
102  {
103  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
104  }
105 
106  foreach ($_POST["id"] as $obj_id)
107  {
108  $langObj = new ilObjLanguage($obj_id);
109  $key = $langObj->install();
110 
111  if ($key != "")
112  {
113  $lang_installed[] = $key;
114  }
115 
116  unset($langObj);
117  }
118 
119  if (isset($lang_installed))
120  {
121  if (count($lang_installed) == 1)
122  {
123  $this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
124  }
125  else
126  {
127  foreach ($lang_installed as $lang_key)
128  {
129  $langnames[] = $this->lng->txt("meta_l_" . $lang_key);
130  }
131  $this->data = implode(", ",$langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
132  }
133  }
134  else
135  {
136  $this->data = $this->lng->txt("languages_already_installed");
137  }
138 
139  $this->out();
140  }
$_POST['username']
Definition: cron.php:12
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ out()

ilObjLanguageFolderGUI::out ( )

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

References ilUtil\sendInfo().

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

415  {
416  ilUtil::sendInfo($this->data,true);
417  $this->ctrl->redirect($this, "view");
418  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshObject()

ilObjLanguageFolderGUI::refreshObject ( )

update all installed languages

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

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

281  {
283  $this->data = $this->lng->txt("languages_updated");
284  $this->out();
285  }
static refreshAll()
Refresh all installed languages.
+ Here is the call graph for this function:

◆ refreshSelectedObject()

ilObjLanguageFolderGUI::refreshSelectedObject ( )

update selected languages

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

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

292  {
293  global $lng;
294 
295  $this->data = $this->lng->txt("selected_languages_updated");
296  $lng->loadLanguageModule("meta");
297 
298  $refreshed = array();
299  foreach ($_POST["id"] as $id)
300  {
301  $langObj = new ilObjLanguage($id, false);
302  if ($langObj->refresh())
303  {
304  $refreshed[] = $langObj->getKey();
305  $this->data .= "<br />". $lng->txt("meta_l_".$langObj->getKey());
306  }
307  unset($langObj);
308  }
309 
310  ilObjLanguage::refreshPlugins($refreshed);
311  $this->out();
312  }
$_POST['username']
Definition: cron.php:12
Class ilObjLanguage.
static refreshPlugins($a_lang_keys=null)
+ Here is the call graph for this function:

◆ setSystemLanguageObject()

ilObjLanguageFolderGUI::setSystemLanguageObject ( )

set the system language

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

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

363  {
364  $this->lng->loadLanguageModule("meta");
365 
366  if (!isset($_POST["id"]))
367  {
368  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
369  }
370 
371  if (count($_POST["id"]) != 1)
372  {
373  $this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
374  }
375 
376  $obj_id = $_POST["id"][0];
377 
378  $newSysLangObj = new ilObjLanguage($obj_id);
379 
380  if ($newSysLangObj->isSystemLanguage())
381  {
382  $this->ilias->raiseError($this->lng->txt("meta_l_".$newSysLangObj->getKey())." is already the system language!<br>Action aborted!",$this->ilias->error_obj->MESSAGE);
383  }
384 
385  if ($newSysLangObj->isInstalled() == false)
386  {
387  $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);
388  }
389 
390  $this->ilias->setSetting("language", $newSysLangObj->getKey());
391 
392  // update ini-file
393  $this->ilias->ini->setVariable("language","default",$newSysLangObj->getKey());
394  $this->ilias->ini->write();
395 
396  $this->data = $this->lng->txt("system_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newSysLangObj->getKey()).".";
397 
398  $this->out();
399  }
$_POST['username']
Definition: cron.php:12
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ setUserLanguageObject()

ilObjLanguageFolderGUI::setUserLanguageObject ( )

set user language

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

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

319  {
320  $this->lng->loadLanguageModule("meta");
321 
322  require_once './Services/User/classes/class.ilObjUser.php';
323 
324  if (!isset($_POST["id"]))
325  {
326  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
327  }
328 
329  if (count($_POST["id"]) != 1)
330  {
331  $this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
332  }
333 
334  $obj_id = $_POST["id"][0];
335 
336  $newUserLangObj = new ilObjLanguage($obj_id);
337 
338  if ($newUserLangObj->isUserLanguage())
339  {
340  $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);
341  }
342 
343  if ($newUserLangObj->isInstalled() == false)
344  {
345  $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);
346  }
347 
348  $curUser = new ilObjUser($_SESSION["AccountId"]);
349  $curUser->setLanguage($newUserLangObj->getKey());
350  $curUser->update();
351  //$this->setUserLanguage($new_lang_key);
352 
353  $this->data = $this->lng->txt("user_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newUserLangObj->getKey()).".";
354 
355  $this->out();
356  }
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ uninstallObject()

ilObjLanguageFolderGUI::uninstallObject ( )

uninstall language

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

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

222  {
223  $this->lng->loadLanguageModule("meta");
224 
225  if (!isset($_POST["id"]))
226  {
227  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
228  }
229 
230  // uninstall all selected languages
231  foreach ($_POST["id"] as $obj_id)
232  {
233  $langObj = new ilObjLanguage($obj_id);
234  if (!($sys_lang = $langObj->isSystemLanguage()))
235  if (!($usr_lang = $langObj->isUserLanguage()))
236  {
237  $key = $langObj->uninstall();
238  if ($key != "")
239  $lang_uninstalled[] = $key;
240  }
241  unset($langObj);
242  }
243 
244  // generate output message
245  if (isset($lang_uninstalled))
246  {
247  if (count($lang_uninstalled) == 1)
248  {
249  $this->data = $this->lng->txt("meta_l_".$lang_uninstalled[0])." ".$this->lng->txt("uninstalled");
250  }
251  else
252  {
253  foreach ($lang_uninstalled as $lang_key)
254  {
255  $langnames[] = $this->lng->txt("meta_l_".$lang_key);
256  }
257 
258  $this->data = implode(", ",$langnames)." ".$this->lng->txt("uninstalled");
259  }
260  }
261  elseif ($sys_lang)
262  {
263  $this->data = $this->lng->txt("cannot_uninstall_systemlanguage");
264  }
265  elseif ($usr_lang)
266  {
267  $this->data = $this->lng->txt("cannot_uninstall_language_in_use");
268  }
269  else
270  {
271  $this->data = $this->lng->txt("languages_already_uninstalled");
272  }
273 
274  $this->out();
275  }
$_POST['username']
Definition: cron.php:12
Class ilObjLanguage.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ viewObject()

ilObjLanguageFolderGUI::viewObject ( )

show installed languages

public

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

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

Referenced by getActions().

41  {
42  global $rbacsystem, $ilSetting, $tpl, $ilToolbar, $lng;
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  if ($ilSetting->get("lang_ext_maintenance") == "1")
51  {
52  $ilToolbar->addButton($lng->txt("refresh_languages"),
53  $this->ctrl->getLinkTarget($this, "confirmRefresh"));
54  }
55  else
56  {
57  $ilToolbar->addButton($lng->txt("refresh_languages"),
58  $this->ctrl->getLinkTarget($this, "refresh"));
59  }
60 
61  // check languages
62  $ilToolbar->addButton($lng->txt("check_languages"),
63  $this->ctrl->getLinkTarget($this, "checkLanguage"));
64 
65  // extended language maintenance
66  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
67  {
68  if ($ilSetting->get("lang_ext_maintenance") == "1")
69  {
70  $ilToolbar->addButton($lng->txt("disable_ext_lang_maint"),
71  $this->ctrl->getLinkTarget($this, "disableExtendedLanguageMaintenance"));
72  }
73  else
74  {
75  $ilToolbar->addButton($lng->txt("enable_ext_lang_maint"),
76  $this->ctrl->getLinkTarget($this, "enableExtendedLanguageMaintenance"));
77  }
78 
79  if(!$ilSetting->get('lang_detection'))
80  {
81  $ilToolbar->addButton($lng->txt('lng_enable_language_detection'), $this->ctrl->getLinkTarget($this, 'enableLanguageDetection'));
82  }
83  else
84  {
85  $ilToolbar->addButton($lng->txt('lng_disable_language_detection'), $this->ctrl->getLinkTarget($this, 'disableLanguageDetection'));
86  }
87  }
88 
89  include_once("./Services/Language/classes/class.ilLanguageTableGUI.php");
90  $ltab = new ilLanguageTableGUI($this, "view", $this->object);
91  $tpl->setContent($ltab->getHTML());
92  }
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilSetting
Definition: privfeed.php:40
+ Here is the caller graph for this function:

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