ILIAS  release_4-4 Revision
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...
 
 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...
 
 createRoleFolder ()
 creates a local role folder 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...
 
 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 415 of file class.ilObjLanguageFolderGUI.php.

References out().

416  {
417  //$langFoldObj = new ilObjLanguageFolder($_GET["obj_id"]);
418  //$this->data = $langFoldObj->checkAllLanguages();
419  $this->data = $this->object->checkAllLanguages();
420  $this->out();
421  }
+ Here is the call graph for this function:

◆ confirmRefreshObject()

ilObjLanguageFolderGUI::confirmRefreshObject ( )

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

References $ilCtrl, and ilObject\$lng.

507  {
508  global $ilCtrl, $lng;
509 
510  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
511  $conf_screen = new ilConfirmationGUI();
512  $conf_screen->setFormAction($ilCtrl->getFormAction($this));
513  $conf_screen->setHeaderText($lng->txt("lang_refresh_confirm"));
514  $conf_screen->addItem("d", "d", $lng->txt("lang_refresh_confirm_info"));
515  $conf_screen->setCancel($lng->txt("cancel"), "view");
516  $conf_screen->setConfirm($lng->txt("ok"), "refresh");
517 
518  $this->tpl->setContent($conf_screen->getHTML());
519  }
global $ilCtrl
Definition: ilias.php:18
Confirmation screen class.

◆ confirmRefreshSelectedObject()

ilObjLanguageFolderGUI::confirmRefreshSelectedObject ( )

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

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

522  {
523  global $ilCtrl, $lng;
524 
525  if (!isset($_POST["id"]))
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  $conf_screen = new ilConfirmationGUI();
533  $conf_screen->setFormAction($ilCtrl->getFormAction($this));
534  $conf_screen->setHeaderText($lng->txt("lang_refresh_confirm_selected"));
535  foreach ($_POST["id"] as $id)
536  {
537  $lang_title = ilObject::_lookupTitle($id);
538  $conf_screen->addItem("id[]", $id, $lng->txt("meta_l_".$lang_title));
539  }
540  $conf_screen->addItem("d", "d", $lng->txt("lang_refresh_confirm_info"));
541  $conf_screen->setCancel($lng->txt("cancel"), "view");
542  $conf_screen->setConfirm($lng->txt("ok"), "refreshSelected");
543  $this->tpl->setContent($conf_screen->getHTML());
544  }
$_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 498 of file class.ilObjLanguageFolderGUI.php.

References $ilCtrl, and $ilSetting.

499  {
500  global $ilSetting, $ilCtrl;
501 
502  $ilSetting->set("lang_ext_maintenance", 0);
503  $ilCtrl->redirect($this, "view");
504  }
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:40

◆ enableExtendedLanguageMaintenanceObject()

ilObjLanguageFolderGUI::enableExtendedLanguageMaintenanceObject ( )

Enable extended language maintenance.

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

References $ilCtrl, and $ilSetting.

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

◆ executeCommand()

& ilObjLanguageFolderGUI::executeCommand ( )

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

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

458  {
459  $next_class = $this->ctrl->getNextClass($this);
460  $cmd = $this->ctrl->getCmd();
461  $this->prepareOutput();
462 
463  switch($next_class)
464  {
465  case 'ilpermissiongui':
466  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
467  $perm_gui =& new ilPermissionGUI($this);
468  $ret =& $this->ctrl->forwardCommand($perm_gui);
469  break;
470 
471  default:
472  if(!$cmd)
473  {
474  $cmd = "view";
475  }
476  $cmd .= "Object";
477  $this->$cmd();
478 
479  break;
480  }
481  return true;
482  }
$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 549 of file class.ilObjLanguageFolderGUI.php.

References $ilSetting.

550  {
551  global $ilSetting;
552 
553  // standard actions for container
554  return array(
555  "install" => array("name" => "install", "lng" => "install"),
556  "installLocal" => array("name" => "installLocal", "lng" => "install_local"),
557  "uninstall" => array("name" => "uninstall", "lng" => "uninstall"),
558  "refresh" => $ilSetting->get("lang_ext_maintenance") == "1" ?
559  array("name" => "confirmRefreshSelected", "lng" => "refresh") :
560  array("name" => "RefreshSelected", "lng" => "refresh"),
561  "setSystemLanguage" => array("name" => "setSystemLanguage", "lng" => "setSystemLanguage"),
562  "setUserLanguage" => array("name" => "setUserLanguage", "lng" => "setUserLanguage")
563  );
564  }
global $ilSetting
Definition: privfeed.php:40

