SlidersDetailsController
extends AdminHttpViewController
in package
Class SlidersDetailsController
Bootstraps the teaser slider edit page.
Tags
Table of Contents
- $assets : AssetCollectionInterface
- $contentView : ContentViewInterface
- $httpContextReader : HttpContextReaderInterface
- $httpResponseProcessor : HttpResponseProcessorInterface
- $languageProvider : LanguageProvider
- $languageTextManager : LanguageTextManager
- $postDataArray : array<string|int, mixed>
- $queryParametersArray : array<string|int, mixed>
- $serverDataArray : array<string|int, mixed>
- $slider : Slider
- $sliderReadService : SliderReadService
- $sliderWriteService : SliderWriteService
- $userCfgService : UserConfigurationService
- __construct() : mixed
- actionDefault() : mixed
- Renders the sliders detail page.
- actionSave() : mixed
- Saves a slider.
- init() : mixed
- Initializes the controller.
- proceed() : mixed
- Processes a http response object which is get by invoking an action method.
- validateCurrentAdminStatus() : mixed
- Makes sure that the admin status is currently given in session
- _addSuccessMessage() : mixed
- Adds a new success message.
- _callActionMethod() : HttpControllerResponseInterface
- Invokes an action method by the given action name.
- _createSlideImageAreaObject() : SlideImageAreaInterface
- Returns a slide image area object.
- _createSlideImageObject() : SlideImageInterface
- Returns a slide image object.
- _createSlideObject() : SlideInterface
- Returns a slide object.
- _getBreakpoints() : array<string|int, mixed>
- Returns all available breakpoints.
- _getDefaultSlideImageCollection() : SlideImageCollection
- Returns a default slide image collection.
- _getPostData() : string|null
- Returns the expected $_POST value by the given key name.
- _getPostDataCollection() : KeyValueCollection
- Creates and returns a key value collection which represent the global $_POST array.
- _getQueryParameter() : mixed|null
- Returns the expected $_GET value by the given key name.
- _getQueryParametersCollection() : KeyValueCollection
- Creates and returns a key value collection which represent the global $_GET array.
- _getServerData() : string|null
- Returns the expected $_SERVER value by the given key name.
- _getSlideData() : array<string|int, mixed>
- Returns the slide data.
- _getSlideImageAreaData() : array<string|int, mixed>
- Returns the slide image area data.
- _getSlideImageAreasData() : array<string|int, mixed>
- Returns the slide image areas data (iterating over the slide image area collection).
- _getSlideImageData() : array<string|int, mixed>
- Returns the slide image data.
- _getSlideImagesData() : array<string|int, mixed>
- Returns the slide images data (iterating over the slide image collection).
- _getSlider() : Slider
- Fetches a slider.
- _getSliderSlidesData() : array<string|int, mixed>
- Returns the slides data.
- _getSlideTemplateData() : array<string|int, mixed>
- Returns the slide template data.
- _render() : string
- Renders and returns a template file.
- _validatePageToken() : mixed
- Check if the $_POST['pageToken'] or $_GET['pageToken'] variable is provided and if it's valid.
- getTemplateFile() : ExistingFile
- Searches the GXModules directory and admin/html directory for a template file, wich can be useed inside the AdminLayoutHttpControllerResponse object for the template parameter.
- isValidJson() : bool
- isValidRequestMethod() : bool
- prepareJsonInput() : array<string|int, mixed>
Properties
$assets
protected
AssetCollectionInterface
$assets
$contentView
protected
ContentViewInterface
$contentView
$httpContextReader
protected
HttpContextReaderInterface
$httpContextReader
$httpResponseProcessor
protected
HttpResponseProcessorInterface
$httpResponseProcessor
$languageProvider
protected
LanguageProvider
$languageProvider
$languageTextManager
protected
LanguageTextManager
$languageTextManager
$postDataArray
protected
array<string|int, mixed>
$postDataArray
$queryParametersArray
protected
array<string|int, mixed>
$queryParametersArray
$serverDataArray
protected
array<string|int, mixed>
$serverDataArray
$slider
protected
Slider
$slider
$sliderReadService
protected
SliderReadService
$sliderReadService
$sliderWriteService
protected
SliderWriteService
$sliderWriteService
$userCfgService
protected
UserConfigurationService
$userCfgService
Methods
__construct()
public
__construct(HttpContextReaderInterface $httpContextReader, HttpResponseProcessorInterface $httpResponseProcessor, ContentViewInterface $defaultContentView) : mixed
Parameters
- $httpContextReader : HttpContextReaderInterface
- $httpResponseProcessor : HttpResponseProcessorInterface
- $defaultContentView : ContentViewInterface
Return values
mixed —actionDefault()
Renders the sliders detail page.
public
actionDefault() : mixed
Tags
Return values
mixed —actionSave()
Saves a slider.
public
actionSave() : mixed
Tags
Return values
mixed —init()
Initializes the controller.
public
init() : mixed
Return values
mixed —proceed()
Processes a http response object which is get by invoking an action method.
public
proceed(HttpContextInterface $httpContext) : mixed
The action method is determined by the http context reader instance and the current request context. Re-implement this method in child classes to enable XSS and CSRF protection on demand.
Parameters
- $httpContext : HttpContextInterface
-
Http context object which hold the request variables.
Tags
Return values
mixed —validateCurrentAdminStatus()
Makes sure that the admin status is currently given in session
public
validateCurrentAdminStatus() : mixed
Tags
Return values
mixed —_addSuccessMessage()
Adds a new success message.
protected
_addSuccessMessage() : mixed
Return values
mixed —_callActionMethod()
Invokes an action method by the given action name.
protected
_callActionMethod(string $actionName) : HttpControllerResponseInterface
Parameters
- $actionName : string
-
Name of action method to call, without 'action'-Suffix.
Tags
Return values
HttpControllerResponseInterface —Response message.
_createSlideImageAreaObject()
Returns a slide image area object.
protected
_createSlideImageAreaObject(array<string|int, mixed> $slideImageAreaFormData) : SlideImageAreaInterface
Parameters
- $slideImageAreaFormData : array<string|int, mixed>
-
Slide image area data.
Return values
SlideImageAreaInterface —_createSlideImageObject()
Returns a slide image object.
protected
_createSlideImageObject(IdType $languageId, array<string|int, mixed> $slideImageFormData) : SlideImageInterface
Parameters
- $languageId : IdType
-
Language ID.
- $slideImageFormData : array<string|int, mixed>
-
Slide image data.
Return values
SlideImageInterface —_createSlideObject()
Returns a slide object.
protected
_createSlideObject(IdType $languageId, array<string|int, mixed> $slideData) : SlideInterface
Parameters
- $languageId : IdType
-
Language ID.
- $slideData : array<string|int, mixed>
Return values
SlideInterface —_getBreakpoints()
Returns all available breakpoints.
protected
_getBreakpoints() : array<string|int, mixed>
Return values
array<string|int, mixed> —_getDefaultSlideImageCollection()
Returns a default slide image collection.
protected
_getDefaultSlideImageCollection(IdType $languageId) : SlideImageCollection
Parameters
- $languageId : IdType
-
Language ID.
Return values
SlideImageCollection —_getPostData()
Returns the expected $_POST value by the given key name.
protected
_getPostData(string $keyName) : string|null
This method is the object oriented layer for $_POST[$keyName].
Parameters
- $keyName : string
-
Expected key of post parameter.
Return values
string|null —Either the expected value or null, of not found.
_getPostDataCollection()
Creates and returns a key value collection which represent the global $_POST array.
protected
_getPostDataCollection() : KeyValueCollection
Return values
KeyValueCollection —_getQueryParameter()
Returns the expected $_GET value by the given key name.
protected
_getQueryParameter(string $keyName) : mixed|null
This method is the object oriented layer for $_GET[$keyName].
Parameters
- $keyName : string
-
Expected key of query parameter.
Return values
mixed|null —Either the expected value or null, of not found.
_getQueryParametersCollection()
Creates and returns a key value collection which represent the global $_GET array.
protected
_getQueryParametersCollection() : KeyValueCollection
Return values
KeyValueCollection —_getServerData()
Returns the expected $_SERVER value by the given key name.
protected
_getServerData(string $keyName) : string|null
This method is the object oriented layer for $_SERVER[$keyName].
Parameters
- $keyName : string
-
Expected key of server parameter.
Return values
string|null —Either the expected value or null, of not found.
_getSlideData()
Returns the slide data.
protected
_getSlideData(SlideInterface $slide) : array<string|int, mixed>
Parameters
- $slide : SlideInterface
-
Slide.
Return values
array<string|int, mixed> —Extracted data from slide object.
_getSlideImageAreaData()
Returns the slide image area data.
protected
_getSlideImageAreaData(SlideImageAreaInterface $slideImageArea) : array<string|int, mixed>
Parameters
- $slideImageArea : SlideImageAreaInterface
-
Slide image area.
Return values
array<string|int, mixed> —Slide image area data.
_getSlideImageAreasData()
Returns the slide image areas data (iterating over the slide image area collection).
protected
_getSlideImageAreasData(SlideImageAreaCollection $slideImageAreaCollection) : array<string|int, mixed>
Parameters
- $slideImageAreaCollection : SlideImageAreaCollection
-
Slide image area collection.
Return values
array<string|int, mixed> —_getSlideImageData()
Returns the slide image data.
protected
_getSlideImageData(SlideImageInterface $slideImage) : array<string|int, mixed>
Parameters
- $slideImage : SlideImageInterface
-
Slide image.
Return values
array<string|int, mixed> —Slide image data.
_getSlideImagesData()
Returns the slide images data (iterating over the slide image collection).
protected
_getSlideImagesData(SlideImageCollection $slideImageCollection, IdType $languageId) : array<string|int, mixed>
Parameters
- $slideImageCollection : SlideImageCollection
-
Slide image collection.
- $languageId : IdType
-
Language ID.
Return values
array<string|int, mixed> —_getSlider()
Fetches a slider.
protected
_getSlider(int|null $id) : Slider
If no ID has been passed, a new slider will be created.
Parameters
- $id : int|null
-
Slider ID (optional).
Return values
Slider —Fetched slider.
_getSliderSlidesData()
Returns the slides data.
protected
_getSliderSlidesData(SliderInterface $slider) : array<string|int, mixed>
If no ID is set, new slides for each language will be created.
Parameters
- $slider : SliderInterface
-
Slider.
Return values
array<string|int, mixed> —Slides data.
_getSlideTemplateData()
Returns the slide template data.
protected
_getSlideTemplateData() : array<string|int, mixed>
Return values
array<string|int, mixed> —Slide template data.
_render()
Renders and returns a template file.
protected
_render(string $templateFile, array<string|int, mixed> $contentArray) : string
Parameters
- $templateFile : string
-
Template file to render.
- $contentArray : array<string|int, mixed>
-
Content array which represent the variables of the template.
Return values
string —Rendered template.
_validatePageToken()
Check if the $_POST['pageToken'] or $_GET['pageToken'] variable is provided and if it's valid.
protected
_validatePageToken([string $customExceptionMessage = null ]) : mixed
Example: public function proceed(HttpContextInterface $httpContext) { parent::proceed($httpContext); // proceed http context from parent class if($_SERVER['REQUEST_METHOD'] === 'POST') { $this->_validatePageToken(); // CSRF Protection } }
Parameters
- $customExceptionMessage : string = null
-
(optional) You can specify a custom exception message.
Tags
Return values
mixed —getTemplateFile()
Searches the GXModules directory and admin/html directory for a template file, wich can be useed inside the AdminLayoutHttpControllerResponse object for the template parameter.
protected
getTemplateFile(string $templateFile) : ExistingFile
Parameters
- $templateFile : string
-
The relative path and filename to search for
Tags
Return values
ExistingFile —containing absolute file path to the given template file
isValidJson()
protected
isValidJson(string $string) : bool
Parameters
- $string : string
Return values
bool —isValidRequestMethod()
protected
isValidRequestMethod(string $method) : bool
Parameters
- $method : string
Return values
bool —prepareJsonInput()
protected
prepareJsonInput(string $json) : array<string|int, mixed>
Parameters
- $json : string