Translate Controller
This controller performs translation actions
package | LimeSurvey |
---|---|
subpackage | Backend |
__construct( $controller = null, $id = null)
addPseudoParams(array $params): array
This is also used while rendering wrapped template SurveyCommonAction::renderWrappedTemplate()
Throws |
|
---|
array
Parameters to parse and populate
array
Populated parameters
ajaxtranslategoogleapi()
beforeSideMenuRender(array $aData): string
REFACTORED in LayoutHelper
array
string
calcNRows(string $subject): double
The function adds the number of line breaks
to the number of times a string wrap occurs.
string
The text string that is being translated
double
cleanup( $string, $options = array())
displayTranslateFields(string $iSurveyID,string $gid,string $qid,string $type,array $amTypeOptions,string $baselangdesc,string $tolangdesc,string $textfrom,string $textto,integer $i,string $rowfrom,boolean $evenRow): string
string
Survey id
string
Group id
string
Question id
string
Type of database field that is being translated, e.g. title, question, etc.
array
Array containing options associated with each $type
string
The source translation language, e.g. "English"
string
The target translation language, e.g. "German"
string
The text to be translated in source language
string
The text to be translated in target language
integer
Counter
string
Contains current row of database query
boolean
TRUE for even rows, FALSE for odd rows
string
$translateoutput
displayTranslateFieldsHeader(string $baselangdesc,string $tolangdesc,string $type): string
string
The source translation language, e.g. "English"
string
The target translation language, e.g. "German"
string
string
$translateoutput
displayUntranslatedFields( $iSurveyID, $tolang, $baselang,array<mixed,string> $tab_names, $baselangdesc, $tolangdesc)
array<mixed,string>
fetchExtraMenus(array $aData): \array<ExtraMenu>
array
\array
filterImportedResources(string $extractdir,string $destdir): array
deprecated | use ServiceClass FilterImportedResources instead ... (models/services/) |
---|
string
string
array
getLanguageList( $iSurveyID, $tolang)
index( $surveyid)
index(): void
listquestiongroups(array $aData)
listquestion groups
array
listquestions( $aData)
Throws |
|
---|
loadEditor( $htmleditor,array<mixed,string> $aData): mixed
array<mixed,string>
mixed
notifications()
nsurveysummary(array $aData)
Survey summary
array
query(string $type,string $action, $iSurveyID, $tolang, $baselang, $id1 = "", $id2 = "", $iScaleID = "", $new = "")
string
string
renderCentralContents(string $sAction,array|string $aViewUrls,array $aData = array()): string
string
array|string
array
string
renderInternal(string $_viewFile_, $_data_ = null, $_return_ = false)
inheritdoc | |
---|---|
string
renderJSON(array $aData, $success = true): void
REFACTORED in LSBaseController (this one called by a lot of actions in different controllers)
array
renderWrappedTemplate(string $sAction = '',array|string $aViewUrls = array(),array $aData = array(),string|boolean $sRenderFile = false)
Addition of parameters should be avoided if they can be added to $aData
NOTE FROM LOUIS : We want to remove this function, wich doesn't respect MVC pattern. The work it's doing should be handle by layout files, and subviews inside views. Eg : for route "admin/survey/sa/listquestiongroups/surveyid/282267" the Group controller should use a main layout (with admin menu bar as a widget), then render the list view, in wich the question group bar is called as a subview.
So for now, we try to evacuate all the renderWrappedTemplate logic (if statements, etc.) to subfunctions, then it will be easier to remove. Comments starting with //// indicate how it should work in the future
Throws |
|
---|
string
Current action, the folder to fetch views from
array|string
View url(s)
array
Data to be passed on. Optional.
string|boolean
File to be rendered as a layout. Optional.
requirePostRequest()
This is intended to be used on subactions. When possible (eg. when refactoring a SurveyCommonAction into an actual controller), use 'postOnly' filter instead.
Throws |
|
---|
route(string $sa,array<mixed,string> $get_vars): mixed
access | protected |
---|
string
array<mixed,string>
mixed
run()
runWithParams(array $params): boolean
array
URL Parameters
boolean
setupTranslateFields(string $type): array
string
Type of database field that is being translated, e.g. title, question, etc.
array
showHeaders(array $aData, $sendHTTPHeader = true)
array
surveyManagerBar(array $aData)
todo | Needs to be removed later. Duplication in LayoutHelper. |
---|---|
array
translateGoogleApi()
translateSave( $iSurveyID, $tolang, $baselang,array<mixed,string> $tab_names)
array<mixed,string>
updatenotification()
REFACTORED (in LayoutHelper.php)
userGroupBar(array $aData): void
REFACTORED (it's in UserGroupController and uses function from Layouthelper->renderMenuBar())
array