\AdminTabCore

Summary

Methods
Properties
Constants
__construct()
displayAjax()
display()
displayRequiredFields()
includeSubTab()
validateRules()
deleteImage()
ajaxPreProcess()
ajaxProcess()
postProcess()
beforeUpdateOptions()
displayErrors()
displayWarning()
displayConf()
getList()
displayImage()
displayListHeader()
displayTop()
displayList()
displayListContent()
displayListFooter()
displayOptionsList()
displayTopOptionCategory()
displayBottomOptionCategory()
displayOptionTypeSelect()
displayOptionTypeBool()
displayOptionTypeRadio()
displayOptionTypeText()
displayOptionTypePassword()
displayOptionTypeTextarea()
displayOptionTypeFile()
displayOptionTypeImage()
displayOptionTypeTextLang()
displayOptionTypeTextareaLang()
displayOptionTypeSelectLang()
displayOptionTypePrice()
displayOptionTypeDisabled()
getFieldValue()
displayForm()
viewDetails()
viewAccess()
checkToken()
displayFlags()
$id
$table
$className
$token
$lang
$edit
$view
$delete
$deleted
$duplicate
$noLink
$requiredDatabase
$colorOnBackground
$fieldImageSettings
$imageType
$fieldsDisplay
$optionTitle
$shopLinkType
$shopShareDatas
$_errors
$tabAccess
$specificConfirmDelete
$currentIndex
$smarty
$_fieldsOptions
$optionsList
$context
$ajax
$ignore_sleep
$tabParenting
No constants found
l()
_childValidation()
updateAssoShop()
getAssoShop()
updateOptions()
validateField()
uploadImage()
postImage()
copyFromPost()
displayAddButton()
_displayEnableLink()
_displayDuplicate()
_displayViewLink()
_displayEditLink()
_displayDeleteLink()
loadObject()
beforeDelete()
afterDelete()
afterAdd()
afterUpdate()
afterImageUpload()
filterToField()
warnDomainName()
displayAssoShop()
getCurrentUrl()
$identifier
$_select
$_join
$_where
$_group
$_having
$_list
$_listTotal
$_filter
$_tmpTableFilter
$_pagination
$_orderBy
$_defaultOrderBy
$_orderWay
$maxImageSize
$_conf
$_object
$identifiersDnd
$_redirect
$formOptions
$_languages
$_defaultFormLanguage
$_includeObj
$_includeVars
$_includeContainer
N/A
No private methods found
No private properties found
N/A

Properties

$id

$id : integer

Type

integer — Tab id

$table

$table : string

Type

string — Associated table name

$className

$className : string

Type

string — Tab name

$token

$token : string

Type

string — Security token

$lang

$lang : boolean

Type

boolean — Automatically join language table if true

$edit

$edit : boolean

Type

boolean — Tab Automatically displays edit/delete icons if true

$view

$view : boolean

Type

boolean — Tab Automatically displays view icon if true

$delete

$delete : boolean

Type

boolean — Tab Automatically displays delete icon if true

$deleted

$deleted : boolean

Type

boolean — Table records are not deleted but marked as deleted

$duplicate

$duplicate : boolean

Type

boolean — Tab Automatically displays duplicate icon if true

$noLink

$noLink : boolean

Type

boolean — Content line is clickable if true

$requiredDatabase

$requiredDatabase : boolean

Type

boolean — select other required fields

$colorOnBackground

$colorOnBackground : boolean

Type

boolean — Tab Automatically displays '$color' as background color on listing if true

$fieldImageSettings

$fieldImageSettings : array

Type

array — Name and directory where class image are located

$imageType

$imageType : string

Type

string — Image type

$fieldsDisplay

$fieldsDisplay : array

Type

array — Fields to display in list

$optionTitle

$optionTitle : 

Type

$shopLinkType

$shopLinkType : string

Type

string — shop

$shopShareDatas

$shopShareDatas : boolean

Type

boolean

$_errors

$_errors : array

Type

array — Errors displayed after post processing

$tabAccess

$tabAccess : array

Type

array — tabAccess

$specificConfirmDelete

$specificConfirmDelete : string

Type

string — specificConfirmDelete

$currentIndex

$currentIndex : 

Type

$smarty

$smarty : 

Type

$_fieldsOptions

$_fieldsOptions : 

Type

$optionsList

$optionsList : array

Type

array

$context

$context : \Context

Type

\Context

$ajax

$ajax : 

Type

$ignore_sleep

$ignore_sleep : boolean

