Skip to content

Latest commit

 

History

History
3234 lines (1637 loc) · 80.2 KB

class.AdminEmployeesControllerCore.md

File metadata and controls

3234 lines (1637 loc) · 80.2 KB

Class AdminEmployeesControllerCore

Contents

Properties

Methods

Properties

$profiles_array

private array $profiles_array = array()

$themes

private array $themes = array()

$_defaultOrderBy

protected string $_defaultOrderBy = false

$_defaultOrderWay

protected mixed $_defaultOrderWay = 'ASC'

$_filter

protected array $_filter

$_group

protected string $_group

$_having

protected string $_having

$_includeContainer

protected mixed $_includeContainer = true

$_join

protected string $_join

$_languages

public mixed $_languages = array()

$_list

protected array $_list = array()

$_listTotal

protected integer $_listTotal

$_orderBy

protected string $_orderBy

$_orderWay

protected string $_orderWay

$_pagination

protected array $_pagination = array(20, 50, 100, 300)

$_redirect

protected boolean $_redirect = true

$_select

protected string $_select

$_tmpTableFilter

protected array $_tmpTableFilter = ''

$_where

protected string $_where

$action

protected mixed $action

$actions

protected array $actions = array()

$actions_available

protected array $actions_available = array('view', 'edit', 'delete', 'duplicate')

$allow_employee_form_lang

public mixed $allow_employee_form_lang

$base_tpl_form

public mixed $base_tpl_form = null

$base_tpl_view

public mixed $base_tpl_view = null

$bo_theme

protected mixed $bo_theme

$boxes

protected array $boxes

$bulk_actions

protected array $bulk_actions

$cache_lang

public array $cache_lang = array()

$className

public string $className

$colorOnBackground

protected mixed $colorOnBackground

$confirmations

public mixed $confirmations = array()

$content

public mixed $content

$currentIndex

public mixed $currentIndex

$default_form_language

public mixed $default_form_language

$deleted

protected boolean $deleted = false

$display

protected mixed $display

$errors

public array $errors = array()

$fieldImageSettings

public array $fieldImageSettings = array()

$fieldsDisplay

protected array $fieldsDisplay

$fields_form

protected array $fields_form

$fields_form_override

protected \override $fields_form_override

$fields_value

public mixed $fields_value = false

$filter

protected boolean $filter

$id

public integer $id = -1

$id_object

protected \current $id_object

$identifier

protected string $identifier = false

$identifiersDnd

protected mixed $identifiersDnd = array('id_product' => 'id_product', 'id_category' => 'id_category_to_move', 'id_cms_category' => 'id_cms_category_to_move', 'id_cms' => 'id_cms', 'id_attribute' => 'id_attribute')

$imageType

public string $imageType = 'jpg'

$informations

public mixed $informations = array()

$is_cms

protected mixed $is_cms = false

$is_dnd_identifier

protected mixed $is_dnd_identifier = false

$lang

public boolean $lang = false

$layout

public mixed $layout = 'layout.tpl'

$list_no_link

protected boolean $list_no_link = false

$list_simple_header

protected \define $list_simple_header

$list_skip_actions

protected array $list_skip_actions = array()

$lite_display

protected mixed $lite_display = false

$meta_title

public mixed $meta_title = 'Administration panel'

$multiple_fieldsets

public boolean $multiple_fieldsets = false

$noLink

protected mixed $noLink

$noTabLink

public array $noTabLink = array('AdminCatalog', 'AdminTools', 'AdminStock', 'AdminAccounting')

$object

protected \instanciation $object

$options

protected array $options

$path

public mixed $path

$required_database

public mixed $required_database = false

$required_fields

public array $required_fields = array()

$row_hover

protected boolean $row_hover = true

$shopLink

protected mixed $shopLink

$shopLinkType

public string $shopLinkType

$shopShareDatas

public mixed $shopShareDatas = false

$show_toolbar

protected boolean $show_toolbar = true

$show_toolbar_options

protected boolean $show_toolbar_options = false

