Public Member Functions

ilObjLanguageAccess Class Reference

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 global language folder must have 'visible' and 'read' permissions

static

Returns:
boolean maintenance possible (true/false)

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

References $ref_id, and _lookupLangFolderRefId().

Referenced by ilObjLanguageExtGUI::getAdminTabs(), ilObjLanguageExtGUI::maintainObject(), ilObjLanguageExtGUI::settingsObject(), and ilObjLanguageExtGUI::uploadObject().

        {
                global $ilUser, $rbacsystem;

                if (!$ilUser->getId())
                {
                        return false;
                }
                else
                {
                        $ref_id = ilObjLanguageAccess::_lookupLangFolderRefId();
                        return $rbacsystem->checkAccess("read,visible", (int) $ref_id);
                }
        }

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 global language folder must have 'visible' and 'read' permissions

static

Returns:
boolean translation possible (true/false)

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

References $ref_id, and _lookupLangFolderRefId().

Referenced by ilTemplate::addILIASFooter(), ilObjLanguageExtGUI::executeCommand(), and ilObjLanguageExtGUI::saveObject().

        {
                global $ilUser, $rbacsystem;

                if ($ilUser->getId())
                {
                        $ref_id = ilObjLanguageAccess::_lookupLangFolderRefId();
                        return $rbacsystem->checkAccess("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:
string language key
integer language object id

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

Referenced by ilObjLanguageExtGUI::ilObjLanguageExtGUI().

        {
                global $ilDB;

                $q = "SELECT obj_id FROM object_data ".
                " WHERE type = 'lng' ".
                " AND title = ".$ilDB->quote($a_key);
                $set = $ilDB->query($q);
                $row = $set->fetchRow(DB_FETCHMODE_ASSOC);
                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 91 of file class.ilObjLanguageAccess.php.

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='lngf'";
                $set = $ilDB->query($q);
                $row = $set->fetchRow(DB_FETCHMODE_ASSOC);
                return $row['ref_id'];
        }

Here is the caller graph for this function:


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