Skip to content

Latest commit

 

History

History
2675 lines (1372 loc) · 59.7 KB

class.ModuleGridEngineCore.md

File metadata and controls

2675 lines (1372 loc) · 59.7 KB

Class ModuleGridEngineCore

Contents

Properties

Methods

Properties

$_type

protected mixed $_type

$_INSTANCE

protected \protected $_INSTANCE = array()

$_confirmations

protected \protected $_confirmations = array()

$_errors

protected \protected $_errors = array()

$_generate_config_xml_mode

protected \protected $_generate_config_xml_mode = false

$_lang

protected array $_lang = array()

$_path

protected string $_path = null

$active

public boolean $active = false

$additional_description

public mixed $additional_description

$allow_push

public \allow $allow_push

$author

public string $author

$avg_rate

public mixed $avg_rate

$badges

public mixed $badges

$cache_permissions

protected \protected $cache_permissions = array()

$classInModule

public array $classInModule = array()

$compatibility

public mixed $compatibility

$context

protected \Context $context

$controllers

public array $controllers = array()

$current_subtemplate

protected \currentSmartySubTemplate $current_subtemplate = null

$database_version

public mixed $database_version

$dependencies

public array $dependencies = array()

$description

public string $description

$description_full

public mixed $description_full

$displayName

public string $displayName

$enable_device

public mixed $enable_device = 7

$hosted_modules_blacklist

public mixed $hosted_modules_blacklist = array('autoupgrade')

$id

public integer $id = null

$identifier

protected \protected $identifier = 'id_module'

$l_cache

protected \protected $l_cache = array()

$limited_countries

public array $limited_countries = array()

$local_path

protected string $local_path = null

$module_key

public string $module_key = ''

$modules_cache

protected \protected $modules_cache

$name

public string $name

$nb_rates

public mixed $nb_rates

$need_instance

public integer $need_instance = 1

$ps_versions_compliancy

public array $ps_versions_compliancy = array()

$push_time_limit

public mixed $push_time_limit = 180

$registered_version

public string $registered_version

$smarty

protected \Smarty_Data $smarty

$tab

public string $tab = null

$table

protected \protected $table = 'module'

$trusted

public boolean $trusted = false

$update_translations_after_install

protected mixed $update_translations_after_install = true

$version

public float $version

$warning

public string $warning

Methods

__construct

mixed ModuleGridEngineCore::__construct($type)

Arguments

  • $type mixed

_clearCache

mixed ModuleCore::_clearCache($template, $cache_id, $compile_id)

Arguments

  • $template mixed
  • $cache_id mixed
  • $compile_id mixed

_generateConfigXml

mixed ModuleCore::_generateConfigXml()

_getApplicableTemplateDir

mixed ModuleCore::_getApplicableTemplateDir($template)

Arguments

  • $template mixed

_isTemplateOverloaded

mixed ModuleCore::_isTemplateOverloaded($template)

Arguments

  • $template mixed

_isTemplateOverloadedStatic

mixed ModuleCore::_isTemplateOverloadedStatic($module_name, $template)

Arguments

  • $module_name mixed
  • $template mixed

addOverride

boolean ModuleCore::addOverride(string $classname)

Add all methods in a module override to the override class

Arguments

  • $classname string

adminDisplayInformation

mixed ModuleCore::adminDisplayInformation(string $msg)

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

Arguments

  • $msg string

adminDisplayWarning

mixed ModuleCore::adminDisplayWarning(string $msg)

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

Arguments

  • $msg string

checkCompliancy

mixed ModuleCore::checkCompliancy()

checkModuleFromAddonsApi

boolean ModuleCore::checkModuleFromAddonsApi($module_name)

Create the Addons API call from the module name only

Arguments

  • $module_name mixed

cleanPositions

mixed ModuleCore::cleanPositions($id_hook, $shop_list)

Arguments

  • $id_hook mixed
  • $shop_list mixed

configXmlStringFormat

mixed ModuleCore::configXmlStringFormat($string)

Arguments

  • $string mixed

disable

mixed ModuleCore::disable(boolean $forceAll)

Desactivate current module.

Arguments

  • $forceAll boolean - If true, disable module for all shop

disableByName

true ModuleCore::disableByName(array|string $name)

This function disable module $name. If an $name is an array, this will disable all of them

Arguments

  • $name array|string

disableDevice

mixed ModuleCore::disableDevice($device)

Arguments

  • $device mixed

display

mixed ModuleCore::display($file, $template, $cacheId, $compileId)

Arguments

  • $file mixed
  • $template mixed
  • $cacheId mixed
  • $compileId mixed

displayConfirmation

mixed ModuleCore::displayConfirmation($string)

Arguments

  • $string mixed

displayError

mixed ModuleCore::displayError($error)

Arguments

  • $error mixed

displayFlags

mixed ModuleCore::displayFlags(array $languages, integer $default_language, string $ids, string $id, boolean $return, boolean $use_vars_instead_of_ids)

