This class is responsible for quick translation and all DB actions needed.
todo | All the swithc-statements could be remade using OOP instead. |
---|---|
SuppressWarnings | (PHPMD.ExcessiveClassComplexity) |
package | Default |
__construct(\Survey $survey)
getAllTranslateFields(): array
array
getAnswerTranslations( $baselang)
getQuestionTranslations( $baselang)
getSubquestionTranslations( $baselang)
getTabNames(): array<mixed,string>
array<mixed,string>
getTranslations( $type, $baselang): array|\CActiveRecord|mixed|array<mixed,\Question>|array<mixed,\SurveyLanguageSetting>|void|null
Different types need different query.
array|\CActiveRecord|mixed|array<mixed,\Question>|array<mixed,\SurveyLanguageSetting>|void|null
setupTranslateFields(string $type): array
This array structure is the base for the whole algorithm. Each returned array consists of the following information
type --> this seems to be the db table in types (e.g. 1 --> surveys_languagesettings etc.) dbColumn --> the name of the db column where to find the id1 --> id2 --> gid --> qid --> description --> the tab title HTMLeditorType --> parameter for CKEditor HTMLeditorDisplay --> inline, modal for CKEditor to load it associated --> the associated field for the current one. If empty string this one has no associated field
string
Type of database field that is being translated, e.g. title, question, etc.
array
updateTranslations( $fieldName, $tolang, $new, $qidOrgid, $answerCode = '', $iScaleID = ''): integer|null
string the field name from frontend
string shortcut for language (e.g. 'de')
string the new value to save as translation
int groupid or questionid
string the answer code
integer|null
translateFields :