Properties

$components

$components : array

Required components

Type

array

$models

$models : array

Required models

Type

array

$seminary

$seminary : 

Current Seminary

var array

Type

$character

$character : array

Character of current user and Seminary

Type

array

$user

$user : array

Current user

Type

array

$permissions

$permissions : array

User permissions

Type

array

$seminaryPermissions

$seminaryPermissions : array

User seminary permissions

Type

array

$view

$view : \nre\core\View

View of the Controller

Type

\nre\core\View

$viewData

$viewData : array

Data to pass to the View

Type

array

$title

$title : array

Title information

Type

array

Methods

preFilter()

preFilter(\nre\core\Request  $request, \nre\core\Response  $response) 

Prefilter.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

postFilter()

postFilter(\nre\core\Request  $request, \nre\core\Response  $response) 

Prefilter that is executed after running the Controller.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

getTitle()

getTitle() : string

Return current title information.

Returns

string —

Title information

load()

load(string  $controllerName) 

Load the class of a Controller.

Parameters

string $controllerName

Name of the Controller to load

Throws

\nre\exceptions\ControllerNotFoundException
\nre\exceptions\ControllerNotValidException

factory()

factory(string  $controllerName, string  $layoutName, string  $action, string  $agent) 

Instantiate a Controller (Factory Pattern).

Parameters

string $controllerName

Name of the Controller to instantiate

string $layoutName

Name of the current Layout

string $action

Current Action

string $agent

Corresponding Agent

Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException
\nre\exceptions\ViewNotFoundException

run()

run(\nre\core\Request  $request, \nre\core\Response  $response) 

Run the Controller.

This method executes the Action of the Controller defined by the current Request.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

Throws

\nre\exceptions\ParamsNotValidException
\nre\exceptions\IdNotFoundException
\nre\exceptions\DatamodelException
\nre\exceptions\ActionNotFoundException

render()

render(array  $viewData = null) : string

Generate the output.

Parameters

array $viewData

Data to pass to the View

Returns

string —

Generated output

index()

index(string  $mediaUrl, string  $action = null) 

Action: index

Display a medium.

Parameters

string $mediaUrl

URL-name of the medium

string $action

Action for processing the media

seminarymoodpic()

seminarymoodpic(string  $seminaryUrl, string  $category = null, string  $action = null) 

Action: seminarymoodpic

Display the moodpic for a category of a Seminary.

Parameters

string $seminaryUrl

URL-title of the Seminary

string $category

Category to show moodpic of

string $action

Action for processing the media

Throws

\nre\exceptions\IdNotFoundException

seminary()

seminary(string  $seminaryUrl, string  $mediaUrl, string  $action = null) 

Action: seminary.

Display a Seminary medium.

Parameters

string $seminaryUrl

URL-title of the Seminary

string $mediaUrl

URL-name of the medium

string $action

Action for processing the media

Throws

\nre\exceptions\IdNotFoundException

avatar()

avatar(string  $seminaryUrl, string  $charactertypeUrl, integer  $xplevel, string  $action = 'avatar') 

Action: avatar.

Display an Avatar as full size or portrait.

Parameters

string $seminaryUrl

URL-title of the Seminary

string $charactertypeUrl

URL-title of Character type

integer $xplevel

XP-level

string $action

Size to show (avatar or portrait)

Throws

\nre\exceptions\ParamsNotValidException
\nre\exceptions\IdNotFoundException

achievement()

achievement(string  $seminaryUrl, string  $achievementUrl,   $locked = null) 

Action: achievement

Display the achievement of a Seminary.

Parameters

string $seminaryUrl

URL-title of the Seminary

string $achievementUrl

URL-title of the Achievement

$locked

Throws

\nre\exceptions\IdNotFoundException

charactergroup()

charactergroup(string  $seminaryUrl, string  $groupsgroupUrl, string  $groupUrl) 

Action: charactergroup

Display the icon for a Character group of a Seminary.

Parameters

string $seminaryUrl

URL-Title of a Seminary

string $groupsgroupUrl