Display flags in forms for translations

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 boolean - define the return way : false for a display, true for a return
  • $use_vars_instead_of_ids boolean - use an js vars instead of ids seperate by "¤"

editExceptions

boolean ModuleCore::editExceptions($id_hook, array $excepts)

Edit exceptions for module->Hook

Arguments

  • $id_hook mixed
  • $excepts array - List of shopID and file name

enable

mixed ModuleCore::enable(boolean $forceAll)

Activate current module.

Arguments

  • $forceAll boolean - If true, enable module for all shop

enableByName

true ModuleCore::enableByName(array|string $name)

This function enable module $name. If an $name is an array, this will enable all of them

Arguments

  • $name array|string

enableDevice

mixed ModuleCore::enableDevice($device)

Arguments

  • $device mixed

findTranslation

mixed ModuleCore::findTranslation($name, $string, $source)

Arguments

  • $name mixed
  • $string mixed
  • $source mixed

generateTrustedXml

mixed ModuleCore::generateTrustedXml()

Generate XML files for trusted and untrusted modules

getAuthorizedModules

mixed ModuleCore::getAuthorizedModules($group_id)

Get Unauthorized modules for a client group

Arguments

  • $group_id mixed

getCacheId

mixed ModuleCore::getCacheId($name)

Arguments

  • $name mixed

getConfirmations

array ModuleCore::getConfirmations()

Get module messages confirmation

getCurrentSubTemplate

mixed ModuleCore::getCurrentSubTemplate($template, $cache_id, $compile_id)

Arguments

  • $template mixed
  • $cache_id mixed
  • $compile_id mixed

getErrors

array ModuleCore::getErrors()

Get module errors

getExceptions

mixed ModuleCore::getExceptions($id_hook, $dispatch)

Arguments

  • $id_hook mixed
  • $dispatch mixed

getGridEngines

mixed ModuleGridEngineCore::getGridEngines()

getInstanceById

\Module ModuleCore::getInstanceById(integer $id_module)

Return an instance of the specified module

Arguments

  • $id_module integer - Module ID

getInstanceByName

\Module ModuleCore::getInstanceByName(string $module_name)

Return an instance of the specified module

Arguments

  • $module_name string - Module name

getLocalPath

string ModuleCore::getLocalPath()

Get local path for module

getModuleIdByName

integer ModuleCore::getModuleIdByName($name)

Get id module by name

Arguments

  • $name mixed

getModuleName

mixed ModuleCore::getModuleName($module)

Arguments

  • $module mixed

getModuleNameFromClass

boolean|string ModuleCore::getModuleNameFromClass(mixed $currentClass)

This function is used to determine the module name of an AdminTab which belongs to a module, in order to keep translation related to a module in its directory (instead of $_LANGADM)

Arguments

  • $currentClass mixed - the

getModulesDirOnDisk

array ModuleCore::getModulesDirOnDisk()

Return modules directory list

getModulesInstalled

array ModuleCore::getModulesInstalled(integer $position)

Return installed modules

Arguments

  • $position integer - Take only positionnables modules

getModulesOnDisk

array ModuleCore::getModulesOnDisk(boolean $useConfig, $loggedOnAddons, $id_employee)

Return available modules

Arguments

  • $useConfig boolean - in order to use config.xml file in module dir
  • $loggedOnAddons mixed
  • $id_employee mixed

getNativeModuleList

mixed ModuleCore::getNativeModuleList()

getNonNativeModuleList

array ModuleCore::getNonNativeModuleList()

Return non native module

getPathUri

string ModuleCore::getPathUri()

Get uri path for module

getPaymentModules

array ModuleCore::getPaymentModules()

Returns the list of the payment module associated to the current customer

getPaypalIgnore

mixed ModuleCore::getPaypalIgnore()

getPermission

boolean ModuleCore::getPermission(array $variable, object $employee)

Check employee permission for module

Arguments

  • $variable array - (action)
  • $employee object

getPermissionStatic

boolean ModuleCore::getPermissionStatic(integer $id_module, array $variable, object $employee)

Check employee permission for module (static method)

Arguments

  • $id_module integer
  • $variable array - (action)
  • $employee object

getPosition

mixed ModuleCore::getPosition($id_hook)

Arguments

  • $id_hook mixed

getTemplatePath

string ModuleCore::getTemplatePath(string $template)

Get realpath of a template of current module (check if template is overriden too)

Arguments

  • $template string

getUpgradeStatus

boolean ModuleCore::getUpgradeStatus($module_name)

Return the status of the upgraded module

Arguments

  • $module_name mixed

hookExec

string ModuleCore::hookExec(string $hook_name, array $hookArgs, $id_module)

Execute modules for specified hook

Arguments

  • $hook_name string - Hook Name
  • $hookArgs array - Parameters for the functions
  • $id_module mixed

hookExecPayment

mixed ModuleCore::hookExecPayment()

initUpgradeModule

boolean ModuleCore::initUpgradeModule($module)

Init the upgrade module

Arguments

  • $module mixed

install

mixed ModuleGridEngineCore::install()