if true, ajax-tab will not wait 1 sec

Type

boolean

$tabParenting

$tabParenting : 

Type

$identifier

$identifier : string

Type

string — Object identifier inside the associated table

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

$_list

$_list : array

Type

array — Cache for query results

$_listTotal

$_listTotal : integer

Type

integer — Number of results in list

$_filter

$_filter : array

Type

array — WHERE clause determined by filter fields

$_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)

$_orderBy

$_orderBy : string

Type

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

$_defaultOrderBy

$_defaultOrderBy : string

Type

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

$_orderWay

$_orderWay : string

Type

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

$maxImageSize

$maxImageSize : integer

Type

integer — Max image size for upload As of 1.5 it is recommended to not set a limit to max image size

$_conf

$_conf : array

Type

array — Confirmations displayed after post processing

$_object

$_object : object

Type

object — Object corresponding to the tab

$identifiersDnd

$identifiersDnd : 

Type

$_redirect

$_redirect : boolean

Type

boolean — Redirect or not ater a creation

$formOptions

$formOptions : boolean

Type

boolean — If false, don't add form tags in options forms

$_languages

$_languages : 

Type

$_defaultFormLanguage

$_defaultFormLanguage : 

Type

$_includeObj

$_includeObj : 

Type

$_includeVars

$_includeVars : 

Type

$_includeContainer

$_includeContainer : 

Type

Methods

__construct()

__construct() 

displayAjax()

displayAjax() : void

ajaxDisplay is the default ajax return sytem

display()

display() 

Manage page display (form, list.

..)

displayRequiredFields()

displayRequiredFields() 

includeSubTab()

includeSubTab(  $methodname,   $actions = array()) 

Parameters

$methodname
$actions

validateRules()

validateRules(string  $className = false) 

Manage page display (form, list.

..)

Parameters

string $className

Allow to validate a different class than the current one

deleteImage()

deleteImage(integer  $id) 

Overload this method for custom checking

Parameters

integer $id

Object id used for deleting images

ajaxPreProcess()

ajaxPreProcess() : void

ajaxPreProcess is a method called in ajax-tab.php before displayConf().

ajaxProcess()

ajaxProcess() : void

ajaxProcess is the default handle method for request with ajax-tab.php

postProcess()

postProcess() 

Manage page processing

beforeUpdateOptions()

beforeUpdateOptions() 

Can be overriden

displayErrors()

displayErrors() 

Display errors

displayWarning()

displayWarning(string  $warn) 

Display a warning message

Parameters

string $warn

Warning message to display

displayConf()

displayConf() 

Display confirmations

getList()