$specificConfirmDelete

protected mixed $specificConfirmDelete = null

$tabAccess

public array $tabAccess

$tab_module_list

public array $tab_module_list

$table

public string $table

$template

public mixed $template = 'content.tpl'

$token

public string $token

$toolbar_btn

protected array $toolbar_btn = null

$toolbar_fix

protected array $toolbar_fix = true

$toolbar_title

protected \define $toolbar_title

$tpl_delete_link_vars

public mixed $tpl_delete_link_vars = array()

$tpl_folder

public mixed $tpl_folder

$tpl_form_vars

public mixed $tpl_form_vars = array()

$tpl_list_vars

public mixed $tpl_list_vars = array()

$tpl_option_vars

public mixed $tpl_option_vars = array()

$tpl_required_fields_vars

public mixed $tpl_required_fields_vars = array()

$tpl_view_vars

public mixed $tpl_view_vars = array()

$warnings

public mixed $warnings = array()

$ajax

protected boolean $ajax = false

$content_only

protected string $content_only = false

$context

protected \Context $context

$css_files

public array $css_files = array()

$display_footer

protected string $display_footer

$display_header

protected boolean $display_header

$js_files

public array $js_files = array()

$json

protected mixed $json = false

$redirect_after

protected mixed $redirect_after = null

$status

protected mixed $status = ''

Methods

__construct

mixed AdminEmployeesControllerCore::__construct()

_childValidation

mixed AdminEmployeesControllerCore::_childValidation()

addCSS

true ControllerCore::addCSS(mixed $css_uri, string $css_media_type)

Add a new stylesheet in page header.

Arguments

  • $css_uri mixed - Path to css file, or list of css files like this : array(array(uri => media_type), ...)
  • $css_media_type string

addJS

void ControllerCore::addJS(mixed $js_uri)

Add a new javascript file in page header.

Arguments

  • $js_uri mixed

addJquery

void ControllerCore::addJquery($version, $folder, $minifier)

Add a new javascript file in page header.

Arguments

  • $version mixed
  • $folder mixed
  • $minifier mixed

addJqueryPlugin

void ControllerCore::addJqueryPlugin($name, $folder)

Add a new javascript file in page header.

Arguments

  • $name mixed
  • $folder mixed

addJqueryUI

void ControllerCore::addJqueryUI($component, $theme, $check_dependencies)

Add a new javascript file in page header.

Arguments

  • $component mixed
  • $theme mixed
  • $check_dependencies mixed

addRowAction

mixed AdminControllerCore::addRowAction($action)

Declare an action to use for each row in the list

Arguments

  • $action mixed

addRowActionSkipList

mixed AdminControllerCore::addRowActionSkipList($action, $list)

Add an action to use for each row in the list

Arguments

  • $action mixed
  • $list mixed

afterAdd

mixed AdminControllerCore::afterAdd($object)

Arguments

  • $object mixed

afterDelete

boolean AdminControllerCore::afterDelete(object $object, $oldId)

Called before deletion

Arguments

  • $object object - Object
  • $oldId mixed

afterImageUpload

boolean AdminControllerCore::afterImageUpload()

Check rights to view the current tab

afterUpdate

mixed AdminControllerCore::afterUpdate($object)

Arguments

  • $object mixed

ajaxProcessHelpAccess

mixed AdminControllerCore::ajaxProcessHelpAccess()

beforeAdd

boolean AdminControllerCore::beforeAdd(object $object)

Called before Add

Arguments

  • $object object - Object

beforeDelete

boolean AdminControllerCore::beforeDelete(object $object)

Called before deletion

Arguments

  • $object object - Object

beforeUpdateOptions

mixed AdminControllerCore::beforeUpdateOptions()

Can be overriden

checkAccess

mixed AdminControllerCore::checkAccess()

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

checkToken

mixed AdminControllerCore::checkToken()

Check for security token

copyFromPost

mixed AdminControllerCore::copyFromPost($object, string $table)

Copy datas from $_POST to object

