LimeSurvey API - Master branch

Labels extends SurveyCommonAction
in package

labels

Tags
author
copyright

2011

access

public

Table of Contents

Methods

__construct()  : mixed
ajaxSave()  : void
Save label set via Ajax Used in question editor Echoes JSON
ajaxUpdate()  : void
Ajax Update
delete()  : void
Delete a label set
exportmulti()  : void
Multi label export
getAllSets()  : void
Get all label sets
getLabelRowForAllLanguages()  : mixed
Outputs json with the html for a new label row, for each language.
getLabelSetsForQuestion()  : void
Get Label Sets for Question
getRestrictedSets()  : void
Get all label sets with permission to update
import()  : void
Function to import a label set
importlabelresources()  : void
Function responsible to import label resources from a '.zip' file.
index()  : void
index()  : void
Function to load new/edit labelset screen.
newLabelSetFromQuestionEditor()  : void
New label set from question editor
process()  : void
Process labels form data depending on $action.
questionbar()  : mixed
Shows admin menu for question
renderInternal()  : mixed
run()  : void
routes to the correct subdir
runWithParams()  : bool
Override runWithParams() implementation in CAction to help us parse requests with subactions.
saveNewLabelSet()  : void
Save new label set
surveybar()  : mixed
Shows admin menu for surveys
view()  : void
Function to view a labelset.
beforeSideMenuRender()  : string
Returns content from event beforeSideMenuRender
fetchExtraMenus()  : array<string|int, ExtraMenu>
Get extra menus from plugins that are using event beforeAdminMenuRender
filterImportedResources()  : array<string|int, mixed>
listquestiongroups()  : mixed
REFACTORED in LayoutHelper
listquestions()  : mixed
REFACTORED in LayoutHelper
notifications()  : mixed
Display notifications
nsurveysummary()  : mixed
REFACTORED in LayoutHelper
organizequestionbar()  : mixed
Render the save/cancel bar for Organize question groups/questions
renderCentralContents()  : string
Rendering the subviews and views of renderWrappedTemplate
renderJSON()  : void
Method to render an array as a json document
renderQuickmenu()  : string
Render the quick-menu that is shown when side-menu is hidden.
renderWrappedTemplate()  : void
Renders template(s) wrapped in header and footer
requirePostRequest()  : mixed
Validates that the request method is POST.
route()  : mixed
Routes the action into correct subaction
showadminmenu()  : string
showadminmenu() function returns html text for the administration button bar
showHeaders()  : mixed
Header
surveysidemenu()  : mixed
Show side menu for survey view
titlebar()  : mixed
REFACTORED in LayoutHelper.php
updatenotification()  : mixed
Display the update notification
addPseudoParams()  : array<string|int, mixed>
Some functions have different parameters, which are just an alias of the usual parameters we're getting in the url. This function just populates those variables so that we don't end up in an error.
getLabelI10NObject()  : LabelL10n
Get Label I10N Object
getLabelObject()  : Label
Get Label Object
getLabelRow()  : string
Returns the html for a label row.
saveLabelSetAux()  : void
Helper function to save label set from question editor.
validateLabelSetId()  : int
Sanitize existence and permission of LabelSet->pk, throw exception if there are an issue.

Methods

__construct()

public __construct([mixed $controller = null ][, mixed $id = null ]) : mixed
Parameters
$controller : mixed = null
$id : mixed = null

ajaxSave()

Save label set via Ajax Used in question editor Echoes JSON

public ajaxSave() : void
Tags
todo

Move save logic into service class.

ajaxUpdate()

Ajax Update

public ajaxUpdate() : void

delete()

Delete a label set

public delete() : void

exportmulti()

Multi label export

public exportmulti() : void

getAllSets()

Get all label sets

public getAllSets() : void

getLabelRowForAllLanguages()

Outputs json with the html for a new label row, for each language.

public getLabelRowForAllLanguages(int $lid, string $newId, string $code[, int $assessmentValue = 0 ][, string $title = '' ]) : mixed

Eg: {"en":"...", "es":"..."} Called by ajax from the label set editor.

Parameters
$lid : int
$newId : string
$code : string
$assessmentValue : int = 0
$title : string = ''

getLabelSetsForQuestion()

Get Label Sets for Question

public getLabelSetsForQuestion() : void

getRestrictedSets()

Get all label sets with permission to update

public getRestrictedSets() : void

import()

Function to import a label set