URL-Title of a Character groups-group

string $groupUrl

URL-Title of a Character group

Throws

\nre\exceptions\IdNotFoundException

charactergroupsquest()

charactergroupsquest(string  $seminaryUrl, string  $groupsgroupUrl, string  $questUrl) 

Action: charactergroupsquest

Display the icon for a Character groups Quest of a Seminary.

Parameters

string $seminaryUrl

URL-Title of a Seminary

string $groupsgroupUrl

URL-Title of a Character groups-group

string $questUrl

URL-Title of a Character groups Quest

Throws

\nre\exceptions\IdNotFoundException

__construct()

__construct(string  $layoutName, string  $action, \nre\core\Agent  $agent) 

Construct a new Controller.

Parameters

string $layoutName

Name of the current Layout

string $action

Current Action

\nre\core\Agent $agent

Corresponding Agent

Throws

\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException
\nre\exceptions\ViewNotFoundException

checkAchievements()

checkAchievements(\nre\core\Request  $request, \nre\core\Response  $response, array  $checkConditions = null) 

Check for newly achieved Achievements.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

array $checkConditions

Conditions to check

addTitle()

addTitle(string  $title) 

Add a piece of information to the current title.

Parameters

string $title

Title information

addTitleLocalized()

addTitleLocalized(string  $title) 

Add a piece of information to the current title and localize it.

Parameters

string $title

Title information

log()

log(string  $message, integer  $logMode = \nre\core\Logger::LOGMODE_AUTO) 

Log an error.

Parameters

string $message

Error message to log

integer $logMode

Log mode (optional)

set()

set(string  $name, mixed  $data) 

Set data for the View.

Parameters

string $name

Key

mixed $data

Value

redirect()

redirect(string  $url) 

Redirect to the given URL.

Parameters

string $url

Relative URL

checkModels()

checkModels(string  $modelName) : boolean

Check if Models of this Controller are loaded and available.

Parameters

string $modelName

Arbitrary number of Models to check

Returns

boolean —

All given Models are loaded and available

getView()

getView() : \nre\core\View

Get the View of the Controller

Returns

\nre\core\View

View of the Controller

loadModels()

loadModels() 

Load the Models of this Controller.

Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException

loadView()

loadView(string  $layoutName, string  $action) 

Load the View of this Controller.

Parameters

string $layoutName

Name of the current Layout

string $action

Current Action

Throws

\nre\exceptions\ViewNotFoundException

checkPermission()

checkPermission(\nre\core\Request  $request, \nre\core\Response  $response) 

Check user permissions.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

Throws

\nre\exceptions\AccessDeniedException

getClassName()

getClassName(string  $controllerName) : string

Determine the classname for the given Controller name.

Parameters

string $controllerName

Controller name to get classname of

Returns

string —

Classname for the Controller name

loadComponents()

loadComponents() 

Load the Components of this Controller.

Throws

\nre\exceptions\ComponentNotValidException
\nre\exceptions\ComponentNotFoundException

setCacheHeaders()

setCacheHeaders(string  $fileName) : boolean

Determine file information and set the HTTP-header for caching accordingly.

Parameters

string $fileName

Filename

Returns

boolean —

HTTP-status 304 was set (in cache)

getMediaFile()

getMediaFile(array  $media, string  $action = null) : object

Determine the file for a medium and process it if necessary.

Parameters

array $media

Medium to get file for

string $action

Action for processing the media

Throws

\nre\exceptions\IdNotFoundException
\nre\exceptions\ParamsNotValidException

Returns

object —

File for the medium (or null if medium is cached)

getImageTypes()

getImageTypes() : array

Get supported image types.

Returns

array —

List of supported image types

resizeImage()

resizeImage(string  $fileName, string  $mimeType, integer  $width, integer  $height) : mixed

Resize an image.

Parameters

string $fileName

Absolute pathname of image to resize

string $mimeType

Mimetype of target image

integer $width

Max. width to resize to

integer $height

Max. height to resize to

Returns

mixed —

Resized image