Condition Controller
This controller performs token 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
applySubaction(string $p_subaction,array $args): void
string
array
beforeSideMenuRender(array $aData): string
REFACTORED in LayoutHelper
array
string
copyConditions(array $args): void
Throws |
|
---|
array
createNavigatorUrl(integer $gid,integer $qid): string
integer
Group id
integer
Questino id
string
url
fetchExtraMenus(array $aData): \array<ExtraMenu>
array
\array
filterImportedResources(string $extractdir,string $destdir): array
deprecated | use ServiceClass FilterImportedResources instead ... (models/services/) |
---|
string
string
array
getAllScenarios(integer $qid): array<mixed,\CActiveRecord>
integer
array<mixed,\CActiveRecord>
Conditions
getAttributeName(array<mixed,string> $extractedTokenAttr): string
array<mixed,string>
string
getCAnswersAndCQuestions(array $theserows): array
Throws |
|
---|
array
array
(cquestion, canswers)
getCopyForm(integer $qid,integer $gid,array $conditionsList,array $pquestions): string
Throws |
|
---|
integer
integer
array
array
string
html
getEDITConditionConst(string $subaction): string
string
string
getEditConditionForm(array $args): string
Throws |
|
---|
array
string
getEDITConditionRegexp(string $subaction): string
string
string
getEditFormJavascript(string $subaction): string
string
string
JS
getEditSourceTab(): string
string
Either '#SRCTOKENATTRS' or '#SRCPREVQUEST'; defaults to '#SRCPREVQUEST' if nothing is posted
getEditTargetTab(): string
string
Predfined, constant, questions, token field or regexp; defaults to predefined
getHiddenFields(array $rows,string $leftOperandType,string $rightOperandType): string
array
string
string
string
html
getJavascriptForMatching(array $canswers,array $cquestions,boolean $surveyIsAnonymized): string
array
array
boolean
string
js
getJsAnswersToSelect(array $cquestions,string $p_cquestions,array $p_canswers): string
array
string
Question SGID
array
E.g. array('A2')
string
JS code
getMethod(): array
array
getPostQuestionList(integer $qid,array $qrows): array
integer
array
array
getPostRows(array $postquestionlist): array
array
array
getQCount(array $cquestions): integer
todo | Not used |
---|
array
integer
getQuestionList(integer $qid,array $qrows): array
integer
array
array
getQuestionNavOptions(array $theserows,array $postrows,array $args): string
Throws |
|
---|
array
array
array
string
html
getQuestionRows(): array
array
getQuestionTitleAndText(integer $qid): array
integer
array
(title, question text)
getQuickAddConditionForm(array $args): string|array<mixed,string>|null
Throws |
|
---|
array
string|array<mixed,string>|null
getQuickAddData(\LSHttpRequest $request): array
getSurveyIsAnonymized(): boolean
boolean
True if anonymized == 'Y' for this survey
getTheseRows(array $questionlist): array
array
array
index(): void
index(string $subaction,integer $iSurveyID = null,integer $gid = null,integer $qid = null): void
Throws |
|
---|
string
Given Subaction
integer
Given Survey ID
integer
Given Group ID
integer
Given Question ID
insertCondition(array $args): void
todo | Better way than to extract $args |
---|
array
insertConditionAjax( $args): array
todo | Code duplication |
---|---|
array
[message, result], where result = 'success' or 'error'
listquestiongroups(array $aData)
listquestion groups
array
listquestions( $aData)
Throws |
|
---|
notifications()
nsurveysummary(array $aData)
Survey summary
array
quickAddCondition(): void
Throws |
|
---|
redirectToConditionStart(integer $qid,integer $gid): void
integer
integer
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, which 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 which 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.
renumberScenarios(array $args): void
Throws |
|
---|
array
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 |
|
---|
resetSurveyLogic( $iSurveyID): void
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
shouldShowScenario(string $subaction,integer $scenariocount): boolean
string
integer
boolean
showHeaders(array $aData, $sendHTTPHeader = true)
array
surveyManagerBar(array $aData)
todo | Needs to be removed later. Duplication in LayoutHelper. |
---|---|
array
updateCondition(array $args): void
array
updatenotification()
REFACTORED (in LayoutHelper.php)
userGroupBar(array $aData): void
REFACTORED (it's in UserGroupController and uses function from Layouthelper->renderMenuBar())
array
stringComparisonOperators :array
var |
---|
array
nonStringComparisonOperators :array
var |
---|
array
iSurveyID :integer
var |
---|
integer
language :string
var |
---|
string
tokenTableExists :boolean
var |
---|
boolean
tokenFieldsAndNames :array
var |
---|
array