installControllers

boolean ModuleCore::installControllers()

Install module's controllers using public property $controllers

installOverrides

boolean ModuleCore::installOverrides()

Install overrides files for the module

isCached

mixed ModuleCore::isCached($template, $cacheId, $compileId)

Arguments

  • $template mixed
  • $cacheId mixed
  • $compileId mixed

isEnabled

mixed ModuleCore::isEnabled($module_name)

Arguments

  • $module_name mixed

isEnabledForShopContext

mixed ModuleCore::isEnabledForShopContext()

isHookableOn

boolean ModuleCore::isHookableOn(string $hook_name)

Check if the module is transplantable on the hook in parameter

Arguments

  • $hook_name string

isInstalled

mixed ModuleCore::isInstalled($module_name)

Arguments

  • $module_name mixed

isModuleTrusted

boolean ModuleCore::isModuleTrusted($module_name)

Return if the module is provided by addons.prestashop.com or not

Arguments

  • $module_name mixed

isRegisteredInHook

mixed ModuleCore::isRegisteredInHook($hook)

Arguments

  • $hook mixed

l

string ModuleCore::l(string $string, boolean|string $specific)

Get translation for a given module text

Note: $specific parameter is mandatory for library files. Otherwise, translation key will not match for Module library when module is loaded with eval() Module::getModulesOnDisk()

Arguments

  • $string string - String to translate
  • $specific boolean|string - filename to use in translation key

loadUpgradeVersionList

boolean ModuleCore::loadUpgradeVersionList($module_name, $module_version, $registered_version)

Load the available list of upgrade of a specified module with an associated version

Arguments

  • $module_name mixed
  • $module_version mixed
  • $registered_version mixed

needUpgrade

boolean ModuleCore::needUpgrade($module)

Check if a module need to be upgraded.

This method modify the module_cache adding an upgrade list file

Arguments

  • $module mixed

preCall

mixed ModuleCore::preCall($module_name)

Arguments

  • $module_name mixed

registerExceptions

boolean ModuleCore::registerExceptions(integer $id_hook, array $excepts, array $shop_list)

Add exceptions for module->Hook

Arguments

  • $id_hook integer - Hook id
  • $excepts array - List of file name
  • $shop_list array - List of shop

registerHook

boolean ModuleCore::registerHook(string $hook_name, array $shop_list)

Connect module to a hook

Arguments

  • $hook_name string - Hook name
  • $shop_list array - List of shop linked to the hook (if null, link hook to all shops)

removeOverride

boolean ModuleCore::removeOverride(string $classname)

Remove all methods in a module override from the override class

Arguments

  • $classname string

render

mixed ModuleGridEngineCore::render()

resetCurrentSubTemplate

mixed ModuleCore::resetCurrentSubTemplate($template, $cache_id, $compile_id)

Arguments

  • $template mixed
  • $cache_id mixed
  • $compile_id mixed

runUpgradeModule

array ModuleCore::runUpgradeModule()

Run the upgrade for a given module name and version

setLimit

mixed ModuleGridEngineCore::setLimit($start, $limit)

Arguments

  • $start mixed
  • $limit mixed

setSize

mixed ModuleGridEngineCore::setSize($width, $height)

Arguments

  • $width mixed
  • $height mixed

setTitle

mixed ModuleGridEngineCore::setTitle($title)

Arguments

  • $title mixed

setTotalCount

mixed ModuleGridEngineCore::setTotalCount($totalCount)

Arguments

  • $totalCount mixed

setUpgradeMessage

mixed ModuleCore::setUpgradeMessage($upgrade_detail)

Set errors, warning or success message of a module upgrade

Arguments

  • $upgrade_detail mixed

setValues

mixed ModuleGridEngineCore::setValues($values)

Arguments

  • $values mixed

uninstall

boolean ModuleCore::uninstall()

Delete module from datable

uninstallOverrides

boolean ModuleCore::uninstallOverrides()

Uninstall overrides files for the module

unregisterExceptions

boolean ModuleCore::unregisterExceptions($hook_id, array $shop_list)

Unregister exceptions linked to module

Arguments

  • $hook_id mixed
  • $shop_list array - List of shop

unregisterHook

boolean ModuleCore::unregisterHook($hook_id, array $shop_list)

Unregister module from hook

Arguments

  • $hook_id mixed
  • $shop_list array - List of shop

updateModuleTranslations

mixed ModuleCore::updateModuleTranslations()

updatePosition

mixed ModuleCore::updatePosition($id_hook, $way, $position)

Arguments

  • $id_hook mixed
  • $way mixed
  • $position mixed

updateTranslationsAfterInstall

mixed ModuleCore::updateTranslationsAfterInstall($update)

Arguments

  • $update mixed

upgradeModuleVersion

boolean ModuleCore::upgradeModuleVersion($name, $version)

Upgrade the registered version to a new one

Arguments

  • $name mixed
  • $version mixed

useTooMuchMemory

mixed ModuleCore::useTooMuchMemory()