\AdminControllerCore

Summary

Methods
Properties
Constants
__construct()
initBreadcrumbs()
initToolbarTitle()
addFiltersToBreadcrumbs()
viewAccess()
checkToken()
processFilter()
postProcess()
processDeleteImage()
processExport()
processDelete()
processSave()
processAdd()
processUpdate()
processUpdateFields()
processStatus()
processPosition()
processResetFilters()
initPageHeaderToolbar()
initToolbar()
checkAccess()
displayNoSmarty()
displayAjax()
display()
initHeader()
addRowAction()
addRowActionSkipList()
initContent()
initCursedPage()
initFooter()
initModal()
renderModal()
renderModulesList()
renderList()
getTemplateListVars()
renderView()
getTemplateViewVars()
renderDetails()
renderForm()
getTemplateFormVars()
renderKpis()
renderOptions()
setHelperDisplay()
setDeprecatedMedia()
setMedia()
init()
initShopContext()
initProcess()
getList()
getModulesList()
getLanguages()
getFieldsValue()
getFieldValue()
validateRules()
viewDetails()
beforeUpdateOptions()
displayRequiredFields()
createTemplate()
jsonConfirmation()
jsonError()
isFresh()
refresh()
fillModuleData()
displayModuleOptions()
ajaxProcessGetModuleQuickView()
addMetaTitle()
$path
$currentIndex
$content
$warnings
$informations
$confirmations
$shopShareDatas
$_languages
$default_form_language
$allow_employee_form_lang
$layout
$bootstrap
$template
$table
$list_id
$className
$tabAccess
$id
$required_database
$token
$shopLinkType
$tpl_form_vars
$tpl_list_vars
$tpl_delete_link_vars
$tpl_option_vars
$tpl_view_vars
$tpl_required_fields_vars
$base_tpl_view
$base_tpl_form
$multiple_fieldsets
$fields_value
$errors
$lang
$cache_lang
$required_fields
$tpl_folder
$fieldImageSettings
$imageType
$controller_name
$multishop_context
$multishop_context_group
$show_page_header_toolbar
$page_header_toolbar_title
$page_header_toolbar_btn
$show_form_cancel_button
$admin_webpath
$modals
No constants found
processUpdateOptions()
loadObject()
filterToField()
redirect()
displayWarning()
displayInformation()
initTabModuleList()
addPageHeaderToolBarModulesListButton()
addToolBarModulesListButton()
filterTabModuleList()
l()
_childValidation()
beforeDelete()
afterDelete()
afterAdd()
afterUpdate()
afterImageUpload()
copyFromPost()
getSelectedAssoShop()
updateAssoShop()
validateField()
postImage()
uploadImage()
processBulkDelete()
ajaxProcessOpenHelp()
processBulkEnableSelection()
processBulkDisableSelection()
processBulkStatusSelection()
processBulkAffectZone()
beforeAdd()
$meta_title
$identifier
$identifier_name
$_defaultOrderBy
$_defaultOrderWay
$list_simple_header
$fields_list
$filter_modules_list
$modules_list
$fields_form
$fields_form_override
$submit_action
$fields_options
$shopLink
$_listsql
$_list
$toolbar_title
$toolbar_btn
$toolbar_scroll
$show_toolbar
$show_toolbar_options
$_listTotal
$_filter
$_filterHaving
$_tmpTableFilter
$_pagination
$_default_pagination
$_orderBy
$_orderWay
$actions_available
$actions
$list_skip_actions
$lite_display
$list_no_link
$allow_export
$helper
$bulk_actions
$boxes
$explicitSelect
$_select
$_join
$_where
$_group
$_having
$is_cms
$position_identifier
$position_group_identifier
$deleted
$filter
$noLink
$specificConfirmDelete
$colorOnBackground
$row_hover
$action
$display
$_includeContainer
$tab_modules_list
$bo_theme
$_redirect
$object
$id_object
$breadcrumbs
$list_natives_modules
$list_partners_modules
$logged_on_addons
$is_prestashop_up
$translationsTab
N/A
No private methods found
No private properties found
N/A

Properties

$path

$path : 

Type

$currentIndex

$currentIndex : 

Type

$content

$content : 

Type

$warnings

$warnings : 

Type

$informations

$informations : 

Type

$confirmations

$confirmations : 

Type