getList(integer  $id_lang, string  $orderBy = NULL,   $orderWay = 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 $orderBy

ORDER BY clause

$orderWay
integer $start

Offset in LIMIT clause

integer $limit

Row count in LIMIT clause

$id_lang_shop

displayImage()

displayImage(integer  $id, string  $image, integer  $size, integer  $id_image = NULL, string  $token = NULL, boolean  $disableCache = false) 

Display image aside object form

Parameters

integer $id

Object id

string $image

Local image filepath

integer $size

Image width

integer $id_image

Image id (for products with several images)

string $token

Employee token used in the image deletion link

boolean $disableCache

When turned on a timestamp will be added to the image URI to disable the HTTP cache

displayListHeader()

displayListHeader(  $token = NULL) 

Display list header (filtering, pagination and column names)

Parameters

$token

displayTop()

displayTop() 

displayList()

displayList() 

Display list

displayListContent()

displayListContent(  $token = NULL) 

Parameters

$token

displayListFooter()

displayListFooter(  $token = NULL) 

Close list table and submit button

Parameters

$token

displayOptionsList()

displayOptionsList() 

Options lists

displayTopOptionCategory()

displayTopOptionCategory(  $category,   $data) 

Can be overriden

Parameters

$category
$data

displayBottomOptionCategory()

displayBottomOptionCategory(  $category,   $data) 

Can be overriden

Parameters

$category
$data

displayOptionTypeSelect()

displayOptionTypeSelect(  $key,   $field,   $value) 

Type = select

Parameters

$key
$field
$value

displayOptionTypeBool()

displayOptionTypeBool(  $key,   $field,   $value) 

Type = bool

Parameters

$key
$field
$value

displayOptionTypeRadio()

displayOptionTypeRadio(  $key,   $field,   $value) 

Type = radio

Parameters

$key
$field
$value

displayOptionTypeText()

displayOptionTypeText(  $key,   $field,   $value) 

Type = text

Parameters

$key
$field
$value

displayOptionTypePassword()

displayOptionTypePassword(  $key,   $field,   $value) 

Type = password

Parameters

$key
$field
$value

displayOptionTypeTextarea()

displayOptionTypeTextarea(  $key,   $field,   $value) 

Type = textarea

Parameters

$key
$field
$value

displayOptionTypeFile()

displayOptionTypeFile(  $key,   $field,   $value) 

Type = file

Parameters

$key
$field
$value

displayOptionTypeImage()

displayOptionTypeImage(  $key,   $field,   $value) 

Type = image

Parameters

$key
$field
$value

displayOptionTypeTextLang()

displayOptionTypeTextLang(  $key,   $field,   $value) 

Type = textLang

Parameters

$key
$field
$value

displayOptionTypeTextareaLang()

displayOptionTypeTextareaLang(  $key,   $field,   $value) 

Type = TextareaLang

Parameters

$key
$field
$value

displayOptionTypeSelectLang()

displayOptionTypeSelectLang(  $key,   $field,   $value) 

Type = selectLang

Parameters

$key
$field
$value

displayOptionTypePrice()

displayOptionTypePrice(  $key,   $field,   $value) 

Type = price

Parameters

$key
$field
$value

displayOptionTypeDisabled()

displayOptionTypeDisabled(  $key,   $field,   $value) 

Type = disabled

Parameters

$key
$field
$value

getFieldValue()

getFieldValue(object  $obj, string  $key, integer  $id_lang = NULL,   $id_shop = 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)

$id_shop

Returns

string

displayForm()

displayForm(  $firstCall = true) 

Display form

Parameters

$firstCall

viewDetails()

viewDetails() 

Display object details

viewAccess()

viewAccess(  $disable = false) : boolean

Check rights to view the current tab

Parameters

$disable

Returns

boolean

checkToken()

checkToken() 

Check for security token

displayFlags()

displayFlags(array  $languages, integer  $default_language, string  $ids, string  $id, boolean  $return = false, boolean  $use_vars_instead_of_ids = false) 

Display flags in forms for translations

Parameters

array $languages

All languages available

integer $default_language

Default language id

string $ids

Multilingual div ids in form

string $id

Current div id]

boolean $return

define the return way : false for a display, true for a return

boolean $use_vars_instead_of_ids

use an js vars instead of ids seperate by "¤"

l()

l(mixed  $string, string  $class = 'AdminTab', \boolan  $addslashes = FALSE, boolean  $htmlentities = TRUE) : string

use translations files to replace english expression.

Parameters

mixed $string

term or expression in english

string $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

updateAssoShop()

updateAssoShop(  $id_object = false) 

Parameters

$id_object

getAssoShop()

getAssoShop(  $table,   $id_object = false) 

Parameters

$table
$id_object

updateOptions()

updateOptions(string  $token) 

Update options and preferences

Parameters

string $token

validateField()

validateField(  $value,   $field) 

Parameters

$value
$field

uploadImage()

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

Parameters

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

postImage()

postImage(integer  $id) : boolean

Overload this method for custom checking

Parameters

integer $id

Object id used for deleting images

Returns

boolean

copyFromPost()

copyFromPost(  $object, string  $table) 

Copy datas from $_POST to object

Parameters

$object
string $table

Object table

displayAddButton()

displayAddButton() 

_displayEnableLink()

_displayEnableLink(  $token,   $id,   $value,   $active,   $id_category = NULL,   $id_product = NULL) 

Parameters

$token
$id
$value
$active
$id_category
$id_product

_displayDuplicate()

_displayDuplicate(  $token = NULL,   $id) 

Parameters

$token
$id

_displayViewLink()

_displayViewLink(  $token = NULL,   $id) 

Parameters

$token
$id

_displayEditLink()

_displayEditLink(  $token = NULL,   $id) 

Parameters

$token
$id

_displayDeleteLink()

_displayDeleteLink(  $token = NULL,   $id) 

Parameters

$token
$id

loadObject()

loadObject(boolean  $opt = false) : object

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

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

filterToField()

filterToField(  $key,   $filter) : mixed

Parameters

$key
$filter

Returns

mixed

warnDomainName()

warnDomainName() 

displayAssoShop()

displayAssoShop() 

getCurrentUrl()

getCurrentUrl(array  $remove = array()) : string

Get current URL

Parameters

array $remove

List of keys to remove from URL

Returns

string