public import() : void

importlabelresources()

Function responsible to import label resources from a '.zip' file.

public importlabelresources() : void

index()

Function to load new/edit labelset screen.

public index(string $sa[, int $lid = 0 ]) : void
Parameters
$sa : string
$lid : int = 0

newLabelSetFromQuestionEditor()

New label set from question editor

public newLabelSetFromQuestionEditor() : void
Tags
deprecated

: not used in 6.0 and before

process()

Process labels form data depending on $action.

public process() : void

questionbar()

Shows admin menu for question

public questionbar(array<string|int, mixed> $aData) : mixed
Parameters
$aData : array<string|int, mixed>
Tags
deprecated

not in use anymore

renderInternal()

public renderInternal(string $_viewFile_[, mixed $_data_ = null ][, mixed $_return_ = false ]) : mixed
Parameters
$_viewFile_ : string
$_data_ : mixed = null
$_return_ : mixed = false
Tags
inheritdoc

run()

routes to the correct subdir

public run([string $sa = null ]) : void
Parameters
$sa : string = null

runWithParams()

Override runWithParams() implementation in CAction to help us parse requests with subactions.

public runWithParams(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

URL Parameters

Return values
bool

saveNewLabelSet()

Save new label set

public saveNewLabelSet() : void
Tags
todo

: check if it's currently used.

surveybar()

Shows admin menu for surveys

public surveybar(array<string|int, mixed> $aData) : mixed
Parameters
$aData : array<string|int, mixed>
Tags
deprecated

view()

Function to view a labelset.

public view([int $lid = 0 ]) : void
Parameters
$lid : int = 0

beforeSideMenuRender()

Returns content from event beforeSideMenuRender

protected beforeSideMenuRender(array<string|int, mixed> $aData) : string

REFACTORED in LayoutHelper

Parameters
$aData : array<string|int, mixed>
Return values
string

fetchExtraMenus()

Get extra menus from plugins that are using event beforeAdminMenuRender

protected fetchExtraMenus(array<string|int, mixed> $aData) : array<string|int, ExtraMenu>
Parameters
$aData : array<string|int, mixed>
Return values
array<string|int, ExtraMenu>

filterImportedResources()

protected filterImportedResources(string $extractdir, string $destdir) : array<string|int, mixed>
Parameters
$extractdir : string
$destdir : string
Tags
deprecated

use ServiceClass FilterImportedResources instead ... (models/services/)

Return values
array<string|int, mixed>

listquestiongroups()

REFACTORED in LayoutHelper

protected listquestiongroups(array<string|int, mixed> $aData) : mixed

listquestion groups

Parameters
$aData : array<string|int, mixed>

listquestions()

REFACTORED in LayoutHelper

protected listquestions( $aData) : mixed
Parameters
$aData :
Tags
throws
CException

notifications()

Display notifications

protected notifications() : mixed
  • REFACTORED (in LayoutHelper.php)

nsurveysummary()

REFACTORED in LayoutHelper

protected nsurveysummary(array<string|int, mixed> $aData) : mixed

Survey summary

Parameters
$aData : array<string|int, mixed>

organizequestionbar()

Render the save/cancel bar for Organize question groups/questions

protected organizequestionbar(array<string|int, mixed> $aData) : mixed

REFACTORED in LayoutHelper

Parameters
$aData : array<string|int, mixed>
Tags
since
2014-09-30
author

LimeSurvey GmbH

renderCentralContents()

Rendering the subviews and views of renderWrappedTemplate

protected renderCentralContents(string $sAction, array<string|int, mixed>|string $aViewUrls[, array<string|int, mixed> $aData = [] ]) : string
Parameters
$sAction : string
$aViewUrls : array<string|int, mixed>|string
$aData : array<string|int, mixed> = []
Return values
string

renderJSON()

Method to render an array as a json document

protected renderJSON(array<string|int, mixed> $aData[, mixed $success = true ]) : void

REFACTORED in LSBaseController (this one called by a lot of actions in different controllers)

Parameters
$aData : array<string|int, mixed>
$success : mixed = true

renderQuickmenu()

Render the quick-menu that is shown when side-menu is hidden.

protected renderQuickmenu(array<string|int, mixed> $aData) : string

REFACTORED in LayoutHelper

Only show home-icon for now.

Add support for plugin to attach icon elements using event afterQuickMenuLoad

Parameters
$aData : array<string|int, mixed>
Tags
todo

Make quick-menu user configurable

Return values
string

renderWrappedTemplate()

Renders template(s) wrapped in header and footer

protected renderWrappedTemplate([string $sAction = 'labels' ][, string|array<string|int, mixed> $aViewUrls = array() ][, array<string|int, mixed> $aData = array() ][, mixed $sRenderFile = false ]) : void
Parameters
$sAction : string = 'labels'

Current action, the folder to fetch views from

$aViewUrls : string|array<string|int, mixed> = array()

View url(s)

$aData : array<string|int, mixed> = array()

Data to be passed on. Optional.

$sRenderFile : mixed = false

File to be rendered as a layout. Optional.

Tags
parm

bool $sRenderFile

requirePostRequest()

Validates that the request method is POST.

protected requirePostRequest() : mixed

This is intended to be used on subactions. When possible (eg. when refactoring a SurveyCommonAction into an actual controller), use 'postOnly' filter instead.

Tags
throws
CHttpException

with 405 status if the request method is not POST.

route()

Routes the action into correct subaction

protected route(string $sa, array<string|int, string> $get_vars) : mixed
Parameters
$sa : string
$get_vars : array<string|int, string>
Tags
access

protected

showadminmenu()

showadminmenu() function returns html text for the administration button bar

protected showadminmenu( $aData) : string

REFACTORED (in LayoutHelper.php)

Parameters
$aData :
Tags
access

public

global

string $homedir

global

string $scriptname

global

string $surveyid

global

string $setfont

global

string $imageurl

global

int $surveyid

Return values
string

showHeaders()

Header

protected showHeaders(array<string|int, mixed> $aData[, mixed $sendHTTPHeader = true ]) : mixed
  • REFACTORED (in LayoutHelper.php)
Parameters
$aData : array<string|int, mixed>
$sendHTTPHeader : mixed = true

surveysidemenu()

Show side menu for survey view

protected surveysidemenu(array<string|int, mixed> $aData) : mixed

REFACTORED in LayoutHelper.php

Parameters
$aData : array<string|int, mixed>

all the needed data

titlebar()

REFACTORED in LayoutHelper.php

protected titlebar( $aData) : mixed
Parameters
$aData :
Tags
throws
CException

updatenotification()

Display the update notification

protected updatenotification() : mixed

REFACTORED (in LayoutHelper.php)

Tags
throws
CException

addPseudoParams()

Some functions have different parameters, which are just an alias of the usual parameters we're getting in the url. This function just populates those variables so that we don't end up in an error.

private addPseudoParams(array<string|int, mixed> $params) : array<string|int, mixed>

This is also used while rendering wrapped template

Parameters
$params : array<string|int, mixed>

Parameters to parse and populate

Tags
throws
CHttpException
Return values
array<string|int, mixed>

Populated parameters

getLabelI10NObject()

Get Label I10N Object

private getLabelI10NObject(int $labelId, string $language) : LabelL10n
Parameters
$labelId : int

Label ID

$language : string

Language Code

Tags
todo

Not used?

Return values
LabelL10n

getLabelObject()

Get Label Object

private getLabelObject(int $labelId) : Label
Parameters
$labelId : int

Label ID

Tags
todo

Not used?

Return values
Label

getLabelRow()

Returns the html for a label row.

private getLabelRow(string $language, bool $first, string $newId, string $code, int $assessmentValue, string $title) : string

Used when user clicks "Add" in label set editor.

Parameters
$language : string
$first : bool

Indicates whether the row belongs to the first language or not.

$newId : string
$code : string
$assessmentValue : int
$title : string
Return values
string

The html of the row

saveLabelSetAux()

Helper function to save label set from question editor.

private saveLabelSetAux(int $lid, array<string|int, mixed> $codes, array<string|int, mixed> $answers, array<string|int, mixed> $assessmentValues) : void
Parameters
$lid : int

Label set id

$codes : array<string|int, mixed>
$answers : array<string|int, mixed>
$assessmentValues : array<string|int, mixed>
Tags
throws
Exception

validateLabelSetId()

Sanitize existence and permission of LabelSet->pk, throw exception if there are an issue.

private validateLabelSetId( $lid[, mixed $permission = 'read' ]) : int
Parameters
$lid :

mixed, sanitized to intreger

$permission : mixed = 'read'
Tags
throws
CHttpException
Return values
int

: the label id


        
On this page

Search results