ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
- 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...
 
 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 _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 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)
 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...
 

Detailed Description

Member Function Documentation

◆ checkLanguageObject()

ilObjLanguageFolderGUI::checkLanguageObject ( )

check all languages

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

References out().

396  {
397  //$langFoldObj = new ilObjLanguageFolder($_GET["obj_id"]);
398  //$this->data = $langFoldObj->checkAllLanguages();
399  $this->data = $this->object->checkAllLanguages();
400  $this->out();
401  }
+ Here is the call graph for this function:

◆ confirmRefreshObject()

ilObjLanguageFolderGUI::confirmRefreshObject ( )

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

References $ilCtrl, and ilObject\$lng.

487  {
488  global $ilCtrl, $lng;
489 
490  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
491  $conf_screen = new ilConfirmationGUI();
492  $conf_screen->setFormAction($ilCtrl->getFormAction($this));
493  $conf_screen->setHeaderText($lng->txt("lang_refresh_confirm"));
494  $conf_screen->addItem("d", "d", $lng->txt("lang_refresh_confirm_info"));
495  $conf_screen->setCancel($lng->txt("cancel"), "view");
496  $conf_screen->setConfirm($lng->txt("ok"), "refresh");
497 
498  $this->tpl->setContent($conf_screen->getHTML());
499  }
global $ilCtrl
Definition: ilias.php:18
Confirmation screen class.

◆ confirmRefreshSelectedObject()

ilObjLanguageFolderGUI::confirmRefreshSelectedObject ( )

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

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

502  {
503  global $ilCtrl, $lng;
504 
505  if (!isset($_POST["id"]))
506  {
507  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
508  }
509 
510  $lng->loadLanguageModule("meta");
511  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
512  $conf_screen = new ilConfirmationGUI();
513  $conf_screen->setFormAction($ilCtrl->getFormAction($this));
514  $conf_screen->setHeaderText($lng->txt("lang_refresh_confirm_selected"));
515  foreach ($_POST["id"] as $id)
516  {
517  $lang_title = ilObject::_lookupTitle($id);
518  $conf_screen->addItem("id[]", $id, $lng->txt("meta_l_".$lang_title));
519  }
520  $conf_screen->addItem("d", "d", $lng->txt("lang_refresh_confirm_info"));
521  $conf_screen->setCancel($lng->txt("cancel"), "view");
522  $conf_screen->setConfirm($lng->txt("ok"), "refreshSelected");
523  $this->tpl->setContent($conf_screen->getHTML());
524  }
$_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 478 of file class.ilObjLanguageFolderGUI.php.

References $ilCtrl, and $ilSetting.

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

◆ enableExtendedLanguageMaintenanceObject()

ilObjLanguageFolderGUI::enableExtendedLanguageMaintenanceObject ( )

Enable extended language maintenance.

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

References $ilCtrl, and $ilSetting.

468  {
469  global $ilSetting, $ilCtrl;
470 
471  $ilSetting->set("lang_ext_maintenance", 1);
472  $ilCtrl->redirect($this, "view");
473  }
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:40

◆ executeCommand()

& ilObjLanguageFolderGUI::executeCommand ( )

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

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

438  {
439  $next_class = $this->ctrl->getNextClass($this);
440  $cmd = $this->ctrl->getCmd();
441  $this->prepareOutput();
442 
443  switch($next_class)
444  {
445  case 'ilpermissiongui':
446  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
447  $perm_gui =& new ilPermissionGUI($this);
448  $ret =& $this->ctrl->forwardCommand($perm_gui);
449  break;
450 
451  default:
452  if(!$cmd)
453  {
454  $cmd = "view";
455  }
456  $cmd .= "Object";
457  $this->$cmd();
458 
459  break;
460  }
461  return true;
462  }
$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 529 of file class.ilObjLanguageFolderGUI.php.

References $ilSetting.

530  {
531  global $ilSetting;
532 
533  // standard actions for container
534  return array(
535  "install" => array("name" => "install", "lng" => "install"),
536  "installLocal" => array("name" => "installLocal", "lng" => "install_local"),
537  "uninstall" => array("name" => "uninstall", "lng" => "uninstall"),
538  "refresh" => $ilSetting->get("lang_ext_maintenance") == "1" ?
539  array("name" => "confirmRefreshSelected", "lng" => "refresh") :
540  array("name" => "RefreshSelected", "lng" => "refresh"),
541  "setSystemLanguage" => array("name" => "setSystemLanguage", "lng" => "setSystemLanguage"),
542  "setUserLanguage" => array("name" => "setUserLanguage", "lng" => "setUserLanguage")
543  );
544  }
global $ilSetting
Definition: privfeed.php:40

