ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups 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.
 viewObject ()
 show installed languages
 installObject ()
 install languages
 installLocalObject ()
 Install local language modifications.
 uninstallObject ()
 uninstall language
 refreshObject ()
 update all installed languages
 refreshSelectedObject ()
 update selected languages
 setUserLanguageObject ()
 set user language
 setSystemLanguageObject ()
 set the system language
 checkLanguageObject ()
 check all languages
 out ()
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getTabs (&$tabs_gui)
 get tabs public
executeCommand ()
 execute command
 enableExtendedLanguageMaintenanceObject ()
 Enable extended language maintenance.
 disableExtendedLanguageMaintenanceObject ()
 Disable extended language maintenance.
 confirmRefreshObject ()
 confirmRefreshSelectedObject ()
 getActions ()
 Get Actions.
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public.
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not)
 read ($a_force_db=false)
 read object data from db into object
 getId ()
 get object id public
 setId ($a_id)
 set object id public
 setRefId ($a_id)
 set reference id public
 getRefId ()
 get reference id public
 getType ()
 get object type public
 setType ($a_type)
 set object type public
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions
 getTitle ()
 get object title public
 getUntranslatedTitle ()
 get untranslated object title public
 setTitle ($a_title)
 set object title
 getDescription ()
 get object description
 setDescription ($a_desc)
 set object description
 getLongDescription ()
 get object long description (stored in object_description)
 getImportId ()
 get import id
 setImportId ($a_import_id)
 set import id
 getOwner ()
 get object owner
 getOwnerName ()
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id
 setOwner ($a_owner)
 set object owner
 getCreateDate ()
 get create date public
 getLastUpdateDate ()
 get last update date public
 getDiskUsage ()
 Gets the disk usage of the object in bytes.
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class)
 create ()
 create
 update ()
 update object in db
 MDUpdateListener ($a_element)
 Meta data update listener.
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 updateOwner ()
 update owner of object in db
 _getIdForImportId ($a_import_id)
 get current object id for import id (static)
 _lookupOwner ($a_id)
 lookup object owner
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects.
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static)
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static)
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static)
 _isInTrash ($a_ref_id)
 checks wether object is in trash
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash
 _lookupObjectId ($a_ref_id)
 lookup object id
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!?
 setPermissions ($a_parent_ref)
 set permissions of object
 createReference ()
 creates reference for object
 countReferences ()
 count references of object
 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!!
 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
 createRoleFolder ()
 creates a local role folder
 applyDidacticTemplate ($a_tpl_id)
 Apply template.
 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.
 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 ...
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container.
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies.
 cloneMetaData ($target_obj)
 Copy meta data.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

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
static _lookupTitle ($a_id)
 lookup object title
static _getIdsForTitle ($title, $type= '', $partialmatch=false)
static _lookupDescription ($a_id)
 lookup object description
static _lookupObjId ($a_id)
static _lookupType ($a_id, $a_reference=false)
 lookup object type
 _exists ($a_id, $a_reference=false)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item.
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies.
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies.
- Data Fields inherited from ilObject
const TITLE_LENGTH = 128
 max length of object title
 $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
- 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
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 initCreationForms ($a_new_type)
 Init creation froms.
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __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
 __showClipboardTable ($a_result_set, $a_from="")
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.

Detailed Description

Member Function Documentation

ilObjLanguageFolderGUI::checkLanguageObject ( )

check all languages

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

References out().

{
//$langFoldObj = new ilObjLanguageFolder($_GET["obj_id"]);
//$this->data = $langFoldObj->checkAllLanguages();
$this->data = $this->object->checkAllLanguages();
$this->out();
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::confirmRefreshObject ( )

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

References $ilCtrl, and ilObject\$lng.

{
global $ilCtrl, $lng;
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$conf_screen = new ilConfirmationGUI();
$conf_screen->setFormAction($ilCtrl->getFormAction($this));
$conf_screen->setHeaderText($lng->txt("lang_refresh_confirm"));
$conf_screen->addItem("d", "d", $lng->txt("lang_refresh_confirm_info"));
$conf_screen->setCancel($lng->txt("cancel"), "view");
$conf_screen->setConfirm($lng->txt("ok"), "refresh");
$this->tpl->setContent($conf_screen->getHTML());
}
ilObjLanguageFolderGUI::confirmRefreshSelectedObject ( )

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

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

{
global $ilCtrl, $lng;
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
$lng->loadLanguageModule("meta");
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$conf_screen = new ilConfirmationGUI();
$conf_screen->setFormAction($ilCtrl->getFormAction($this));
$conf_screen->setHeaderText($lng->txt("lang_refresh_confirm_selected"));
foreach ($_POST["id"] as $id)
{
$lang_title = ilObject::_lookupTitle($id);
$conf_screen->addItem("id[]", $id, $lng->txt("meta_l_".$lang_title));
}
$conf_screen->addItem("d", "d", $lng->txt("lang_refresh_confirm_info"));
$conf_screen->setCancel($lng->txt("cancel"), "view");
$conf_screen->setConfirm($lng->txt("ok"), "refreshSelected");
$this->tpl->setContent($conf_screen->getHTML());
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::disableExtendedLanguageMaintenanceObject ( )

Disable extended language maintenance.

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

References $ilCtrl, and $ilSetting.

{
$ilSetting->set("lang_ext_maintenance", 0);
$ilCtrl->redirect($this, "view");
}
ilObjLanguageFolderGUI::enableExtendedLanguageMaintenanceObject ( )

Enable extended language maintenance.

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

References $ilCtrl, and $ilSetting.

{
$ilSetting->set("lang_ext_maintenance", 1);
$ilCtrl->redirect($this, "view");
}
& ilObjLanguageFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

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

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if(!$cmd)
{
$cmd = "view";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::getActions ( )

Get Actions.

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

References $ilSetting.

{
global $ilSetting;
// standard actions for container
return array(
"install" => array("name" => "install", "lng" => "install"),
"installLocal" => array("name" => "installLocal", "lng" => "install_local"),
"uninstall" => array("name" => "uninstall", "lng" => "uninstall"),
"refresh" => $ilSetting->get("lang_ext_maintenance") == "1" ?
array("name" => "confirmRefreshSelected", "lng" => "refresh") :
array("name" => "RefreshSelected", "lng" => "refresh"),
"setSystemLanguage" => array("name" => "setSystemLanguage", "lng" => "setSystemLanguage"),
"setUserLanguage" => array("name" => "setUserLanguage", "lng" => "setUserLanguage")
);
}
ilObjLanguageFolderGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

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

Referenced by getAdminTabs().

{
global $rbacsystem;
if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this, "view"), array("view",""), "", "");
}
if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}

