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

Static Public Member Functions

static _checkTranslate ()
 Permission check for translations.
static _checkMaintenance ()
 Permission check for language maintenance (import/export)
static _lookupLangFolderRefId ()
 Lookup the ref_id of the global language folder.
static _lookupId ($a_key)
 Lookup the object ID for a language key.
static _getTranslationLink ()
 Get the link to translate the current page.
static _isPageTranslation ()
 Check if the current request is a page translation.
static _saveUsages ()
 Store the collected usages in the user session.
static _getSavedModules ()
 Get the stored modules from the user session.
static _getSavedTopics ()
 Get the stored topics from the user session.

Detailed Description

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

Member Function Documentation

static ilObjLanguageAccess::_checkMaintenance ( )
static

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 57 of file class.ilObjLanguageAccess.php.

References $ilSetting, $ilUser, $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:

static ilObjLanguageAccess::_checkTranslate ( )
static

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 30 of file class.ilObjLanguageAccess.php.

References $ilSetting, $ilUser, $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:

static ilObjLanguageAccess::_getSavedModules ( )
static

Get the stored modules from the user session.

Returns
array list of module names

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

References $_SESSION.

Referenced by ilObjLanguageExtGUI\initAddNewEntryForm(), and ilObjLanguageExtGUI\viewObject().

{
$saved = $_SESSION['lang_ext_maintenance']['used_modules'];
return is_array($saved) ? $saved : array();
}

+ Here is the caller graph for this function:

static ilObjLanguageAccess::_getSavedTopics ( )
static

Get the stored topics from the user session.

Returns
array list of module names

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

References $_SESSION.

Referenced by ilObjLanguageExtGUI\initAddNewEntryForm(), and ilObjLanguageExtGUI\viewObject().

{
$saved = $_SESSION['lang_ext_maintenance']['used_topics'];
return is_array($saved) ? $saved : array();
}

+ Here is the caller graph for this function:

static ilObjLanguageAccess::_getTranslationLink ( )
static

Get the link to translate the current page.

Returns
string translation link

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

References _lookupLangFolderRefId().

Referenced by ilTemplate\addILIASFooter().

{
// ref id must be given to prevent params being deleted by ilAdministrtionGUI
return "ilias.php"
."&baseClass=ilAdministrationGUI"
."&cmdClass=ilobjlanguageextgui"
."&view_mode=translate"
."&reset_offset=true";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjLanguageAccess::_isPageTranslation ( )
static

Check if the current request is a page translation.

The page translation mode is used when the translation of a single page is called by the translation link on a page footer. On this screen only the topics stored from the calling page are shown for translation and only a save function for these topics is offered.

Returns
bool page translation (true or false)

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

References $_GET.

Referenced by ilLanguageExtTableGUI\__construct(), ilObjLanguageExtGUI\addAdminLocatorItems(), ilTemplate\addILIASFooter(), ilObjLanguageExtGUI\getAdminTabs(), ilLanguageExtTableGUI\initFilter(), ilObjLanguageExtGUI\setTitleAndDescription(), and ilObjLanguageExtGUI\viewObject().

{
return (strtolower($_GET['cmdClass'] == 'ilobjlanguageextgui') and $_GET['view_mode'] == "translate");
}

+ Here is the caller graph for this function:

static ilObjLanguageAccess::_lookupId (   $a_key)
static

Lookup the object ID for a language key.

Parameters
stringlanguage key
integerlanguage object id

Definition at line 98 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:

static ilObjLanguageAccess::_lookupLangFolderRefId ( )
static

Lookup the ref_id of the global language folder.

Returns
int language folder ref_id

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

References $ilDB, and $row.

Referenced by _checkMaintenance(), _checkTranslate(), and _getTranslationLink().

{
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:

static ilObjLanguageAccess::_saveUsages ( )
static

Store the collected usages in the user session.

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

References $_SESSION, and $lng.

Referenced by ilTemplate\get(), and ilTemplate\show().

{
global $lng;
$_SESSION['lang_ext_maintenance']['used_modules'] = array_keys($lng->getUsedModules());
$_SESSION['lang_ext_maintenance']['used_topics'] = array_keys($lng->getUsedTopics());
}

+ Here is the caller graph for this function:


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