◆ getAdminTabs()

ilObjLanguageFolderGUI::getAdminTabs ( $tabs_gui)

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

References getTabs().

431  {
432  $this->getTabs($tabs_gui);
433  }
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 440 of file class.ilObjLanguageFolderGUI.php.

Referenced by getAdminTabs().

441  {
442  global $rbacsystem;
443 
444  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
445  {
446  $tabs_gui->addTarget("settings",
447  $this->ctrl->getLinkTarget($this, "view"), array("view",""), "", "");
448  }
449 
450  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
451  {
452  $tabs_gui->addTarget("perm_settings",
453  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
454  }
455  }
+ 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 424 of file class.ilObjLanguageFolderGUI.php.

References ilUtil\sendInfo().

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

425  {
426  ilUtil::sendInfo($this->data,true);
427  $this->ctrl->redirect($this, "view");
428  }
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, and out().

282  {
283  global $lng;
284 
285  $this->data = $this->lng->txt("selected_languages_updated");
286  $lng->loadLanguageModule("meta");
287 
288  foreach ($_POST["id"] as $id)
289  {
290  $langObj = new ilObjLanguage($id, false);
291 
292  if ($langObj->isInstalled() == true)
293  {
294  if ($langObj->check())
295  {
296  $langObj->flush('keep_local');
297  $langObj->insert();
298  $langObj->setTitle($langObj->getKey());
299  $langObj->setDescription($langObj->getStatus());
300  $langObj->update();
301  $langObj->optimizeData();
302 
303  if ($langObj->isLocal() == true)
304  {
305  if ($langObj->check('local'))
306  {
307  $langObj->insert('local');
308  $langObj->setTitle($langObj->getKey());
309  $langObj->setDescription($langObj->getStatus());
310  $langObj->update();
311  $langObj->optimizeData();
312  }
313  }
314  }
315  $this->data .= "<br />". $lng->txt("meta_l_".$langObj->getKey());
316  }
317 
318  unset($langObj);
319  }
320 
321  $this->out();
322  }
$_POST['username']
Definition: cron.php:12
Class ilObjLanguage.
+ Here is the call graph for this function:

◆ setSystemLanguageObject()

ilObjLanguageFolderGUI::setSystemLanguageObject ( )

set the system language

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

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

373  {
374  $this->lng->loadLanguageModule("meta");
375 
376  if (!isset($_POST["id"]))
377  {
378  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
379  }
380 
381  if (count($_POST["id"]) != 1)
382  {
383  $this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
384  }
385 
386  $obj_id = $_POST["id"][0];
387 
388  $newSysLangObj = new ilObjLanguage($obj_id);
389 
390  if ($newSysLangObj->isSystemLanguage())
391  {
392  $this->ilias->raiseError($this->lng->txt("meta_l_".$newSysLangObj->getKey())." is already the system language!<br>Action aborted!",$this->ilias->error_obj->MESSAGE);
393  }
394 
395  if ($newSysLangObj->isInstalled() == false)
396  {
397  $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);
398  }
399 
400  $this->ilias->setSetting("language", $newSysLangObj->getKey());
401 
402  // update ini-file
403  $this->ilias->ini->setVariable("language","default",$newSysLangObj->getKey());
404  $this->ilias->ini->write();
405 
406  $this->data = $this->lng->txt("system_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newSysLangObj->getKey()).".";
407 
408  $this->out();
409  }
$_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 328 of file class.ilObjLanguageFolderGUI.php.

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

329  {
330  $this->lng->loadLanguageModule("meta");
331 
332  require_once './Services/User/classes/class.ilObjUser.php';
333 
334  if (!isset($_POST["id"]))
335  {
336  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
337  }
338 
339  if (count($_POST["id"]) != 1)
340  {
341  $this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
342  }
343 
344  $obj_id = $_POST["id"][0];
345 
346  $newUserLangObj = new ilObjLanguage($obj_id);
347 
348  if ($newUserLangObj->isUserLanguage())
349  {
350  $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);
351  }
352 
353  if ($newUserLangObj->isInstalled() == false)
354  {
355  $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);
356  }
357 
358  $curUser = new ilObjUser($_SESSION["AccountId"]);
359  $curUser->setLanguage($newUserLangObj->getKey());
360  $curUser->update();
361  //$this->setUserLanguage($new_lang_key);
362 
363  $this->data = $this->lng->txt("user_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newUserLangObj->getKey()).".";
364 
365  $this->out();
366  }
< 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: