XarayaTranslationMemory  1.6
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
TranslationBackend Class Reference
Inheritance diagram for TranslationBackend:
WebBackend

Public Member Functions

 __construct ()
 
 InitLanguage ()
 
 FindStrings ()
 
 LocateString ($locate=LOCATE_CURR)
 
 FindProjectPath ()
 
 SaveString ()
 
 DeleteString ()
 
 DeleteProject ($projectID)
 
 LoadProjectStrings ()
 
 GetProject ()
 

Public Attributes

 $Event
 
 $txtFindText
 
 $ddlSearchType
 
 $ddlFindPercent
 
 $ddlLocaleID
 
 $xOldLocaleID
 
 $xStringID
 
 $xProjectID
 
 $xActiveRootID
 
 $xDelStringID
 
 $txtEditString
 
 $Translations
 
 $LocatedString
 
 $LocatedProjects
 
 $SiblingProjects
 
 $ChildProjects
 
 $CurrentStrings
 
 $RootProjects
 

Private Member Functions

 LocateStringNext ($missingOnly)
 

Private Attributes

 $String
 

Detailed Description

Base class for translation frontends, implementing the functions frontend events may call.

Programmers can inherit this class in frontend implementations, handle the frontend events there, upload user control values to this class' member variables and call event handler functions here.

Definition at line 42 of file TranslationBackend.php.

Constructor & Destructor Documentation

◆ __construct()

TranslationBackend::__construct ( )

Create a new TranslationBackend class for GUI operations.

Initializes the internal variables and GUI controls with default values. E.g. default match percentage is 60, default locale ID is 1.

Definition at line 80 of file TranslationBackend.php.

References TranslationProject\$LocaleIDCache, GetConfigVar(), GetDbConn(), TranslationProject\GetRoots(), GetTables(), and InitLanguage().

Member Function Documentation

◆ DeleteProject()

TranslationBackend::DeleteProject (   $projectID)

Delete one (dead and empty) project from the database.

Returns
int The deleted project's ID, so caller can continue displaying it.

Definition at line 394 of file TranslationBackend.php.

Referenced by WebBackend\Event_DeleteProject().

◆ DeleteString()

TranslationBackend::DeleteString ( )

Delete one (dead) string from the database.

Definition at line 381 of file TranslationBackend.php.

Referenced by WebBackend\Event_DeleteString().

◆ FindProjectPath()

TranslationBackend::FindProjectPath ( )

Find the path leading the the selected project (parent projects, child projects).

Parent projects are returned in an array, child projects are in a ProjectIterator.

INPUT: $xProjectID

OUTPUT: $LocatedProjects[] $SiblingProjects $ChildProjects

Definition at line 340 of file TranslationBackend.php.

References $xProjectID, and GetProject().

Referenced by InitLanguage(), WebBackend\SyncToProject(), and WebBackend\SyncToString().

◆ FindStrings()

TranslationBackend::FindStrings ( )

Find a similar strings in the database.

Finds the given sentence or similar sentences, where the difference is less than specified in the percentage parameter.

INPUT: $txtFindText $ddlLocaleID $ddlFindPercent

OUTPUT: $Translations

Definition at line 147 of file TranslationBackend.php.

Referenced by WebBackend\Event_DeleteProject(), WebBackend\Event_DeleteString(), WebBackend\Event_EditString(), WebBackend\Event_FindCustomString(), WebBackend\Event_SaveNavigate(), WebBackend\Event_SetProject(), and WebBackend\SyncToProject().

◆ GetProject()

TranslationBackend::GetProject ( )

Returns the project of the current string, same as LocatedProjects[0].

Definition at line 415 of file TranslationBackend.php.

Referenced by FindProjectPath().

◆ InitLanguage()

TranslationBackend::InitLanguage ( )

Init language change specific variables

Definition at line 116 of file TranslationBackend.php.

References $xActiveRootID, and FindProjectPath().

Referenced by __construct(), WebBackend\Event_SetLocale(), and WebBackend\EventHandler().

◆ LoadProjectStrings()

TranslationBackend::LoadProjectStrings ( )

Load all strings belonging to a project

Definition at line 406 of file TranslationBackend.php.

Referenced by WebBackend\SyncToProject(), and WebBackend\SyncToString().

◆ LocateString()

TranslationBackend::LocateString (   $locate = LOCATE_CURR)

Get one string by ID.

The $hdnStringID must be set to the string which you are looking for. Output will be placed in $LocatedString (a TranslationString object).

INPUT: $xStringID

OUTPUT: $LocatedString

Definition at line 181 of file TranslationBackend.php.

References LOCATE_CURR, LOCATE_NEXT, LOCATE_NEXTMISSING, and LocateStringNext().

Referenced by WebBackend\Event_SaveNavigate(), WebBackend\SyncToProject(), and WebBackend\SyncToString().

◆ LocateStringNext()

TranslationBackend::LocateStringNext (   $missingOnly)
private

Find the next string after the current one, even across project tree branches.

Definition at line 201 of file TranslationBackend.php.

References $ddlLocaleID, $xProjectID, and StringIterator\current().

Referenced by LocateString().

◆ SaveString()

TranslationBackend::SaveString ( )

Save the currently edited string.

Updates the edited string in the database.

INPUT: $xStringID, $txtEditString

Definition at line 369 of file TranslationBackend.php.

Referenced by WebBackend\Event_SaveNavigate().

Member Data Documentation

◆ $ChildProjects

TranslationBackend::$ChildProjects

ProjectIterator: child projects for the current location

Definition at line 65 of file TranslationBackend.php.

◆ $CurrentStrings

TranslationBackend::$CurrentStrings

List of strings in the selected project.

Definition at line 66 of file TranslationBackend.php.

◆ $ddlFindPercent

TranslationBackend::$ddlFindPercent

DropDownList: the sentence search function's match percent limit

Definition at line 50 of file TranslationBackend.php.

◆ $ddlLocaleID

TranslationBackend::$ddlLocaleID

DropDownList: the ID of the new locale in 'setlocale' event, otherwise overwritten from $xOldLocaleID

Definition at line 51 of file TranslationBackend.php.

Referenced by LocateStringNext().

◆ $ddlSearchType

TranslationBackend::$ddlSearchType

DropDownList: Search type, word index, original or translation string parts

Definition at line 49 of file TranslationBackend.php.

◆ $Event

TranslationBackend::$Event

Variable to store the currently processed event's name.

Definition at line 44 of file TranslationBackend.php.

◆ $LocatedProjects

TranslationBackend::$LocatedProjects

Array of TranslationProjects, project path for one string, [0]= current, last=root project.

Definition at line 63 of file TranslationBackend.php.

◆ $LocatedString

TranslationBackend::$LocatedString

TranslationString: one string for string details pages

Definition at line 62 of file TranslationBackend.php.

◆ $RootProjects

TranslationBackend::$RootProjects

Hashtable of all root projects of the active language (key: projectID, value: TranslationProject)

Definition at line 67 of file TranslationBackend.php.

◆ $SiblingProjects

TranslationBackend::$SiblingProjects

ProjectIterator: sibling projects for the current location (including that too)

Definition at line 64 of file TranslationBackend.php.

◆ $String

TranslationBackend::$String
private

TranslationString to do searches

Definition at line 71 of file TranslationBackend.php.

◆ $Translations

TranslationBackend::$Translations

Array of TranslationStrings: Search results

Definition at line 61 of file TranslationBackend.php.

◆ $txtEditString

TranslationBackend::$txtEditString

String editor when edting a translation

Definition at line 57 of file TranslationBackend.php.

◆ $txtFindText

TranslationBackend::$txtFindText

TextBox: the text input for custom sentence search

Definition at line 48 of file TranslationBackend.php.

◆ $xActiveRootID

TranslationBackend::$xActiveRootID

Root project ID which is selected to work on

Definition at line 55 of file TranslationBackend.php.

Referenced by WebBackend\Event_ExportPack(), and InitLanguage().

◆ $xDelStringID

TranslationBackend::$xDelStringID

The string clicked for deleting.

Definition at line 56 of file TranslationBackend.php.

◆ $xOldLocaleID

TranslationBackend::$xOldLocaleID

Previously selected locale ID, kept unless 'setlocale' event occurs.

Definition at line 52 of file TranslationBackend.php.

Referenced by WebBackend\Event_SetLocale().

◆ $xProjectID

TranslationBackend::$xProjectID

The currently displayed project.

Definition at line 54 of file TranslationBackend.php.

Referenced by FindProjectPath(), and LocateStringNext().

◆ $xStringID

TranslationBackend::$xStringID

One selected string's ID for e.g. string details pages

Definition at line 53 of file TranslationBackend.php.


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