Beta version

class RolesUtilsController extends RozierApp

[email protected]}

Constants

AJAX_TOKEN_INTENTION

SCHEMA_TOKEN_INTENTION

FONT_TOKEN_INTENTION

DEFAULT_ITEM_PER_PAGE

Methods

Request
getRequest()

Shortcut to return the request service.

setContainer(Container $container)

No description

Container
getContainer()

No description

mixed
getService(string|null $key = null)

Get mixed object from Dependency Injection container.

mixed
get(string $serviceName)

Return a service from container.

bool
has(string $serviceName)

Returns true if the service is defined.

AuthorizationChecker
getAuthorizationChecker()

Alias for $this->container['securityAuthorizationChecker'].

TokenStorageInterface
getTokenStorage()

Alias for $this->container['securityTokenStorage'].

EntityManager
em()

Alias for $this->container['em'].

Translator
getTranslator()

No description

Twig_Environment
getTwig()

No description

string
generateUrl(string $route, mixed $parameters = array(), boolean $absolute = false)

Wrap $this->container['urlGenerator']->generate

RedirectResponse
redirect(string $url, integer $status = Response::HTTP_FOUND)

Returns a RedirectResponse to the given URL.

static string
getCalledClass()

No description

validateAccessForRole(string $role)

Validate a request against a given ROLE_* and throws an AccessDeniedException exception.

RedirectResponse
removeTrailingSlashAction(Request $request)

Custom route for redirecting routes with a trailing slash.

string
renderView(string $view, array $parameters = array())

Returns a rendered view.

Response
render(string $view, array $parameters = array(), Response $response = null, string $namespace = '')

Return a Response from a template string with its rendering assignation.

createEntityListManager(mixed $entity, array $criteria = array(), array $ordering = array())

Creates and returns an EntityListManager instance.

createContactFormManager()

Create and return a ContactFormManager to build and send contact form by email.

static string
getThemeName()

No description

static string
getThemeAuthor()

No description

static string
getThemeCopyright()

No description

static string
getThemeDir()

No description

static string
getThemeMainClassName()

No description

static string
getThemeMainClass()

No description

static string
getThemeRequire()

No description

static boolean
isBackendTheme()

No description

__init()

Initialize controller with its twig environment.

static FileLocator
getFileLocator()

Return a file locator with theme Resource folder.

static RouteCollection
getRoutes()

No description

static RouteCollection
getBackendRoutes()

These routes are used to extend Roadiz back-office.

static string
getThemeFolder()

Return theme root folder.

static string
getResourcesFolder()

Return theme Resource folder according to main theme class inheriting AppController.

static string
getViewsFolder()

No description

static string
getTranslationsFolder()

No description

string
getStaticResourcesUrl()

No description

$this
prepareBaseAssignation()

Prepare base informations to be rendered in twig templates.

from RozierApp
Response
throw404(string $message = '')

Return a Response with default backend 404 error page.

getTheme()

Return the current Theme

static 
setupDependencyInjection(Container $container)

Append objects to the global dependency injection container.

from RozierApp
publishConfirmMessage(Request $request, string $msg, NodesSources $source = null)

Publish a confirm message in Session flash bag and logger interface.

publishErrorMessage(Request $request, string $msg, NodesSources $source = null)

Publish an error message in Session flash bag and logger interface.

validateNodeAccessForRole(string $role, integer|null $nodeId = null, boolean|false $includeChroot = false)

Validate a request against a given ROLE_* and check chroot and newsletter type/accces and throws an AccessDeniedException exception.

Response
maintenanceAction(Request $request)

Generate a simple view to inform visitors that website is currently unavailable.

Response
indexAction(Request $request)

No description

from RozierApp
Response
cssAction(Request $request)

No description

from RozierApp
Response
exportAllAction(Request $request)

Export all Group datas and roles in a Json file (.rzt).

Response
exportAction(Request $request, int $roleId)

Export a Role in a Json file (.rzt).

Response
importJsonFileAction(Request $request)

Import a Json file (.rzt) containing Roles.

Details

in Controller at line 65
Request getRequest()

Shortcut to return the request service.

Return Value

Request

in Controller at line 76
ContainerAwareInterface setContainer(Container $container)

Parameters

Container $container

Return Value

ContainerAwareInterface

in Controller at line 85
Container getContainer()

Return Value

Container

in Controller at line 99
mixed getService(string|null $key = null)

Get mixed object from Dependency Injection container.

Alias for $this->container[$key]

Parameters

string|null $key

Return Value

mixed

in Controller at line 107
mixed get(string $serviceName)

Return a service from container.

Parameters

string $serviceName

Return Value

mixed

in Controller at line 115
bool has(string $serviceName)

Returns true if the service is defined.

Parameters

string $serviceName

Return Value

bool true if the service is defined, false otherwise

in Controller at line 125
AuthorizationChecker getAuthorizationChecker()

Alias for $this->container['securityAuthorizationChecker'].

Return Value

AuthorizationChecker

in Controller at line 135
TokenStorageInterface getTokenStorage()

Alias for $this->container['securityTokenStorage'].

Return Value

TokenStorageInterface

in Controller at line 145
EntityManager em()

Alias for $this->container['em'].

Return Value

EntityManager

in Controller at line 153
Translator getTranslator()

Return Value

Translator

in Controller at line 161
Twig_Environment getTwig()

Return Value

Twig_Environment

in Controller at line 175
string generateUrl(string $route, mixed $parameters = array(), boolean $absolute = false)

Wrap $this->container['urlGenerator']->generate

Parameters

string $route
mixed $parameters
boolean $absolute

Return Value

string

in Controller at line 188
RedirectResponse redirect(string $url, integer $status = Response::HTTP_FOUND)