$shopShareDatas

$shopShareDatas : 

Type

$_languages

$_languages : 

Type

$default_form_language

$default_form_language : 

Type

$allow_employee_form_lang

$allow_employee_form_lang : 

Type

$layout

$layout : 

Type

$bootstrap

$bootstrap : 

Type

$template

$template : 

Type

$table

$table : string

Type

string — Associated table name

$list_id

$list_id : 

Type

$className

$className : string

Type

string — Tab name

$tabAccess

$tabAccess : array

Type

array — tabAccess

$id

$id : integer

Type

integer — Tab id

$required_database

$required_database : 

Type

$token

$token : string

Type

string — Security token

$shopLinkType

$shopLinkType : string

Type

string — shop | group_shop

$tpl_form_vars

$tpl_form_vars : 

Type

$tpl_list_vars

$tpl_list_vars : 

Type

$tpl_delete_link_vars

$tpl_delete_link_vars : 

Type

$tpl_option_vars

$tpl_option_vars : 

Type

$tpl_view_vars

$tpl_view_vars : 

Type

$tpl_required_fields_vars

$tpl_required_fields_vars : 

Type

$base_tpl_view

$base_tpl_view : 

Type

$base_tpl_form

$base_tpl_form : 

Type

$multiple_fieldsets

$multiple_fieldsets : boolean

Type

boolean — if you want more fieldsets in the form

$fields_value

$fields_value : 

Type

$errors

$errors : array

Type

array — Errors displayed after post processing

$lang

$lang : boolean

Type

boolean — Automatically join language table if true

$cache_lang

$cache_lang : array

Type

array — cache for traduction

$required_fields

$required_fields : array

Type

array — required_fields to display in the Required Fields form

$tpl_folder

$tpl_folder : 

Type

$fieldImageSettings

$fieldImageSettings : array

Type

array — Name and directory where class image are located

$imageType

$imageType : string

Type

string — Image type

$controller_name

$controller_name : \current

Type

\current — controller name without suffix

$multishop_context

$multishop_context : 

Type

$multishop_context_group

$multishop_context_group : 

Type

$show_page_header_toolbar

$show_page_header_toolbar : 

Type

$page_header_toolbar_title

$page_header_toolbar_title : 

Type

$page_header_toolbar_btn

$page_header_toolbar_btn : 

Type

$show_form_cancel_button

$show_form_cancel_button : 

Type

$admin_webpath

$admin_webpath : 

Type

$modals

$modals : 

Type

$meta_title

$meta_title : 

Type

$identifier

$identifier : string

Type

string — Object identifier inside the associated table

$identifier_name

$identifier_name : 

Type

$_defaultOrderBy

$_defaultOrderBy : string

Type

string — Default ORDER BY clause when $_orderBy is not defined

$_defaultOrderWay

$_defaultOrderWay : 

Type

$list_simple_header

$list_simple_header : \define

Type

\define — if the header of the list contains filter and sorting links or not

$fields_list

$fields_list : array

Type

array — list to be generated

$filter_modules_list

$filter_modules_list : array

Type

array — modules list filters

$modules_list

$modules_list : array

Type

array — modules list filters

$fields_form

$fields_form : array

Type

array — edit form to be generated

$fields_form_override

$fields_form_override : \override

Type

\override — of $fields_form

$submit_action

$submit_action : \override

Type

\override — form action

$fields_options

$fields_options : array

Type

array — list of option forms to be generated

$shopLink

$shopLink : 

Type

$_listsql

$_listsql : string

Type

string — SQL query

$_list

$_list : array

Type

array — Cache for query results

$toolbar_title

$toolbar_title : \define

Type

\define — if the header of the list contains filter and sorting links or not

$toolbar_btn

$toolbar_btn : array

Type

array — list of toolbar buttons

$toolbar_scroll

$toolbar_scroll : boolean

Type

boolean — scrolling toolbar

$show_toolbar

$show_toolbar : boolean

Type

boolean — set to false to hide toolbar and page title

$show_toolbar_options

$show_toolbar_options : boolean

Type

boolean — set to true to show toolbar and page title for options

$_listTotal

$_listTotal : integer

Type

integer — Number of results in list

$_filter

$_filter : array

Type

array — WHERE clause determined by filter fields

$_filterHaving

$_filterHaving : 

Type