Arguments

  • $object mixed
  • $table string - Object table

createTemplate

\Template AdminControllerCore::createTemplate(string $tpl_name)

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

Arguments

  • $tpl_name string - filename

display

mixed AdminControllerCore::display()

displayAjax

mixed AdminControllerCore::displayAjax()

displayFooter

mixed ControllerCore::displayFooter($display)

Arguments

  • $display mixed

displayHeader

mixed ControllerCore::displayHeader($display)

Arguments

  • $display mixed

displayInformation

mixed AdminControllerCore::displayInformation(string $msg)

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

Arguments

  • $msg string

displayNoSmarty

mixed AdminControllerCore::displayNoSmarty()

displayRequiredFields

mixed AdminControllerCore::displayRequiredFields()

prepare the view to display the required fields form

displayWarning

mixed AdminControllerCore::displayWarning(string $msg)

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

Arguments

  • $msg string

filterToField

mixed AdminControllerCore::filterToField($key, $filter)

Arguments

  • $key mixed
  • $filter mixed

getAssoShop

mixed AdminControllerCore::getAssoShop(string $table, integer $id_object)

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

Arguments

  • $table string
  • $id_object integer

getController

mixed ControllerCore::getController(string $class_name, boolean $auth, boolean $ssl)

Get an instance of a controller

Arguments

  • $class_name string
  • $auth boolean
  • $ssl boolean

getFieldValue

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

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

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

Arguments

  • $obj object - Object
  • $key string - Field name
  • $id_lang integer - Language id (optional)

getFieldsValue

array AdminControllerCore::getFieldsValue(object $obj)

Return the list of fields value

Arguments

  • $obj object - Object

getLanguages

mixed AdminControllerCore::getLanguages()

getList

mixed AdminControllerCore::getList(integer $id_lang, string $order_by, $order_way, integer $start, integer $limit, $id_lang_shop)

Get the current objects' list form the database

Arguments

  • $id_lang integer - Language used for display
  • $order_by string - ORDER BY clause
  • $order_way mixed
  • $start integer - Offset in LIMIT clause
  • $limit integer - Row count in LIMIT clause
  • $id_lang_shop mixed

getTranslationsFlags

string AdminControllerCore::getTranslationsFlags(array $languages, integer $default_language, string $ids, string $id, $return, boolean $use_vars_instead_of_ids)

Arguments

  • $languages array - All languages available
  • $default_language integer - Default language id
  • $ids string - Multilingual div ids in form
  • $id string - Current div id]
  • $return mixed
  • $use_vars_instead_of_ids boolean - use an js vars instead of ids seperate by "¤"

init

mixed AdminControllerCore::init()

Init context and dependencies, handles POST and GET

initContent

mixed AdminEmployeesControllerCore::initContent()

initCursedPage

void AdminControllerCore::initCursedPage()

initialize the invalid doom page of death

initFooter

mixed AdminControllerCore::initFooter()

Assign smarty variables for the footer

initHeader

mixed AdminControllerCore::initHeader()

Assign smarty variables for the header

initModuleCacheTab

mixed AdminControllerCore::initModuleCacheTab()

Init a cache list of tab existing in a module

initProcess

mixed AdminControllerCore::initProcess()

Retrieve GET and POST value and translate them to actions

initToolbar

mixed AdminControllerCore::initToolbar()

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

uses override to specifically add, modify or remove items

initToolbarTitle

void AdminControllerCore::initToolbarTitle()

set default toolbar_title to admin breadcrumb

l

string AdminControllerCore::l(mixed $string, string $class, \boolan $addslashes, boolean $htmlentities)

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

Arguments

  • $string mixed - term or expression in english
  • $class string - name of the class, without "Controller" suffix
  • $addslashes boolan - if set to true, the return value will pass through addslashes(). Otherwise, stripslashes().
  • $htmlentities boolean - if set to true(default), the return value will pass through htmlentities($string, ENT_QUOTES, 'utf-8')

loadObject

