Skip to content

Latest commit

 

History

History
3688 lines (1846 loc) · 90.5 KB

class.AdminBackupControllerCore.md

File metadata and controls

3688 lines (1846 loc) · 90.5 KB

Class AdminBackupControllerCore

Contents

Properties

Methods

Properties

$sort_by

protected string $sort_by = 'date'

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

$_listsql

protected string $_listsql = ''

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

$allow_export

protected mixed $allow_export = false

$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

$breadcrumbs

protected mixed $breadcrumbs

Current breadcrumb position as an array of tab names

$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

$controller_name

public \current $controller_name

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

$explicitSelect

protected string $explicitSelect = false

$fieldImageSettings

public array $fieldImageSettings = array()

$fields_form

protected array $fields_form

$fields_form_override

protected \override $fields_form_override

$fields_list

protected array $fields_list

$fields_options

protected array $fields_options

$fields_value

public mixed $fields_value = false

$filter

protected boolean $filter

$filter_modules_list

protected array $filter_modules_list = null

$helper

protected \Helper $helper

$id

public integer $id = -1

$id_object

protected \current $id_object

$identifier

protected string $identifier = false

$imageType

public string $imageType = 'jpg'

$informations

public mixed $informations = array()

$is_cms

protected mixed $is_cms = 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

protected mixed $meta_title

$modules_list

protected array $modules_list = array()

$multiple_fieldsets

public boolean $multiple_fieldsets = false

$multishop_context

public mixed $multishop_context = -1

$multishop_context_group

public mixed $multishop_context_group = true

$noLink

protected mixed $noLink

$object

protected \instanciation $object

$path

public mixed $path

$position_identifier

protected string $position_identifier

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

protected mixed $tab_modules_list = array('default_list' => array(), 'slider_list' => array())

$table

public string $table

$template

public mixed $template = 'content.tpl'

$token

public string $token

$toolbar_btn

protected array $toolbar_btn = null

$toolbar_scroll

protected boolean $toolbar_scroll = 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()

$translationsTab

protected mixed $translationsTab = array()

Display modules list

$warnings

public mixed $warnings = array()

$ajax

public boolean $ajax = false

$content_only

protected string $content_only = false

$context

protected \Context $context

$controller_type

public mixed $controller_type

$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 AdminBackupControllerCore::__construct()

_childValidation

mixed AdminControllerCore::_childValidation()

Overload this method for custom checking

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

addToolBarModulesListButton

mixed AdminControllerCore::addToolBarModulesListButton()

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

displayModuleOptions

mixed AdminControllerCore::displayModuleOptions($module, $output_type, $back)

Arguments

  • $module mixed
  • $output_type mixed
  • $back mixed

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

fillModuleData

mixed AdminControllerCore::fillModuleData($module, $output_type, $back)

Arguments

  • $module mixed
  • $output_type mixed
  • $back mixed

filterToField

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

Arguments

  • $key mixed
  • $filter mixed

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 AdminBackupControllerCore::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop)

Arguments

  • $id_lang mixed
  • $order_by mixed
  • $order_way mixed
  • $start mixed
  • $limit mixed
  • $id_lang_shop mixed

getModulesList

mixed AdminControllerCore::getModulesList($filter_modules_list)

Arguments

  • $filter_modules_list mixed

getSelectedAssoShop

array AdminControllerCore::getSelectedAssoShop(string $table)

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

Arguments

  • $table string

init

mixed AdminControllerCore::init()

Init context and dependencies, handles POST and GET

initBreadcrumbs

mixed AdminControllerCore::initBreadcrumbs()

Set breadcrumbs array for the controller page

initContent

mixed AdminBackupControllerCore::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

initProcess

mixed AdminControllerCore::initProcess()

Retrieve GET and POST value and translate them to actions

initShopContext

mixed AdminControllerCore::initShopContext()

initTabModuleList

mixed AdminControllerCore::initTabModuleList()

init tab modules list and add button in toolbar

initToolbar

mixed AdminBackupControllerCore::initToolbar()

initToolbarTitle

void AdminControllerCore::initToolbarTitle()

set default toolbar_title to admin breadcrumb

initViewDownload

mixed AdminBackupControllerCore::initViewDownload()

intSort

mixed AdminBackupControllerCore::intSort($a, $b)

Arguments

  • $a mixed
  • $b mixed

isFresh

mixed AdminControllerCore::isFresh($file, $timeout)

Arguments

  • $file mixed
  • $timeout mixed

isXmlHttpRequest

boolean ControllerCore::isXmlHttpRequest()

jsonConfirmation

mixed AdminControllerCore::jsonConfirmation($message)

Shortcut to set up a json success payload

Arguments

  • $message mixed - success message

jsonError

mixed AdminControllerCore::jsonError($message)

Shortcut to set up a json error payload

Arguments

  • $message mixed - error message

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
  • $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 AdminBackupControllerCore::loadObject(boolean $opt)

Load class object using identifier in $_GET (if possible) otherwise return an empty object This method overrides the one in AdminTab because AdminTab assumes the id is a UnsignedInt "Backups" Directory in admin directory must be writeable (CHMOD 777)

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 AdminBackupControllerCore::postProcess()

processAdd

mixed AdminControllerCore::processAdd()

Object creation

processBulkAffectZone

mixed AdminControllerCore::processBulkAffectZone()

processBulkDelete

boolean AdminControllerCore::processBulkDelete()

Delete multiple items

processBulkDisableSelection

boolean AdminControllerCore::processBulkDisableSelection()

Disable multiple items

processBulkEnableSelection

boolean AdminControllerCore::processBulkEnableSelection()

Enable multiple items

processBulkStatusSelection

boolean AdminControllerCore::processBulkStatusSelection($status)

Toggle status of multiple items

Arguments

  • $status mixed

processDelete

mixed AdminControllerCore::processDelete()

Object Delete

processDeleteImage

mixed AdminControllerCore::processDeleteImage()

Object Delete images

processExport

mixed AdminControllerCore::processExport()

processFilter

mixed AdminControllerCore::processFilter()

Set the filters used for the list display

processPosition

mixed AdminControllerCore::processPosition()

Change object position

processResetFilters

mixed AdminControllerCore::processResetFilters()

Cancel all filters for this tab

processSave

mixed AdminControllerCore::processSave()

Call the right method for creating or updating object

processStatus

mixed AdminControllerCore::processStatus()

Change object status (active, inactive)

processUpdate

mixed AdminControllerCore::processUpdate()

Object update

processUpdateFields

mixed AdminControllerCore::processUpdateFields()

Change object required fields

processUpdateOptions

mixed AdminControllerCore::processUpdateOptions()

Update options and preferences

redirect

mixed AdminControllerCore::redirect()

refresh

mixed AdminControllerCore::refresh($file_to_refresh, $external_file)

Arguments

  • $file_to_refresh mixed
  • $external_file mixed

renderForm

mixed AdminControllerCore::renderForm()

Function used to render the form for this controller

renderList

mixed AdminBackupControllerCore::renderList()

renderModulesList

mixed AdminControllerCore::renderModulesList()

renderOptions

mixed AdminControllerCore::renderOptions()

Function used to render the options for this controller

renderView

mixed AdminBackupControllerCore::renderView()

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

smartyOutputContent

mixed ControllerCore::smartyOutputContent($content)

Arguments

  • $content mixed

strSort

mixed AdminBackupControllerCore::strSort($a, $b)

Arguments

  • $a mixed
  • $b mixed

updateAssoShop

mixed AdminControllerCore::updateAssoShop(integer $id_object)

Update the associations of shops

Arguments

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