Returns a RedirectResponse to the given URL.

Parameters

string $url
integer $status

Return Value

RedirectResponse

in Controller at line 196
static string getCalledClass()

Return Value

string

in Controller at line 213
validateAccessForRole(string $role)

Validate a request against a given ROLE_* and throws an AccessDeniedException exception.

Parameters

string $role

Exceptions

AccessDeniedException

in Controller at line 227
RedirectResponse removeTrailingSlashAction(Request $request)

Custom route for redirecting routes with a trailing slash.

Parameters

Request $request

Return Value

RedirectResponse

in Controller at line 287
string renderView(string $view, array $parameters = array())

Returns a rendered view.

Parameters

string $view
array $parameters

Return Value

string

in AppController at line 286
Response render(string $view, array $parameters = array(), Response $response = null, string $namespace = '')

Return a Response from a template string with its rendering assignation.

Parameters

string $view Template file path
array $parameters Twig assignation array
Response $response Optional Response object to customize response parameters
string $namespace Twig loader namespace

Return Value

Response

Exceptions

Twig_Error_Runtime

in Controller at line 418
EntityListManager createEntityListManager(mixed $entity, array $criteria = array(), array $ordering = array())

Creates and returns an EntityListManager instance.

Parameters

mixed $entity Entity class path
array $criteria
array $ordering

Return Value

EntityListManager

in Controller at line 435
ContactFormManager createContactFormManager()

Create and return a ContactFormManager to build and send contact form by email.

Return Value

ContactFormManager

in AppController at line 74
static string getThemeName()

Return Value

string

in AppController at line 88
static string getThemeAuthor()

Return Value

string

in AppController at line 102
static string getThemeCopyright()

Return Value

string

in AppController at line 117
static string getThemeDir()

Return Value

string

in AppController at line 125
static string getThemeMainClassName()

Return Value

string Main theme class name

in AppController at line 133
static string getThemeMainClass()

Return Value

string Main theme class (FQN class with namespace)

in AppController at line 150
static string getThemeRequire()

Return Value

string

in AppController at line 164
static boolean isBackendTheme()

Return Value

boolean

in AppController at line 184
__init()

Initialize controller with its twig environment.

in AppController at line 195
static FileLocator getFileLocator()

Return a file locator with theme Resource folder.

Return Value

FileLocator

in AppController at line 208
static RouteCollection getRoutes()

Return Value

RouteCollection

in AppController at line 220
static RouteCollection getBackendRoutes()

These routes are used to extend Roadiz back-office.

Return Value

RouteCollection

in AppController at line 237
static string getThemeFolder()

Return theme root folder.

Return Value

string

in AppController at line 252
static string getResourcesFolder()

Return theme Resource folder according to main theme class inheriting AppController.

Uses \ReflectionClass to resolve final theme class folder whether it’s located in project folder or in vendor folder.

Return Value

string

in AppController at line 259
static string getViewsFolder()

Return Value

string

in AppController at line 266
static string getTranslationsFolder()

Return Value

string

in AppController at line 273
string getStaticResourcesUrl()

Return Value

string

in RozierApp at line 65
$this prepareBaseAssignation()

Prepare base informations to be rendered in twig templates.

Available contents

  • request: Main request object
  • head
    • ajax: boolean
    • cmsVersion
    • cmsVersionNumber
    • cmsBuild
    • devMode: boolean
    • baseUrl
    • filesUrl
    • resourcesUrl
    • absoluteResourcesUrl
    • staticDomainName
    • ajaxToken
    • fontToken
    • universalAnalyticsId
    • useCdn
  • session
    • messages
    • id
    • user
  • securityAuthorizationChecker

Return Value

$this

in AppController at line 396
Response throw404(string $message = '')

Return a Response with default backend 404 error page.

Parameters

string $message Additionnal message to describe 404 error.

Return Value

Response

in AppController at line 413
Theme getTheme()

Return the current Theme

Return Value

Theme

in RozierApp at line 170
static setupDependencyInjection(Container $container)

Append objects to the global dependency injection container.

Parameters

Container $container

in AppController at line 532
publishConfirmMessage(Request $request, string $msg, NodesSources $source = null)

Publish a confirm message in Session flash bag and logger interface.

Parameters

Request $request
string $msg
NodesSources $source

in AppController at line 545
publishErrorMessage(Request $request, string $msg, NodesSources $source = null)

Publish an error message in Session flash bag and logger interface.

Parameters

Request $request
string $msg
NodesSources $source

in AppController at line 561
validateNodeAccessForRole(string $role, integer|null $nodeId = null, boolean|false $includeChroot = false)

Validate a request against a given ROLE_* and check chroot and newsletter type/accces and throws an AccessDeniedException exception.

Parameters

string $role
integer|null $nodeId
boolean|false $includeChroot

Exceptions

AccessDeniedException

in AppController at line 602
Response maintenanceAction(Request $request)

Generate a simple view to inform visitors that website is currently unavailable.

Parameters

Request $request

Return Value

Response

in RozierApp at line 140
Response indexAction(Request $request)

Parameters

Request $request

Return Value

Response $response

in RozierApp at line 150
Response cssAction(Request $request)

Parameters

Request $request

Return Value

Response $response

at line 53
Response exportAllAction(Request $request)

Export all Group datas and roles in a Json file (.rzt).

Parameters

Request $request

Return Value

Response

at line 91
Response exportAction(Request $request, int $roleId)

Export a Role in a Json file (.rzt).

Parameters

Request $request
int $roleId

Return Value

Response

at line 127
Response importJsonFileAction(Request $request)

Import a Json file (.rzt) containing Roles.

Parameters

Request $request

Return Value

Response