ThemesImportController
class ThemesImportController extends ImportController (View source)
{@inheritdoc}
Constants
AJAX_TOKEN_INTENTION |
|
SCHEMA_TOKEN_INTENTION |
|
FONT_TOKEN_INTENTION |
|
Properties
protected Container|null | $container | from Controller | |
protected Theme; | $theme | Theme entity. | from AppController |
static protected string | $themeName | Theme name. | from AppController |
static protected string | $themeAuthor | Theme author description. | from AppController |
static protected string | $themeCopyright | Theme copyright licence. | from AppController |
static protected string | $themeDir | Theme base directory name. | from AppController |
static protected string | $themeRequire | Theme requires a minimal CMS version. | from AppController |
static protected boolean | $backendTheme | Is theme for backend? | from AppController |
protected array | $assignation | Assignation for twig template engine. | from AppController |
Methods
Sets the Container associated with this Controller.
Get mixed object from Dependency Injection container.
Alias for $this->container['securityAuthorizationChecker']
.
Alias for $this->container['securityTokenStorage']
.
Wrap $this->container['urlGenerator']->generate
Returns a RedirectResponse to the given URL.
Validate a request against a given ROLE_* and throws an AccessDeniedException exception.
Custom route for redirecting routes with a trailing slash.
Make translation variable with the good localization.
Return a Response from a template string with its rendering assignation.
Returns a fully qualified view path for Twig rendering.
No description
Forwards the request to another controller.
Returns a ResourceNotFoundException.
Returns an AccessDeniedException.
Creates and returns a Form instance from the type of the form.
Creates and returns a form builder instance.
Creates and returns a form builder instance.
Creates and returns an EntityListManager instance.
Create and return a ContactFormManager to build and send contact form by email.
Create and return a EmailManager to build and send emails.
Checks if the attributes are granted against the current authentication token and optionally supplied object.
Throws an exception unless the attributes are granted against the current authentication token and optionally supplied object.
Return a file locator with theme Resource folder.
These routes are used to extend Roadiz back-office.
Return theme Resource folder according to main theme class inheriting AppController.
Prepare base information to be rendered in twig templates.
Append objects to the global dependency injection container.
Publish a message in Session flash bag and logger interface.
Publish a confirm message in Session flash bag and logger interface.
Publish an error message in Session flash bag and logger interface.
Validate a request against a given ROLE_* and check chroot and newsletter type/access and throws an AccessDeniedException exception.
Generate a simple view to inform visitors that website is currently unavailable.
No description
Get filename to import from POST request.
Import theme's Settings file.
Import theme's Roles file.
Import theme's Groups file.
Import NodeTypes file.
Import Tags file.
Import Nodes file.
Import theme's Settings file.
Details
in Controller at line 74
Request
getRequest()
Shortcut to return the request service.
in Controller at line 85
ContainerAwareInterface
setContainer(Container $container)
Sets the Container associated with this Controller.
in Controller at line 94
Container
getContainer()
in Controller at line 108
mixed
getService(string|null $key = null)
deprecated
deprecated
Get mixed object from Dependency Injection container.
Alias for $this->container[$key]
in Controller at line 116
mixed
get(string $serviceName)
Return a service from container.
in Controller at line 124
bool
has(string $serviceName)
Returns true if the service is defined.
in Controller at line 134
AuthorizationChecker
getAuthorizationChecker()
Alias for $this->container['securityAuthorizationChecker']
.
in Controller at line 144
TokenStorageInterface
getTokenStorage()
Alias for $this->container['securityTokenStorage']
.
in Controller at line 154
EntityManager
em()
Alias for $this->container['em']
.
in Controller at line 162
Translator
getTranslator()
in Controller at line 170
Twig_Environment
getTwig()
in Controller at line 184
string
generateUrl(string|NodesSources $route, mixed $parameters = [], int $referenceType = Router::ABSOLUTE_PATH)
Wrap $this->container['urlGenerator']->generate
in Controller at line 197
RedirectResponse
redirect(string $url, integer $status = Response::HTTP_FOUND)
Returns a RedirectResponse to the given URL.
in Controller at line 205
static string
getCalledClass()
in Controller at line 222
validateAccessForRole(string $role)
Validate a request against a given ROLE_* and throws an AccessDeniedException exception.
in Controller at line 236
RedirectResponse
removeTrailingSlashAction(Request $request)
Custom route for redirecting routes with a trailing slash.
in Controller at line 255
protected Translation
bindLocaleFromRoute(Request $request, string $_locale = null)
Make translation variable with the good localization.
in Controller at line 296
string
renderView(string $view, array $parameters = [])
Returns a rendered view.
in Controller at line 313
Response
render(string $view, array $parameters = [], Response $response = null, string $namespace = "")
Return a Response from a template string with its rendering assignation.
in AppController at line 304
protected string
getNamespacedView(string $view, string $namespace = '')
Returns a fully qualified view path for Twig rendering.
in Controller at line 358
JsonResponse
renderJson(array $data = [], int $httpStatus = JsonResponse::HTTP_OK)
in Controller at line 372
protected Response
forward(string $controller, array $path = [], array $query = [])
Forwards the request to another controller.
in Controller at line 391
protected ResourceNotFoundException
createNotFoundException(string $message = 'Not Found', Exception $previous = null)
Returns a ResourceNotFoundException.
This will result in a 404 response code. Usage example:
throw $this->createNotFoundException('Page not found!');
in Controller at line 407
protected AccessDeniedException
createAccessDeniedException(string $message = 'Access Denied', Exception $previous = null)
Returns an AccessDeniedException.
This will result in a 403 response code. Usage example:
throw $this->createAccessDeniedException('Unable to access this page!');
in Controller at line 420
protected Form
createForm(string|FormTypeInterface $type, mixed $data = null, array $options = [])
Creates and returns a Form instance from the type of the form.
in Controller at line 433
protected FormBuilderInterface
createFormBuilder(mixed $data = null, array $options = [])
Creates and returns a form builder instance.
in Controller at line 446
protected FormBuilderInterface
createNamedFormBuilder($name = 'form', $data = null, array $options = [])
Creates and returns a form builder instance.
in Controller at line 463
EntityListManager
createEntityListManager(mixed $entity, array $criteria = [], array $ordering = [])
Creates and returns an EntityListManager instance.
in Controller at line 480
ContactFormManager
createContactFormManager()
Create and return a ContactFormManager to build and send contact form by email.
in Controller at line 490
EmailManager
createEmailManager()
Create and return a EmailManager to build and send emails.
in Controller at line 504
protected User|null
getUser()
Get a user from the tokenStorage.
in Controller at line 530
protected bool
isGranted(mixed $attributes, mixed $object = null)
Checks if the attributes are granted against the current authentication token and optionally supplied object.
in Controller at line 549
protected
denyAccessUnlessGranted(mixed $attributes, mixed $object = null, string $message = 'Access Denied.')
Throws an exception unless the attributes are granted against the current authentication token and optionally supplied object.
in AppController at line 78
static string
getThemeName()
in AppController at line 92
static string
getThemeAuthor()
in AppController at line 106
static string
getThemeCopyright()
in AppController at line 121
static string
getThemeDir()
in AppController at line 129
static string
getThemeMainClassName()
in AppController at line 137
static string
getThemeMainClass()
in AppController at line 154
static string
getThemeRequire()
in AppController at line 168
static boolean
isBackendTheme()
in AppController at line 188
__init()
Initialize controller with its twig environment.
in AppController at line 199
static FileLocator
getFileLocator()
Return a file locator with theme Resource folder.
in AppController at line 212
static RouteCollection
getRoutes()
in AppController at line 224
static RouteCollection
getBackendRoutes()
These routes are used to extend Roadiz back-office.
in AppController at line 241
static string
getThemeFolder()
Return theme root folder.
in AppController at line 256
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.
in AppController at line 263
static string
getViewsFolder()
in AppController at line 270
static string
getTranslationsFolder()
in AppController at line 277
static string
getPublicFolder()
in AppController at line 285
string
getStaticResourcesUrl()
in AppController at line 292
string
getAbsoluteStaticResourceUrl()
in AppController at line 350
$this
prepareBaseAssignation()
Prepare base information 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
- ajax:
- session
- messages
- id
- user
- bags
- nodeTypes (ParametersBag)
- settings (ParametersBag)
- roles (ParametersBag)
- securityAuthorizationChecker
in ImportController at line 242
Response
throw404(string $message = '')
in AppController at line 413
Theme|null
getTheme()
Return the current Theme
in AppController at line 442
static
setupDependencyInjection(Container $container)
Append objects to the global dependency injection container.
in AppController at line 451
static
addThemeTemplatesPath(Container $container)
in AppController at line 466
protected null|Node
getHome(Translation $translation = null)
in AppController at line 498
protected Node
getRoot()
in AppController at line 513
protected
publishMessage(Request $request, string $msg, string $level = "confirm", NodesSources $source = null)
Publish a message in Session flash bag and logger interface.
in AppController at line 536
publishConfirmMessage(Request $request, string $msg, NodesSources $source = null)
Publish a confirm message in Session flash bag and logger interface.
in AppController at line 549
publishErrorMessage(Request $request, string $msg, NodesSources $source = null)
Publish an error message in Session flash bag and logger interface.
in AppController at line 565
validateNodeAccessForRole(string $role, integer|null $nodeId = null, boolean|false $includeChroot = false)
Validate a request against a given ROLE_* and check chroot and newsletter type/access and throws an AccessDeniedException exception.
in AppController at line 612
Response
maintenanceAction(Request $request)
Generate a simple view to inform visitors that website is currently unavailable.
in AppController at line 629
protected array
getErrorsAsArray(FormInterface $form)
Return all Form errors as an array.
in ImportController at line 57
protected Response
genericImportAction(string $classImporter, Request $request, integer $themeId = null)
in ImportController at line 77
protected string|null
getFilename(Request $request)
Get filename to import from POST request.
at line 49
Response
importSettingsAction(Request $request, int $themeId = null)
Import theme's Settings file.
at line 64
Response
importRolesAction(Request $request, int $themeId = null)
Import theme's Roles file.
at line 79
Response
importGroupsAction(Request $request, int $themeId = null)
Import theme's Groups file.
at line 94
Response
importNodeTypesAction(Request $request, int $themeId = null)
Import NodeTypes file.
at line 109
Response
importTagsAction(Request $request, int $themeId = null)
Import Tags file.
at line 124
Response
importNodesAction(Request $request, int $themeId = null)
Import Nodes file.
in ImportController at line 198
Response
importContent(string $pathFile, string $classImporter, int $themeId)
Import theme's Settings file.