LimeSurvey API - Master branch

EditorRedirector
in package

Table of Contents

Properties

$routingMap  : mixed
Routing map

Methods

handleRedirect()  : mixed
Handler editor redirect
redirectToEditorRoute()  : mixed
Redirect to editor route
replaceVariables()  : string
Replace variables in a URI with their actual values

Properties

$routingMap

Routing map

private mixed $routingMap = ['surveyAdministration/view' => 'survey/$surveyId', 'surveyAdministration/rendersidemenulink/subaction/generalsettings/surveyid/' => 'survey/$surveyId/settings/generalsettings', 'questionAdministration/view' => 'survey/$surveyId/?question=$questionId', 'questionAdministration/edit' => 'survey/$surveyId/?question=$questionId', 'questionAdministration/create' => 'survey/$surveyId/structure', 'questionGroupsAdministration/add' => 'survey/$surveyId/structure', 'questionGroupsAdministration/view' => 'survey/$surveyId?group=$questionGroupId', 'questionGroupsAdministration/edit' => 'survey/$surveyId?group=$questionGroupId', 'admin/statistics/sa/simpleStatistics/surveyid/' => 'responses/$surveyId']

Map of CE URLs to editor routes

Editor routes can contain variable:

  • $surveyId

Methods

handleRedirect()

Handler editor redirect

public handleRedirect() : mixed

If editor is enabled and we are attemppting to access a page which has been moved to the new editor, redirect to the page in the new editor.

redirectToEditorRoute()

Redirect to editor route

private redirectToEditorRoute(string $route) : mixed
Parameters
$route : string

replaceVariables()

Replace variables in a URI with their actual values

private replaceVariables(string $uri) : string

Takes a URI string that may contain placeholders like $surveyId and replaces them with actual values retrieved from the request. This allows for dynamic route generation based on the current context.

Parameters
$uri : string

The URI string containing variables to be replaced

Return values
string

The URI with all recognized variables replaced with their values


        
On this page

Search results