TopbarConfiguration
in package
Table of Contents
Properties
- $data : array<string|int, mixed>
- $extraDataMapping : array<string|int, mixed>
- $hide : bool
- $id : string
- $leftSideView : string
- $rightSideView : string
- $viewName : string
Methods
- __construct() : mixed
- Creates and instance of TopbarConfiguration based on the received $config array, which is expected to have the following keys (all keys are optional): 'name' => The name of the main view to use.
- createFromViewData() : TopbarConfiguration
- Creates and instance of TopbarConfiguration based on the data array used for the views
- getData() : mixed
- getGroupTopbarData() : array<string|int, mixed>
- Returns Data for Groups Top Bar
- getId() : mixed
- getLeftSideData() : mixed
- Get the data for the left side view
- getLeftSideView() : mixed
- getQuestionTopbarData() : array<string|int, mixed>
- Returns Data for QuestionEditor Top Bar
- getResponsesTopbarData() : array<string|int, mixed>
- Returns Data for Responses Top Bar
- getRightSideData() : mixed
- Get the data for the right side view
- getRightSideView() : mixed
- getRightSurveyTopbarData() : array<string|int, mixed>
- Returns Data for Right Side of Survey Top Bar
- getSurveyData() : mixed
- getSurveyTopbarData() : array<string|int, mixed>
- This Method is returning the Data for Survey Top Bar
- getTokensTopbarData() : array<string|int, mixed>
- Returns Data for Tokens Top Bar
- getViewData() : mixed
- Gets the data for the specified view by calling the corresponding method and merging with general view data
- getViewName() : mixed
- shouldHide() : mixed
- getSid() : mixed
- Tries to retrieve the survey ID from the config
- getSurveyLanguagesArray() : array<string|int, mixed>
- returns array of language codes by language name for all languages of the given survey
Properties
$data
private
array<string|int, mixed>
$data
= array()
Data to be passed to the view
$extraDataMapping
private
array<string|int, mixed>
$extraDataMapping
= ['surveyTopbar_view' => 'TopbarConfiguration::getSurveyTopbarData', 'responsesTopbarLeft_view' => 'TopbarConfiguration::getResponsesTopbarData', 'responseViewTopbarRight_view' => 'TopbarConfiguration::getResponsesTopbarData', 'surveyTopbarRight_view' => 'TopbarConfiguration::getRightSurveyTopbarData', 'tokensTopbarLeft_view' => 'TopbarConfiguration::getTokensTopbarData', 'tokensTopbarRight_view' => 'TopbarConfiguration::getTokensTopbarData', 'questionTopbar_view' => 'TopbarConfiguration::getQuestionTopbarData', 'questionTopbarLeft_view' => 'TopbarConfiguration::getQuestionTopbarData', 'questionTopbarRight_view' => 'TopbarConfiguration::getQuestionTopbarData', 'editQuestionTopbarLeft_view' => 'TopbarConfiguration::getQuestionTopbarData', 'listquestionsTopbarLeft_view' => 'TopbarConfiguration::getQuestionTopbarData', 'editGroupTopbarLeft_view' => 'TopbarConfiguration::getGroupTopbarData', 'groupTopbarLeft_view' => 'TopbarConfiguration::getGroupTopbarData', 'groupTopbarRight_view' => 'TopbarConfiguration::getGroupTopbarData', 'listquestiongroupsTopbarLeft_view' => 'TopbarConfiguration::getGroupTopbarData']
Maps views to the methods used to get their extra data
$hide
private
bool
$hide
= \false
Flag to hide the whole topbar
$id
private
string
$id
= ''
Topbar ID
$leftSideView
private
string
$leftSideView
= ''
Name of the view used to render the left side of the topbar
$rightSideView
private
string
$rightSideView
= ''
Name of the view used to render the right side of the topbar
$viewName
private
string
$viewName
= ''
Name of the topbar view
Methods
__construct()
Creates and instance of TopbarConfiguration based on the received $config array, which is expected to have the following keys (all keys are optional): 'name' => The name of the main view to use.
public
__construct([array<string|int, mixed> $config = [] ]) : mixed
'topbarId' => The topbar ID. Will normally be used as ID for container html element of the topbar. 'leftSideView' => The name of the view to use for the left side of the topbar. 'rightSideView' => The name of the view to use for the right side of the topbar. 'hide' => Boolean indicating if the topbar should be hidden (used to hide the controller's default topbar on some actions)
Parameters
- $config : array<string|int, mixed> = []
createFromViewData()
Creates and instance of TopbarConfiguration based on the data array used for the views
public
static createFromViewData(array<string|int, mixed> $aData) : TopbarConfiguration
Parameters
- $aData : array<string|int, mixed>
Return values
TopbarConfigurationgetData()
public
getData() : mixed
getGroupTopbarData()
Returns Data for Groups Top Bar
public
static getGroupTopbarData( $sid) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>getId()
public
getId() : mixed
getLeftSideData()
Get the data for the left side view
public
getLeftSideData() : mixed
getLeftSideView()
public
getLeftSideView() : mixed
getQuestionTopbarData()
Returns Data for QuestionEditor Top Bar
public
static getQuestionTopbarData( $sid) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>getResponsesTopbarData()
Returns Data for Responses Top Bar
public
static getResponsesTopbarData( $sid) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>getRightSideData()
Get the data for the right side view
public
getRightSideData() : mixed
getRightSideView()
public
getRightSideView() : mixed
getRightSurveyTopbarData()
Returns Data for Right Side of Survey Top Bar
public
static getRightSurveyTopbarData( $sid) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>getSurveyData()
public
getSurveyData() : mixed
getSurveyTopbarData()
This Method is returning the Data for Survey Top Bar
public
static getSurveyTopbarData(int $sid) : array<string|int, mixed>
Parameters
- $sid : int
-
Given Survey ID
Tags
Return values
array<string|int, mixed>getTokensTopbarData()
Returns Data for Tokens Top Bar
public
static getTokensTopbarData( $sid) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>getViewData()
Gets the data for the specified view by calling the corresponding method and merging with general view data
public
getViewData(mixed $view) : mixed
Parameters
- $view : mixed
getViewName()
public
getViewName() : mixed
shouldHide()
public
shouldHide() : mixed
getSid()
Tries to retrieve the survey ID from the config
protected
static getSid(mixed $config) : mixed
Parameters
- $config : mixed
getSurveyLanguagesArray()
returns array of language codes by language name for all languages of the given survey
private
static getSurveyLanguagesArray(Survey $survey) : array<string|int, mixed>
Parameters
- $survey : Survey