ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjLanguageAccess Class Reference
+ Collaboration diagram for ilObjLanguageAccess:

Public Member Functions

 _checkTranslate ()
 Permission check for translations.
 _checkMaintenance ()
 Permission check for language maintenance (import/export)
 _lookupLangFolderRefId ()
 Lookup the ref_id of the global language folder.
 _lookupId ($a_key)
 Lookup the object ID for a language key.

Detailed Description

Definition at line 37 of file class.ilObjLanguageAccess.php.

Member Function Documentation

ilObjLanguageAccess::_checkMaintenance ( )

Permission check for language maintenance (import/export)

  • The extended language maintenance must be turned on
  • The user must have read and write permissions to the language folder

static

Returns
boolean maintenance possible (true/false)

Definition at line 77 of file class.ilObjLanguageAccess.php.

References $ilSetting, $ref_id, and _lookupLangFolderRefId().

Referenced by ilObjLanguageExtGUI\executeCommand().

{
global $ilSetting, $ilUser, $rbacsystem;
if (!$ilSetting->get("lang_ext_maintenance"))
{
return false;
}
if ($ilUser->getId())
{
return $rbacsystem->checkAccess("read,write", (int) $ref_id);
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLanguageAccess::_checkTranslate ( )

Permission check for translations.

This check is used for displaying the translation link on each page

  • The extended language maintenance must be turned on
  • The page translation of the current language must be turned on
  • The user must have read and write permissions to the language folder

static

Returns
boolean translation possible (true/false)

Definition at line 50 of file class.ilObjLanguageAccess.php.

References $ilSetting, $lng, $ref_id, and _lookupLangFolderRefId().

Referenced by ilTemplate\addILIASFooter().

{
global $lng, $ilSetting, $ilUser, $rbacsystem;
if (!$ilSetting->get("lang_ext_maintenance")
or !$ilSetting->get("lang_translate_".$lng->getLangKey()))
{
return false;
}
if ($ilUser->getId())
{
return $rbacsystem->checkAccess("read,write", (int) $ref_id);
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLanguageAccess::_lookupId (   $a_key)

Lookup the object ID for a language key.

static

Parameters
stringlanguage key
integerlanguage object id

Definition at line 120 of file class.ilObjLanguageAccess.php.

References $ilDB, and $row.

Referenced by ilObjLanguageExtGUI\ilObjLanguageExtGUI().

{
global $ilDB;
$q = "SELECT obj_id FROM object_data ".
" WHERE type = ".$ilDB->quote("lng", "text").
" AND title = ".$ilDB->quote($a_key, "text");
$set = $ilDB->query($q);
$row = $ilDB->fetchAssoc($set);
return $row['obj_id'];
}

+ Here is the caller graph for this function:

ilObjLanguageAccess::_lookupLangFolderRefId ( )

Lookup the ref_id of the global language folder.

static

Returns
int language folder ref_id

Definition at line 101 of file class.ilObjLanguageAccess.php.

References $ilDB, and $row.

Referenced by _checkMaintenance(), and _checkTranslate().

{
global $ilDB;
$q = "SELECT ref_id FROM object_reference r, object_data d".
" WHERE r.obj_id = d.obj_id AND d.type = ".$ilDB->quote("lngf", "text");
$set = $ilDB->query($q);
$row = $ilDB->fetchAssoc($set);
return $row['ref_id'];
}

+ Here is the caller graph for this function:


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