phpDocumentor

ContentManagerElementsController extends AdminHttpViewController Uses ContentManagerContentNavigationTrait

Class ContentManagerPagesController

Tags
category

System

Table of Contents

$assets  : AssetCollectionInterface
$contentTypeFileFlagMap  : array<string|int, mixed>
$contentView  : ContentViewInterface
$fieldMap  : array<string|int, mixed>
$fileTypMap  : array<string|int, mixed>
Order of this array is important as it will update the file flag in the database on updating
$httpContextReader  : HttpContextReaderInterface
$httpResponseProcessor  : HttpResponseProcessorInterface
$isExpertMode  : bool
$languageProvider  : LanguageProvider
$postDataArray  : array<string|int, mixed>
$queryBuilder  : CI_DB_query_builder
$queryParametersArray  : array<string|int, mixed>
$serverDataArray  : array<string|int, mixed>
$switcherFields  : array<string|int, mixed>
$title  : NonEmptyStringType
$typeMap  : array<string|int, mixed>
$languageTextManager  : LanguageTextManager
$userConfigurationService  : UserConfigurationService
__construct()  : mixed
actionCreateBoxes()  : AdminLayoutHttpControllerResponse
Renders the creation form for content manager boxes element pages.
actionCreateFooter()  : AdminLayoutHttpControllerResponse
Renders the creation form for content manager footer element pages.
actionCreateHeader()  : AdminLayoutHttpControllerResponse
Renders the creation form for content manager header element pages.
actionCreateHome()  : AdminLayoutHttpControllerResponse
Renders the creation form for content manager home element pages.
actionCreateOthers()  : AdminLayoutHttpControllerResponse
Renders the creation form for content manager others element pages.
actionCreateWithdrawal()  : AdminLayoutHttpControllerResponse
Renders the creation form for content manager withdrawal element pages.
actionDefault()  : AdminLayoutHttpControllerResponse
Default actions, renders the content manager elements overview.
actionEdit()  : AdminLayoutHttpControllerResponse
Renders the edit form for content manager home element pages.
actionSaveBoxes()  : RedirectHttpControllerResponse
Stores content manager boxes element data in the database and redirects to the overview.
actionSaveFooter()  : RedirectHttpControllerResponse
Stores content manager footer element data in the database and redirects to the overview.
actionSaveHeader()  : RedirectHttpControllerResponse
Stores content manager header element data in the database and redirects to the overview.
actionSaveHome()  : RedirectHttpControllerResponse
Stores content manager home element data in the database and redirects to the overview.
actionSaveOthers()  : RedirectHttpControllerResponse
Stores content manager others element data in the database and redirects to the overview.
actionSaveWithdrawal()  : RedirectHttpControllerResponse
Stores content manager withdrawal element data in the database and redirects to the overview.
actionUpdate()  : RedirectHttpControllerResponse
Updates content manager elements data in the database and redirects to the overview.
init()  : mixed
Initialize 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
_callActionMethod()  : HttpControllerResponseInterface
Invokes an action method by the given action name.
_checkScriptpageFileUploads()  : array<string|int, mixed>
Detects file uploads for scriptpages and returns the array for new content_file post data.
_createContentNavigation()  : ContentNavigationCollection
Creates the content navigation object for the content manager templates.
_createNewContentGroupId()  : int
Creates a new content group id.
_getAssets()  : AssetCollection
Returns the assets for the content manager editing and creation pages.
_getContentData()  : array<string|int, mixed>
Fetches and returns the content data for the content manager elements.
_getContentType()  : string
Returns the content type of the given query result.
_getCreationData()  : array<string|int, mixed>|bool|KeyValueCollection
Creates the template data for creation pages.
_getEditData()  : KeyValueCollection
Prepares and returns the content manager data to be edited.
_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.
_getProductsContentFiles()  : array<string|int, mixed>
Returns an array with allowed script files for content data.
_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.
_getScriptPageFiles()  : array<string|int, mixed>
Returns an array with allowed script files for content data.
_getServerData()  : string|null
Returns the expected $_SERVER value by the given key name.
_getTemplate()  : ExistingFile
Returns an existing file object with the path to a content manager template file.
_getUpdateResponse()  : RedirectHttpControllerResponse
Whether redirects to the last overview or update pages.
_insertContentData()  : $this|ContentManagerPagesController
Inserts the given content data in the database.
_isFilemanagerAvailable()  : bool
Returns true if the "Responsive File Manager" is installed an false otherwise.
_prepareContentManagerGroupCheckData()  : string
Prepares $_POST data for the content_manager's 'group_ids' column.
_preparePostData()  : array<string|int, mixed>
Prepares the content manager elements post data.
_render()  : string
Renders and returns a template file.
_setExpertMode()  : mixed
Sets the expert mode, if the query parameter has been passed.
_updateContentData()  : $this|ContentManagerPagesController
Updates the given content data in the database.
_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

$contentTypeFileFlagMap

protected array<string|int, mixed> $contentTypeFileFlagMap = ['pages_main' => 'topmenu', 'pages_secondary' => 'topmenu_corner', 'pages_info' => 'content', 'pages_info_box' => 'information', 'pages_additional' => 'additional', 'elements_start' => 'extraboxes', 'elements_header' => 'extraboxes', 'elements_styleedit' => 'information', 'elements_footer' => 'extraboxes', 'elements_boxes' => 'extraboxes', 'elements_others' => 'extraboxes', 'elements_withdrawal' => 'withdrawal']

