tokens

Extends \Survey_Common_Action

Tokens Controller

This controller performs token actions

package

LimeSurvey

subpackage

Backend

Methods

__construct

__construct( $controller = null,  $id = null) 
inherited

Arguments

$controller

$id

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.

_addPseudoParams(array $params) : array
inherited

This is also used while rendering wrapped template Survey_Common_Action::_renderWrappedTemplate()

Throws
\CHttpException

Arguments

$params

array

Parameters to parse and populate

Response

array

Populated parameters

Browse Menu Bar

_browsemenubar(array $aData) 
inherited

Arguments

$aData

array

_filterImportedResources

_filterImportedResources(string $extractdir, string $destdir) : array
inherited

Arguments

$extractdir

string

$destdir

string

Response

array

_fullpagebar

_fullpagebar( $aData) 
inherited

Arguments

$aData

Handle token form for addnew/edit actions

_handletokenform(integer $iSurveyId, string $subaction, integer $iTokenId = "", boolean $ajax = false) : void

Arguments

$iSurveyId

integer

$subaction

string

$iTokenId

integer

$ajax

boolean

listquestion groups

_listquestiongroups(array $aData) 
inherited

Arguments

$aData

array

_listquestions

_listquestions( $aData) 
inherited

Arguments

$aData

Show dialogs and create a new tokens table