+ Here is the caller graph for this function:

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().

{
$this->type = "lngf";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
$_GET["sort_by"] = "language";
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::installLocalObject ( )

Install local language modifications.

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

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

{
$this->lng->loadLanguageModule("meta");
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
foreach ($_POST["id"] as $obj_id)
{
$langObj = new ilObjLanguage($obj_id);
$key = $langObj->install();
if ($key != "")
{
$lang_installed[] = $key;
}
unset($langObj);
$langObj = new ilObjLanguage($obj_id);
$key = $langObj->install('local');
if ($key != "")
{
$local_installed[] = $key;
}
unset($langObj);
}
if (isset($lang_installed))
{
if (count($lang_installed) == 1)
{
$this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
}
else
{
foreach ($lang_installed as $lang_key)
{
$langnames[] = $this->lng->txt("meta_l_" . $lang_key);
}
$this->data = implode(", ",$langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
}
}
if (isset($local_installed))
{
if (count($local_installed) == 1)
{
$this->data .= " " . $this->lng->txt("meta_l_" . $local_installed[0]) . " " . $this->lng->txt("local_language_file") . " " . strtolower($this->lng->txt("installed")) . ".";
}
else
{
foreach ($local_installed as $lang_key)
{
$langnames[] = $this->lng->txt("meta_l_" . $lang_key);
}
$this->data .= " " . implode(", ",$langnames) . " " . $this->lng->txt("local_language_files") . " " . strtolower($this->lng->txt("installed")) . ".";
}
}
else
{
$this->data .= " " . $this->lng->txt("local_languages_already_installed");
}
$this->out();
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::installObject ( )

install languages

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

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

{
$this->lng->loadLanguageModule("meta");
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
foreach ($_POST["id"] as $obj_id)
{
$langObj = new ilObjLanguage($obj_id);
$key = $langObj->install();
if ($key != "")
{
$lang_installed[] = $key;
}
unset($langObj);
}
if (isset($lang_installed))
{
if (count($lang_installed) == 1)
{
$this->data = $this->lng->txt("meta_l_" . $lang_installed[0]) . " " . strtolower($this->lng->txt("installed")) . ".";
}
else
{
foreach ($lang_installed as $lang_key)
{
$langnames[] = $this->lng->txt("meta_l_" . $lang_key);
}
$this->data = implode(", ",$langnames) . " " . strtolower($this->lng->txt("installed")) . ".";
}
}
else
{
$this->data = $this->lng->txt("languages_already_installed");
}
$this->out();
}

+ Here is the call graph for this function:

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().

{
ilUtil::sendInfo($this->data,true);
$this->ctrl->redirect($this, "view");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLanguageFolderGUI::refreshObject ( )

update all installed languages

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

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

{
$this->data = $this->lng->txt("languages_updated");
$this->out();
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::refreshSelectedObject ( )

update selected languages

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

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

{
global $lng;
$this->data = $this->lng->txt("selected_languages_updated");
$lng->loadLanguageModule("meta");
foreach ($_POST["id"] as $id)
{
$langObj = new ilObjLanguage($id, false);
if ($langObj->isInstalled() == true)
{
if ($langObj->check())
{
$langObj->flush('keep_local');
$langObj->insert();
$langObj->setTitle($langObj->getKey());
$langObj->setDescription($langObj->getStatus());
$langObj->update();
$langObj->optimizeData();
if ($langObj->isLocal() == true)
{
if ($langObj->check('local'))
{
$langObj->insert('local');
$langObj->setTitle($langObj->getKey());
$langObj->setDescription($langObj->getStatus());
$langObj->update();
$langObj->optimizeData();
}
}
}
$this->data .= "<br />". $lng->txt("meta_l_".$langObj->getKey());
}
unset($langObj);
}
$this->out();
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::setSystemLanguageObject ( )

set the system language

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

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

{
$this->lng->loadLanguageModule("meta");
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
if (count($_POST["id"]) != 1)
{
$this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
}
$obj_id = $_POST["id"][0];
$newSysLangObj = new ilObjLanguage($obj_id);
if ($newSysLangObj->isSystemLanguage())
{
$this->ilias->raiseError($this->lng->txt("meta_l_".$newSysLangObj->getKey())." is already the system language!<br>Action aborted!",$this->ilias->error_obj->MESSAGE);
}
if ($newSysLangObj->isInstalled() == false)
{
$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);
}
$this->ilias->setSetting("language", $newSysLangObj->getKey());
// update ini-file
$this->ilias->ini->setVariable("language","default",$newSysLangObj->getKey());
$this->ilias->ini->write();
$this->data = $this->lng->txt("system_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newSysLangObj->getKey()).".";
$this->out();
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::setUserLanguageObject ( )

set user language

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

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

{
$this->lng->loadLanguageModule("meta");
require_once './Services/User/classes/class.ilObjUser.php';
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
if (count($_POST["id"]) != 1)
{
$this->ilias->raiseError($this->lng->txt("choose_only_one_language")."<br/>".$this->lng->txt("action_aborted"),$this->ilias->error_obj->MESSAGE);
}
$obj_id = $_POST["id"][0];
$newUserLangObj = new ilObjLanguage($obj_id);
if ($newUserLangObj->isUserLanguage())
{
$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);
}
if ($newUserLangObj->isInstalled() == false)
{
$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);
}
$curUser = new ilObjUser($_SESSION["AccountId"]);
$curUser->setLanguage($newUserLangObj->getKey());
$curUser->update();
//$this->setUserLanguage($new_lang_key);
$this->data = $this->lng->txt("user_language")." ".$this->lng->txt("changed_to")." ".$this->lng->txt("meta_l_".$newUserLangObj->getKey()).".";
$this->out();
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::uninstallObject ( )

uninstall language

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

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

{
$this->lng->loadLanguageModule("meta");
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
// uninstall all selected languages
foreach ($_POST["id"] as $obj_id)
{
$langObj = new ilObjLanguage($obj_id);
if (!($sys_lang = $langObj->isSystemLanguage()))
if (!($usr_lang = $langObj->isUserLanguage()))
{
$key = $langObj->uninstall();
if ($key != "")
$lang_uninstalled[] = $key;
}
unset($langObj);
}
// generate output message
if (isset($lang_uninstalled))
{
if (count($lang_uninstalled) == 1)
{
$this->data = $this->lng->txt("meta_l_".$lang_uninstalled[0])." ".$this->lng->txt("uninstalled");
}
else
{
foreach ($lang_uninstalled as $lang_key)
{
$langnames[] = $this->lng->txt("meta_l_".$lang_key);
}
$this->data = implode(", ",$langnames)." ".$this->lng->txt("uninstalled");
}
}
elseif ($sys_lang)
{
$this->data = $this->lng->txt("cannot_uninstall_systemlanguage");
}
elseif ($usr_lang)
{
$this->data = $this->lng->txt("cannot_uninstall_language_in_use");
}
else
{
$this->data = $this->lng->txt("languages_already_uninstalled");
}
$this->out();
}

+ Here is the call graph for this function:

ilObjLanguageFolderGUI::viewObject ( )

show installed languages

public

Reimplemented from ilObjectGUI.

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

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

{
global $rbacsystem, $ilSetting, $tpl, $ilToolbar, $lng;
if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
// refresh
if ($ilSetting->get("lang_ext_maintenance") == "1")
{
$ilToolbar->addButton($lng->txt("refresh_languages"),
$this->ctrl->getLinkTarget($this, "confirmRefresh"));
}
else
{
$ilToolbar->addButton($lng->txt("refresh_languages"),
$this->ctrl->getLinkTarget($this, "refresh"));
}
// check languages
$ilToolbar->addButton($lng->txt("check_languages"),
$this->ctrl->getLinkTarget($this, "checkLanguage"));
// extended language maintenance
if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
{
if ($ilSetting->get("lang_ext_maintenance") == "1")
{
$ilToolbar->addButton($lng->txt("disable_ext_lang_maint"),
$this->ctrl->getLinkTarget($this, "disableExtendedLanguageMaintenance"));
}
else
{
$ilToolbar->addButton($lng->txt("enable_ext_lang_maint"),
$this->ctrl->getLinkTarget($this, "enableExtendedLanguageMaintenance"));
}
}
include_once("./Services/Language/classes/class.ilLanguageTableGUI.php");
$ltab = new ilLanguageTableGUI($this, "view", $this->object);
$tpl->setContent($ltab->getHTML());
}

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