$_tmpTableFilter

$_tmpTableFilter : array

Type

array — Temporary SQL table WHERE clause determinated by filter fields

$_pagination

$_pagination : array

Type

array — Number of results in list per page (used in select field)

$_default_pagination

$_default_pagination : integer

Type

integer — Default number of results in list per page

$_orderBy

$_orderBy : string

Type

string — ORDER BY clause determined by field/arrows in list header

$_orderWay

$_orderWay : string

Type

string — Order way (ASC, DESC) determined by arrows in list header

$actions_available

$actions_available : array

Type

array — list of available actions for each list row - default actions are view, edit, delete, duplicate

$actions

$actions : array

Type

array — list of required actions for each list row

$list_skip_actions

$list_skip_actions : array

Type

array — list of row ids associated with a given action for witch this action have to not be available

$lite_display

$lite_display : 

Type

$list_no_link

$list_no_link : boolean

Type

boolean — boolean List content lines are clickable if true

$allow_export

$allow_export : 

Type

$helper

$helper : \Helper

Type

\Helper

$bulk_actions

$bulk_actions : array

Type

array — actions to execute on multiple selections Usage: array( 'actionName' => array( 'text' => $this->l('Message displayed on the submit button (mandatory)'), 'confirm' => $this->l('If set, this confirmation message will pop-up (optional)')), 'anotherAction' => array(...) ); If your action is named 'actionName', you need to have a method named bulkactionName() that will be executed when the button is clicked.

$boxes

$boxes : array

Type

array — ids of the rows selected

$explicitSelect

$explicitSelect : string

Type

string — Do not automatically select * anymore but select only what is necessary

$_select

$_select : string

Type

string — Add fields into data query to display list

$_join

$_join : string

Type

string — Join tables into data query to display list

$_where

$_where : string

Type

string — Add conditions into data query to display list

$_group

$_group : string

Type

string — Group rows into data query to display list

$_having

$_having : string

Type

string — Having rows into data query to display list

$is_cms

$is_cms : 

Type

$position_identifier

$position_identifier : string

Type

string — identifier to use for changing positions in lists (can be omitted if positions cannot be changed)

$position_group_identifier

$position_group_identifier : 

Type

$deleted

$deleted : boolean

Type

boolean — Table records are not deleted but marked as deleted if set to true

$filter

$filter : boolean

Type

boolean — is a list filter set

$noLink

$noLink : 

Type

$specificConfirmDelete

$specificConfirmDelete : 

Type

$colorOnBackground

$colorOnBackground : 

Type

$row_hover

$row_hover : boolean

Type

boolean — If true, activates color on hover

$action

$action : 

Type

$display

$display : 

Type

$_includeContainer

$_includeContainer : 

Type

$tab_modules_list

$tab_modules_list : 

Type

$bo_theme

$bo_theme : 

Type

$_redirect

$_redirect : boolean

Type

boolean — Redirect or not ater a creation

$object

$object : \instanciation

Type

\instanciation — of the class associated with the AdminController

$id_object

$id_object : integer

Type

integer — current object ID

$breadcrumbs

$breadcrumbs : 

Current breadcrumb position as an array of tab names

Type

$list_natives_modules

$list_natives_modules : 

Type

$list_partners_modules

$list_partners_modules : 

Type

$logged_on_addons

$logged_on_addons : 

Type

$is_prestashop_up

$is_prestashop_up : 

Type

$translationsTab

$translationsTab : 

Display modules list

Type

Methods

__construct()

__construct() 

initBreadcrumbs()

initBreadcrumbs(  $tab_id = null,   $tabs = null) 

Set breadcrumbs array for the controller page

Parameters

$tab_id
$tabs

initToolbarTitle()

initToolbarTitle() : void

set default toolbar_title to admin breadcrumb

addFiltersToBreadcrumbs()

addFiltersToBreadcrumbs() 

viewAccess()

viewAccess(boolean  $disable = false) : boolean

Check rights to view the current tab

Parameters

boolean $disable

Returns

boolean

checkToken()

checkToken() 

Check for security token

processFilter()

processFilter() 

Set the filters used for the list display

postProcess()

postProcess() 

processDeleteImage()

processDeleteImage() 

Object Delete images

processExport()

processExport(  $text_delimiter = '"') 

Parameters

$text_delimiter