$fieldMap

protected array<string|int, mixed> $fieldMap = ['content_title', 'content_heading', 'content_text', 'content_status', 'content_file', 'content_type']

$fileTypMap

Order of this array is important as it will update the file flag in the database on updating

protected array<string|int, mixed> $fileTypMap = [0 => 'information', 1 => 'content', 2 => 'topmenu_corner', 3 => 'topmenu', 4 => 'extraboxes', 5 => 'withdrawal', 6 => 'additional']

$typeMap

protected array<string|int, mixed> $typeMap = ['home' => 'elements_start', 'header' => 'elements_header', 'footer' => 'elements_footer', 'boxes' => 'elements_boxes']

Methods

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
throws
LogicException

When no action method is found by the http context reader.

see
HttpContextReaderInterface::getActionName
see
HttpResponseProcessorInterface::proceed
Return values
mixed

_checkScriptpageFileUploads()

Detects file uploads for scriptpages and returns the array for new content_file post data.

protected _checkScriptpageFileUploads() : array<string|int, mixed>
Return values
array<string|int, mixed>

_createContentNavigation()

Creates the content navigation object for the content manager templates.

protected _createContentNavigation(LanguageTextManager $languageTextManager[, string|null $current = null ]) : ContentNavigationCollection
Parameters
$languageTextManager : LanguageTextManager

Text manager instance to fetch texts.

$current : string|null = null

(Optional) Whether "pages", "elements" or "productContents" to set nav item active.

Return values
ContentNavigationCollection

_createNewContentGroupId()

Creates a new content group id.

protected _createNewContentGroupId(CI_DB_query_builder $queryBuilder) : int
Parameters
$queryBuilder : CI_DB_query_builder

Query builder instance to access the database.

Return values
int

New content manager group id.

_getContentData()

Fetches and returns the content data for the content manager elements.

protected _getContentData() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getContentType()

Returns the content type of the given query result.

protected _getContentType(array<string|int, mixed> $queryResult) : string
Parameters
$queryResult : array<string|int, mixed>

Data sets of query for content_manager table.

Return values
string

Whether "content", "file" or "link".

_getCreationData()

Creates the template data for creation pages.

protected _getCreationData(string $action) : array<string|int, mixed>|bool|KeyValueCollection

The action determines the target location after clicking the submit button.

Parameters
$action : string

Should be whether "home", "header", "footer" or "boxes".

Return values
array<string|int, mixed>|bool|KeyValueCollection

_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.

_getProductsContentFiles()

Returns an array with allowed script files for content data.

protected _getProductsContentFiles() : array<string|int, mixed>
Return values
array<string|int, mixed>

List with allowed script files.

_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.

_getScriptPageFiles()

Returns an array with allowed script files for content data.

protected _getScriptPageFiles() : array<string|int, mixed>
Return values
array<string|int, mixed>

List with allowed script files.

_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.

_getTemplate()

Returns an existing file object with the path to a content manager template file.

protected _getTemplate(string $type, string $name) : ExistingFile

Take a look on the template files which are located in html/content/content_manager/$type directory to know possible values for the $name argument.

Parameters
$type : string

Content manager type, whether "pages", "elements" or "product_contents".

$name : string

Name of template file.

Return values
ExistingFile

_insertContentData()

Inserts the given content data in the database.

protected _insertContentData(CI_DB_query_builder $queryBuilder, array<string|int, mixed> $contentData) : $this|ContentManagerPagesController
Parameters
$queryBuilder : CI_DB_query_builder

Query builder instance to access the database.

$contentData : array<string|int, mixed>

Content data array.

Return values
$this|ContentManagerPagesController

Same instance for chained method calls.

_isFilemanagerAvailable()

Returns true if the "Responsive File Manager" is installed an false otherwise.

protected _isFilemanagerAvailable() : bool
Return values
bool

_prepareContentManagerGroupCheckData()

Prepares $_POST data for the content_manager's 'group_ids' column.

protected _prepareContentManagerGroupCheckData() : string
Return values
string

_preparePostData()

Prepares the content manager elements post data.

protected _preparePostData(string $type) : array<string|int, mixed>
Parameters
$type : string

Content manager type, whether "home", "header", "footer" or "boxes".

Return values
array<string|int, mixed>

Prepared data array for inserting or updating in database.

_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.

_updateContentData()

Updates the given content data in the database.

protected _updateContentData(CI_DB_query_builder $queryBuilder, array<string|int, mixed> $contentData, int $contentGroupId) : $this|ContentManagerPagesController
Parameters
$queryBuilder : CI_DB_query_builder

Query builder instance to access the database.

$contentData : array<string|int, mixed>

Content data array.

$contentGroupId : int

Content group id.

Return values
$this|ContentManagerPagesController

Same instance for chained method calls.

_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
throws
Exception

If the validation fails.

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
throws
Exception

if the path or file is not found

Return values
ExistingFile

containing absolute file path to the given template file

isValidRequestMethod()

protected isValidRequestMethod(string $method) : bool
Parameters
$method : string
Return values
bool

prepareJsonInput()

protected prepareJsonInput(string $json) : array<string|int, mixed>
Parameters
$json : string
Return values
array<string|int, mixed>

Search results