_newtokentable(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Display notifications

_notifications() 
inherited

Show admin menu for question group view

_nquestiongroupbar(array $aData) 
inherited

Arguments

$aData

array

?

Survey summary

_nsurveysummary(array $aData) 
inherited

Arguments

$aData

array

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

_organizequestionbar(array $aData) 
inherited
since 2014-09-30
author

Olle Haerstedt

Arguments

$aData

array

Shows admin menu for question

_questionbar(array $aData) 
inherited

Arguments

$aData

array

Renders template(s) wrapped in header and footer

_renderWrappedTemplate(string $sAction = '', array|string $aViewUrls = array(), array $aData = array(), string|boolean $sRenderFile = false) 
inherited

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

Arguments

$sAction

string

Current action, the folder to fetch views from

$aViewUrls

array|string

View url(s)

$aData

array

Data to be passed on. Optional.

$sRenderFile

string|boolean

File to be rendered as a layout. Optional.

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

_showadminmenu( $aData) : string
inherited
access

public

global

string $homedir

string $scriptname

string $surveyid

string $setfont

string $imageurl

int $surveyid

Arguments

$aData

Response

string

Header

_showHeaders(array $aData,  $sendHTTPHeader = true) 
inherited

Arguments

$aData

array

$sendHTTPHeader

Shows admin menu for surveys

_surveybar( $aData) 
inherited

Arguments

$aData

Show side menu for survey view

_surveysidemenu(array $aData) 
inherited

Arguments

$aData

array

all the needed data

Show survey summary

_surveysummary(array $aData) 
inherited

Arguments

$aData

array

Creates a temporary directory

_tempdir(string $dir, string $prefix = '', integer $mode = 448) : string
inherited
access

protected

Arguments

$dir

string

$prefix

string

$mode

integer

Response

string

_titlebar

_titlebar( $aData) 
inherited

Arguments

$aData

_tokenbar

_tokenbar( $aData) 
inherited

Arguments

$aData

Display the update notification

_updatenotification() 
inherited

Load menu bar of user group controller.

_userGroupBar(array $aData) : void
inherited

Arguments

$aData

array

Add dummy tokens form

addDummies(integer $iSurveyId, string $subaction = '') : void
Throws
\Exception

Arguments

$iSurveyId

integer

$subaction

string

Add new token form

addnew(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Returns content from event beforeSideMenuRender

beforeSideMenuRender(array $aData) : string
inherited

Arguments

$aData

array

Response

string

tokens::bounceprocessing()

bounceprocessing(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

bouncesettings

bouncesettings(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Browse Tokens

browse(integer $iSurveyId, integer $limit = 50, integer $start) : void

Arguments

$iSurveyId

integer

$limit

integer

$start

integer

Reminders that are send are stored in session, so that they are not send twice by accident in case of an unpredicted page reload.

clearEmailSessionCache(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Delete tokens

delete(integer $iSurveyID) : void

Arguments

$iSurveyID

integer

deleteMultiple

deleteMultiple() : boolean

Response

boolean

deleteToken

deleteToken() : boolean

Response

boolean

Delete token attributes

deletetokenattributes(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Edit Tokens

edit(integer $iSurveyId, integer $iTokenId, boolean $ajax = false) : false|null
todo

When is this function used without Ajax?

Arguments

$iSurveyId

integer

$iTokenId

integer

$ajax

boolean

Response

false|null

The fields with a value "lskeep" will not be updated

editMultiple() 

Called by if a token is saved after editing

editToken(integer $iSurveyId) : void
todo

Check if method is still in use

Arguments

$iSurveyId

integer

The Survey ID

Handle email action

email(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Export Dialog

exportdialog(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Get extra menus from plugins that are using event beforeAdminMenuRender

fetchExtraMenus(array $aData) : \array<ExtraMenu>
inherited

Arguments

$aData

array

Response

\array

getEmailCacheName

getEmailCacheName(integer $iSurveyId) : string

Arguments

$iSurveyId

integer

Response

string

Cache name, like survey_1234_email_cache

getSQLemailstatuscondition

getSQLemailstatuscondition() : string

Response

string

SQL condition

getSQLremindercountcondition

getSQLremindercountcondition() : string

Response

string

SQL condition

getSQLreminderdelaycondition

getSQLreminderdelaycondition(boolean $bEmail) : string

Arguments

$bEmail

boolean

Response

string

SQL condition

getSubAction

getSubAction() : string

Response

string

getTokenIds

getTokenIds() : array

Response

array

import from csv

import(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Performs a ldap import

importldap(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Show token index page, handle token database

index(integer $surveyid) : void

Arguments

$surveyid

integer

The survey ID

index

index() : void
inherited

Remove Token Database

kill(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Handle managetokenattributes action

managetokenattributes(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

prepExportToCPDB

prepExportToCPDB() 

Rendering the subviews and views of _renderWrappedTemplate

renderCentralContents(string $sAction, array|string $aViewUrls, array $aData = array()) : string
inherited

Arguments

$sAction

string

$aViewUrls

array|string

$aData

array

Response

string

renderInternal

renderInternal(string $_viewFile_,  $_data_ = null,  $_return_ = false) 
inherited
inheritdoc

Arguments

$_viewFile_

string

$_data_

$_return_

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

renderQuickmenu(array $aData) : string
inherited

Only show home-icon for now.

Add support for plugin to attach icon elements using event afterQuickMenuLoad

todo

Make quick-menu user configurable

Arguments

$aData

array

Response

string

Routes the action into correct subaction

route(string $sa, array<mixed,string> $get_vars) : mixed
inherited
access

protected

Arguments

$sa

string

$get_vars

array<mixed,string>

Response

mixed

Action classes require them to have a run method. We reroute it to index if called.

run() 
inherited

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

runWithParams(array $params) : boolean
inherited

Arguments

$params

array

URL Parameters

Response

boolean

This method echos HTML and ends.

showInviteOrReminderEmailForm( $iSurveyId,  $aSurveyLangs,  $aData) : void

Arguments

$iSurveyId

$aSurveyLangs

$aData

Generate tokens

tokenify(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Returns true if this $token is set in cache for $iSurveyId.

tokenIsSetInEmailCache(integer $iSurveyId,  $tid) 

Being set means the email has already been send.

Arguments

$iSurveyId

integer

$tid

updatetokenattributedescriptions action

updatetokenattributedescriptions(integer $iSurveyId) : void

Arguments

$iSurveyId

integer

Update token attributes

updatetokenattributes(integer $iSurveyId) : void

Arguments

$iSurveyId

integer