◆ getAdminTabs()

ilObjLanguageFolderGUI::getAdminTabs ( $tabs_gui)

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

References getTabs().

411  {
412  $this->getTabs($tabs_gui);
413  }
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 420 of file class.ilObjLanguageFolderGUI.php.

Referenced by getAdminTabs().

421  {
422  global $rbacsystem;
423 
424  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
425  {
426  $tabs_gui->addTarget("settings",
427  $this->ctrl->getLinkTarget($this, "view"), array("view",""), "", "");
428  }
429 
430  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
431  {
432  $tabs_gui->addTarget("perm_settings",
433  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
434  }
435  }
+ 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  }
$_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 136 of file class.ilObjLanguageFolderGUI.php.

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

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

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

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

References ilUtil\sendInfo().

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

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

◆ refreshObject()

ilObjLanguageFolderGUI::refreshObject ( )

update all installed languages

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

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

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

◆ refreshSelectedObject()

ilObjLanguageFolderGUI::refreshSelectedObject ( )

update selected languages

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

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

282  {
283  global $lng;
284 
285  $this->data = $this->lng->txt("selected_languages_updated");
286  $lng->loadLanguageModule("meta");
287 
288  $refreshed = array();
289  foreach ($_POST["id"] as $id)
290  {
291  $langObj = new ilObjLanguage($id, false);
292  if ($langObj->refresh())
293  {
294  $refreshed[] = $langObj->getKey();
295  $this->data .= "<br />". $lng->txt("meta_l_".$langObj->getKey());
296  }
297  unset($langObj);
298  }
299 
300  ilObjLanguage::refreshPlugins($refreshed);
301  $this->out();
302  }
$_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 352 of file class.ilObjLanguageFolderGUI.php.

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

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

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

309  {
310  $this->lng->loadLanguageModule("meta");
311 
312  require_once './Services/User/classes/class.ilObjUser.php';
313 
314  if (!isset($_POST["id"]))
315  {
316  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
317  }
318 
319  if (count($_POST["id"]) != 1)
320  {
321  $this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
322  }
323 
324  $obj_id = $_POST["id"][0];
325 
326  $newUserLangObj = new ilObjLanguage($obj_id);
327 
328  if ($newUserLangObj->isUserLanguage())
329  {
330  $this->ilias->raiseError($this->lng->txt("meta_l_".$newUserLangObj->getKey())." ".$this->lng->txt("is_already_your")." ".$this->lng->txt("user_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
331  }
332 
333  if ($newUserLangObj->isInstalled() == false)
334  {
335  $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);
336  }
337 
338  $curUser = new ilObjUser($_SESSION["AccountId"]);
339  $curUser->setLanguage($newUserLangObj->getKey());
340  $curUser->update();
341  //$this->setUserLanguage($new_lang_key);
342 
343  $this->data = $this->lng->txt("user_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newUserLangObj->getKey()).".";
344 
345  $this->out();
346  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_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:

◆ uninstallObject()

ilObjLanguageFolderGUI::uninstallObject ( )

uninstall language

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

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

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

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

40  {
41  global $rbacsystem, $ilSetting, $tpl, $ilToolbar, $lng;
42 
43  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
44  {
45  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
46  }
47 
48  // refresh
49  if ($ilSetting->get("lang_ext_maintenance") == "1")
50  {
51  $ilToolbar->addButton($lng->txt("refresh_languages"),
52  $this->ctrl->getLinkTarget($this, "confirmRefresh"));
53  }
54  else
55  {
56  $ilToolbar->addButton($lng->txt("refresh_languages"),
57  $this->ctrl->getLinkTarget($this, "refresh"));
58  }
59 
60  // check languages
61  $ilToolbar->addButton($lng->txt("check_languages"),
62  $this->ctrl->getLinkTarget($this, "checkLanguage"));
63 
64  // extended language maintenance
65  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
66  {
67  if ($ilSetting->get("lang_ext_maintenance") == "1")
68  {
69  $ilToolbar->addButton($lng->txt("disable_ext_lang_maint"),
70  $this->ctrl->getLinkTarget($this, "disableExtendedLanguageMaintenance"));
71  }
72  else
73  {
74  $ilToolbar->addButton($lng->txt("enable_ext_lang_maint"),
75  $this->ctrl->getLinkTarget($this, "enableExtendedLanguageMaintenance"));
76  }
77  }
78 
79  include_once("./Services/Language/classes/class.ilLanguageTableGUI.php");
80  $ltab = new ilLanguageTableGUI($this, "view", $this->object);
81  $tpl->setContent($ltab->getHTML());
82  }
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilSetting
Definition: privfeed.php:40

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