object AdminControllerCore::loadObject(boolean $opt)

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

Arguments

  • $opt boolean - Return an empty object if load fail

postImage

boolean AdminControllerCore::postImage(integer $id)

Overload this method for custom checking

Arguments

  • $id integer - Object id used for deleting images

postProcess

mixed AdminEmployeesControllerCore::postProcess()

processAdd

mixed AdminControllerCore::processAdd(string $token)

Object creation

Arguments

  • $token string

processBulkAffectZone

mixed AdminControllerCore::processBulkAffectZone($token)

Arguments

  • $token mixed

processBulkDelete

boolean AdminControllerCore::processBulkDelete($token)

Delete multiple items

Arguments

  • $token mixed

processDelete

mixed AdminControllerCore::processDelete(string $token)

Object Delete

Arguments

  • $token string

processDeleteImage

mixed AdminControllerCore::processDeleteImage(string $token)

Object Delete images

Arguments

  • $token string

processFilter

mixed AdminControllerCore::processFilter()

Set the filters used for the list display

processPosition

mixed AdminControllerCore::processPosition(string $token)

Change object position

Arguments

  • $token string

processResetFilters

mixed AdminControllerCore::processResetFilters()

Cancel all filters for this tab

processSave

mixed AdminControllerCore::processSave($token)

Call the right method for creating or updating object

Arguments

  • $token mixed

processStatus

mixed AdminControllerCore::processStatus(string $token)

Change object status (active, inactive)

Arguments

  • $token string

processUpdate

mixed AdminControllerCore::processUpdate(string $token)

Object update

Arguments

  • $token string

processUpdateFields

mixed AdminControllerCore::processUpdateFields(string $token)

Change object required fields

Arguments

  • $token string

processUpdateOptions

mixed AdminControllerCore::processUpdateOptions(string $token)

Update options and preferences

Arguments

  • $token string

redirect

mixed AdminControllerCore::redirect()

renderForm

mixed AdminEmployeesControllerCore::renderForm()

renderList

mixed AdminEmployeesControllerCore::renderList()

renderOptions

mixed AdminControllerCore::renderOptions()

Function used to render the options for this controller

renderView

mixed AdminControllerCore::renderView()

Override to render the view page

run

mixed ControllerCore::run()

Start controller process (this method shouldn't be overriden !)

setHelperDisplay

void AdminControllerCore::setHelperDisplay(\Helper $helper)

this function set various display option for helper list

Arguments

setMedia

mixed AdminControllerCore::setMedia()

setTemplate

mixed ControllerCore::setTemplate($template)

Arguments

  • $template mixed

translate

string AdminControllerCore::translate(mixed $string, string $class, \boolan $addslashes, boolean $htmlentities)

use translations files to replace english expression.

Arguments

  • $string mixed - term or expression in english
  • $class string - the classname (without "Controller" suffix)
  • $addslashes boolan - if set to true, the return value will pass through addslashes(). Otherwise, stripslashes().
  • $htmlentities boolean - if set to true(default), the return value will pass through htmlentities($string, ENT_QUOTES, 'utf-8')

updateAssoShop

mixed AdminControllerCore::updateAssoShop(integer $id_object, integer $new_id_object)

Update the associations of shops

Arguments

  • $id_object integer
  • $new_id_object integer

uploadImage

mixed AdminControllerCore::uploadImage($id, $name, $dir, $ext, $width, $height)

Arguments

  • $id mixed
  • $name mixed
  • $dir mixed
  • $ext mixed
  • $width mixed
  • $height mixed

validateField

mixed AdminControllerCore::validateField($value, $field)

Arguments

  • $value mixed
  • $field mixed

validateRules

mixed AdminControllerCore::validateRules($class_name)

Manage page display (form, list.

..)

Arguments

  • $class_name mixed

viewAccess

boolean AdminControllerCore::viewAccess(boolean $disable)

Check rights to view the current tab

Arguments

  • $disable boolean

viewDetails

mixed AdminControllerCore::viewDetails()

Display object details