processDelete()

processDelete() 

Object Delete

processSave()

processSave() : mixed

Call the right method for creating or updating object

Returns

mixed

processAdd()

processAdd() 

Object creation

processUpdate()

processUpdate() 

Object update

processUpdateFields()

processUpdateFields() 

Change object required fields

processStatus()

processStatus() 

Change object status (active, inactive)

processPosition()

processPosition() 

Change object position

processResetFilters()

processResetFilters(  $list_id = null) 

Cancel all filters for this tab

Parameters

$list_id

initPageHeaderToolbar()

initPageHeaderToolbar() 

initToolbar()

initToolbar() 

assign default action in toolbar_btn smarty var, if they are not set.

uses override to specifically add, modify or remove items

checkAccess()

checkAccess() 

Check if the token is valid, else display a warning page

displayNoSmarty()

displayNoSmarty() 

displayAjax()

displayAjax() 

display()

display() 

initHeader()

initHeader() 

Assign smarty variables for the header

addRowAction()

addRowAction(  $action) 

Declare an action to use for each row in the list

Parameters

$action

addRowActionSkipList()

addRowActionSkipList(  $action,   $list) 

Add an action to use for each row in the list

Parameters

$action
$list

initContent()

initContent() 

Assign smarty variables for all default views, list and form, then call other init functions

initCursedPage()

initCursedPage() : void

initialize the invalid doom page of death

initFooter()

initFooter() 

Assign smarty variables for the footer

initModal()

initModal() 

renderModal()

renderModal() 

renderModulesList()

renderModulesList() 

renderList()

renderList() 

Function used to render the list to display for this controller

getTemplateListVars()

getTemplateListVars() 

renderView()

renderView() 

Override to render the view page

getTemplateViewVars()

getTemplateViewVars() 

renderDetails()

renderDetails() 

Override to render the view page

renderForm()

renderForm() 

Function used to render the form for this controller

getTemplateFormVars()

getTemplateFormVars() 

renderKpis()

renderKpis() 

renderOptions()

renderOptions() 

Function used to render the options for this controller

setHelperDisplay()

setHelperDisplay(\Helper  $helper) : void

this function set various display option for helper list

Parameters

\Helper $helper

setDeprecatedMedia()

setDeprecatedMedia() 

setMedia()

setMedia() 

init()

init() 

Init context and dependencies, handles POST and GET

initShopContext()

initShopContext() 

initProcess()

initProcess() 

Retrieve GET and POST value and translate them to actions

getList()

getList(integer  $id_lang, string  $order_by = null,   $order_way = null, integer  $start, integer  $limit = null,   $id_lang_shop = false) 

Get the current objects' list form the database

Parameters

integer $id_lang

Language used for display

string $order_by

ORDER BY clause

$order_way
integer $start

Offset in LIMIT clause

integer $limit

Row count in LIMIT clause

$id_lang_shop

getModulesList()

getModulesList(  $filter_modules_list) 

Parameters

$filter_modules_list

getLanguages()

getLanguages() 

getFieldsValue()

getFieldsValue(object  $obj) : array

Return the list of fields value

Parameters

object $obj

Object

Returns

array

getFieldValue()

getFieldValue(object  $obj, string  $key, integer  $id_lang = null) : string

Return field value if possible (both classical and multilingual fields)

Case 1 : Return value if present in $_POST / $_GET Case 2 : Return object value

Parameters

object $obj

Object

string $key

Field name

integer $id_lang

Language id (optional)

Returns

string

validateRules()

validateRules(  $class_name = false) 

Manage page display (form, list.

..)

Parameters

$class_name

viewDetails()

viewDetails() 

Display object details

beforeUpdateOptions()

beforeUpdateOptions() 

Can be overriden

displayRequiredFields()

displayRequiredFields() 

prepare the view to display the required fields form

createTemplate()

createTemplate(string  $tpl_name) : \Template

Create a template from the override file, else from the base file.

Parameters

string $tpl_name

filename

Returns

\Template

jsonConfirmation()

jsonConfirmation(  $message) 

Shortcut to set up a json success payload

Parameters

$message

success message

jsonError()

jsonError(  $message) 

Shortcut to set up a json error payload

Parameters

$message

error message

isFresh()

isFresh(  $file,   $timeout = 604800) 

Parameters

$file
$timeout

refresh()

refresh(  $file_to_refresh,   $external_file) 

Parameters

$file_to_refresh
$external_file

fillModuleData()

fillModuleData(  $module,   $output_type = 'link',   $back = null) 

Parameters

$module
$output_type
$back

displayModuleOptions()

displayModuleOptions(  $module,   $output_type = 'link',   $back = null) 

Parameters

$module
$output_type
$back

ajaxProcessGetModuleQuickView()

ajaxProcessGetModuleQuickView() 

addMetaTitle()

addMetaTitle(string  $entry) 

Add an entry to the meta title.

Parameters

string $entry

New entry.

processUpdateOptions()

processUpdateOptions() 

Update options and preferences

loadObject()

loadObject(boolean  $opt = false) : object|boolean

Load class object using identifier in $_GET (if possible) otherwise return an empty object, or die

Parameters

boolean $opt

Return an empty object if load fail

Returns

object|boolean

filterToField()

filterToField(  $key,   $filter) 

Parameters

$key
$filter

redirect()

redirect() 

displayWarning()

displayWarning(string  $msg) 

add a warning message to display at the top of the page

Parameters

string $msg

displayInformation()

displayInformation(string  $msg) 

add a info message to display at the top of the page

Parameters

string $msg

initTabModuleList()

initTabModuleList() 

init tab modules list and add button in toolbar

addPageHeaderToolBarModulesListButton()

addPageHeaderToolBarModulesListButton() 

addToolBarModulesListButton()

addToolBarModulesListButton() 

filterTabModuleList()

filterTabModuleList() 

l()

l(mixed  $string, string  $class = null, \boolan  $addslashes = false, boolean  $htmlentities = true) : string

non-static method which uses AdminController::translate()

Parameters

mixed $string

term or expression in english

string $class

name of the class

\boolan $addslashes

if set to true, the return value will pass through addslashes(). Otherwise, stripslashes().

boolean $htmlentities

if set to true(default), the return value will pass through htmlentities($string, ENT_QUOTES, 'utf-8')

Returns

string —

the translation if available, or the english default text.

_childValidation()

_childValidation() 

Overload this method for custom checking

beforeDelete()

beforeDelete(object  $object) : boolean

Called before deletion

Parameters

object $object

Object

Returns

boolean

afterDelete()

afterDelete(object  $object,   $oldId) : boolean

Called before deletion

Parameters

object $object

Object

$oldId

Returns

boolean

afterAdd()

afterAdd(  $object) 

Parameters

$object

afterUpdate()

afterUpdate(  $object) 

Parameters

$object

afterImageUpload()

afterImageUpload() : boolean

Check rights to view the current tab

Returns

boolean

copyFromPost()

copyFromPost(  $object, string  $table) 

Copy datas from $_POST to object

Parameters

$object
string $table

Object table

getSelectedAssoShop()

getSelectedAssoShop(string  $table) : array

Returns an array with selected shops and type (group or boutique shop)

Parameters

string $table

Returns

array

updateAssoShop()

updateAssoShop(integer  $id_object) 

Update the associations of shops

Parameters

integer $id_object

validateField()

validateField(  $value,   $field) 

Parameters

$value
$field

postImage()

postImage(integer  $id) : boolean

Overload this method for custom checking

Parameters

integer $id

Object id used for deleting images

Returns

boolean

uploadImage()

uploadImage(  $id,   $name,   $dir,   $ext = false,   $width = null,   $height = null) 

Parameters

$id
$name
$dir
$ext
$width
$height

processBulkDelete()

processBulkDelete() : boolean

Delete multiple items

Returns

boolean —

true if succcess

ajaxProcessOpenHelp()

ajaxProcessOpenHelp() 

processBulkEnableSelection()

processBulkEnableSelection() : boolean

Enable multiple items

Returns

boolean —

true if succcess

processBulkDisableSelection()

processBulkDisableSelection() : boolean

Disable multiple items

Returns

boolean —

true if succcess

processBulkStatusSelection()

processBulkStatusSelection(  $status) : boolean

Toggle status of multiple items

Parameters

$status

Returns

boolean —

true if succcess

processBulkAffectZone()

processBulkAffectZone() 

beforeAdd()

beforeAdd(object  $object) : boolean

Called before Add

Parameters

object $object

Object

Returns

boolean