Skip to content

Latest commit

 

History

History
5584 lines (2818 loc) · 141 KB

class.AdminTranslationsControllerCore.md

File metadata and controls

5584 lines (2818 loc) · 141 KB

Class AdminTranslationsControllerCore

Contents

Constants

Properties

Methods

Constants

DEFAULT_THEME_NAME

const DEFAULT_THEME_NAME = _PS_DEFAULT_THEME_NAME_

Name of theme by default

TEXTAREA_SIZED

const TEXTAREA_SIZED = 70

Properties

$all_iso_lang

protected array $all_iso_lang = array()

$ignore_folder

protected array $ignore_folder = array('.', '..', '.svn', '.git', '.htaccess', 'index.php')

$lang_selected

protected \Language $lang_selected

$languages

protected array $languages

$link_lang_pack

protected string $link_lang_pack = 'http://www.prestashop.com/download/lang_packs/get_each_language_pack.php'

$missing_translations

protected integer $missing_translations

$modules_translations

protected array $modules_translations = array()

$post_limit_exceed

protected boolean $post_limit_exceed = false

$theme_selected

protected string $theme_selected

$themes

protected array $themes

$total_expression

protected integer $total_expression

$translations_informations

protected array $translations_informations = array()

$type_selected

protected string $type_selected

$_defaultOrderBy

protected string $_defaultOrderBy = false

$_defaultOrderWay

protected mixed $_defaultOrderWay = 'ASC'

$_default_pagination

protected integer $_default_pagination = 50

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

$_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', 'duplicate', 'delete')

$admin_webpath

public mixed $admin_webpath

$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

$bootstrap

public mixed $bootstrap = false

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

$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 integer $id_object

$identifier

protected string $identifier = false

$identifier_name

protected mixed $identifier_name = 'name'

$imageType

public string $imageType = 'jpg'

$informations

public mixed $informations = array()

$is_cms

protected mixed $is_cms = false

$is_prestashop_up

protected mixed $is_prestashop_up = true

$lang

public boolean $lang = false

$layout

public mixed $layout = 'layout.tpl'

$list_id

public mixed $list_id

$list_natives_modules

protected mixed $list_natives_modules = array()

$list_no_link

protected boolean $list_no_link = false

$list_partners_modules

protected mixed $list_partners_modules = array()

$list_simple_header

protected \define $list_simple_header

$list_skip_actions

protected array $list_skip_actions = array()

$lite_display

protected mixed $lite_display = false

$logged_on_addons

protected mixed $logged_on_addons = false

$meta_title

protected mixed $meta_title

$modals

public mixed $modals = array()

$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

$page_header_toolbar_btn

public mixed $page_header_toolbar_btn = array()

$page_header_toolbar_title

public mixed $page_header_toolbar_title

$path

public mixed $path

$position_group_identifier

protected mixed $position_group_identifier

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

public mixed $show_form_cancel_button

$show_page_header_toolbar

public mixed $show_page_header_toolbar = false

$show_toolbar

protected boolean $show_toolbar = true

$show_toolbar_options

protected boolean $show_toolbar_options = false

$specificConfirmDelete

protected mixed $specificConfirmDelete = null

$submit_action

protected \override $submit_action

$tabAccess

public array $tabAccess

$tab_modules_list

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

$table

public string $table = 'configuration'

$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

$php_errors

public array $php_errors = array()

$php_self

public mixed $php_self

$redirect_after

protected mixed $redirect_after = null

$status

protected mixed $status = ''

Methods

__construct

mixed AdminTranslationsControllerCore::__construct()

_childValidation

mixed AdminControllerCore::_childValidation()

Overload this method for custom checking

addCSS

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

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

addFiltersToBreadcrumbs

mixed AdminControllerCore::addFiltersToBreadcrumbs()

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

mixed ControllerCore::addJqueryPlugin($name, null $folder, boolean $css)

Add a new javascript file in page header.

Arguments

  • $name mixed
  • $folder null
  • $css boolean

addJqueryUI

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

Add a new javascript file in page header.

Arguments

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

addNewTabs

mixed AdminTranslationsControllerCore::addNewTabs(array $iso_code, array $files)

Add new translations tabs by code ISO

Arguments

  • $iso_code array
  • $files array

addPageHeaderToolBarModulesListButton

mixed AdminControllerCore::addPageHeaderToolBarModulesListButton()

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

ajaxProcessGetModuleQuickView

mixed AdminControllerCore::ajaxProcessGetModuleQuickView()

ajaxProcessOpenHelp

mixed AdminControllerCore::ajaxProcessOpenHelp()

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

changeModulesKeyTranslation

boolean AdminTranslationsControllerCore::changeModulesKeyTranslation(string $path, string $theme_from, string $theme_to)

Change the key translation to according it to theme name.

Arguments

  • $path string
  • $theme_from string
  • $theme_to string

checkAccess

mixed AdminControllerCore::checkAccess()

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

checkAndAddMailsFiles

mixed AdminTranslationsControllerCore::checkAndAddMailsFiles($iso_code, $files_list)

Arguments

  • $iso_code mixed
  • $files_list mixed

checkAndAddThemesFiles

mixed AdminTranslationsControllerCore::checkAndAddThemesFiles(array $files, array $themes_selected)

Move theme translations in selected themes

Arguments

  • $files array
  • $themes_selected array

checkDirAndCreate

boolean AdminTranslationsControllerCore::checkDirAndCreate(string $dest)

This method is only used by AdminTranslations::submitCopyLang().

It try to create folder in new theme.

When a translation file is copied for a module, its translation key is wrong. We have to change the translation key and rewrite the file.

Arguments

  • $dest string - file name

checkIfKeyUseSprintf

array|boolean AdminTranslationsControllerCore::checkIfKeyUseSprintf($key)

Find sentence which use %d, %s, %%, %1$d, %1$s.

..

Arguments

  • $key mixed - : english sentence

checkToken

mixed AdminControllerCore::checkToken()

Check for security token

checkTranslationFile

mixed AdminTranslationsControllerCore::checkTranslationFile($content)

Arguments

  • $content mixed

cleanMailContent

mixed AdminTranslationsControllerCore::cleanMailContent($content, $lang, $title)

Arguments

  • $content mixed
  • $lang mixed
  • $title mixed

clearModuleFiles

array AdminTranslationsControllerCore::clearModuleFiles($files, string $type_clear, string $path)

Clear the list of module file by type (file or directory)

Arguments

  • $files mixed - : list of files
  • $type_clear string - (file|directory)
  • $path string

copyFromPost

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

Copy datas from $_POST to object

Arguments

  • $object mixed
  • $table string - Object table

copyMailFilesForAllLanguages

mixed AdminTranslationsControllerCore::copyMailFilesForAllLanguages()

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

displayLimitPostWarning

mixed AdminTranslationsControllerCore::displayLimitPostWarning($count)

Arguments

  • $count mixed

displayMailBlockHtml

mixed AdminTranslationsControllerCore::displayMailBlockHtml(array $content, string $lang, string $url, string $mail_name, string $group_name, string|boolean $name_for_module)

Just build the html structure for display html mails.

Arguments

  • $content array - with english and language needed contents
  • $lang string - iso code of the needed language
  • $url string - for the html page and displaying an outline
  • $mail_name string - name of the file to translate (same for txt and html files)
  • $group_name string - group name allow to distinguish each block of mail.
  • $name_for_module string|boolean - is not false define add a name for disntiguish mails module

displayMailBlockTxt

mixed AdminTranslationsControllerCore::displayMailBlockTxt(array $content, string $lang, string $mail_name, string $group_name, string|boolean $name_for_module)

Just build the html structure for display txt mails

Arguments

  • $content array - with english and language needed contents
  • $lang string - iso code of the needed language
  • $mail_name string - name of the file to translate (same for txt and html files)
  • $group_name string - group name allow to distinguish each block of mail.
  • $name_for_module string|boolean - is not false define add a name for disntiguish mails module

displayMailContent

mixed AdminTranslationsControllerCore::displayMailContent(array $mails, array $all_subject_mail, \Language $obj_lang, string $id_html, string $title, string|boolean $name_for_module)

Display mails in html format.

This was create for factorize the html displaying

Arguments

  • $mails array
  • $all_subject_mail array
  • $obj_lang Language
  • $id_html string - use for set html id attribute for the block
  • $title string - Set the title for the block
  • $name_for_module string|boolean - is not false define add a name for disntiguish mails module

displayMailEditor

mixed AdminTranslationsControllerCore::displayMailEditor($content, $lang, $url, $mail_name, $group_name, $name_for_module)

Arguments

  • $content mixed
  • $lang mixed
  • $url mixed
  • $mail_name mixed
  • $group_name mixed
  • $name_for_module mixed

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

displayToggleButton

mixed AdminTranslationsControllerCore::displayToggleButton($closed)

Arguments

  • $closed mixed

displayWarning

mixed AdminControllerCore::displayWarning(string $msg)

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

Arguments

  • $msg string

exportTabs

mixed AdminTranslationsControllerCore::exportTabs()

fileExists

mixed AdminTranslationsControllerCore::fileExists()

Include file $dir/$file and return the var $var declared in it.

This create the file if not exists

return array : translations

filesListToPaths

mixed AdminTranslationsControllerCore::filesListToPaths($list)

Turn the list returned by AdminTranslationsController::filterTranslationFiles() into a list of paths that can be passed to Archive_Tar::extractList()

Arguments

  • $list mixed

fillModuleData

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

Arguments

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

filterTabModuleList

mixed AdminControllerCore::filterTabModuleList()

filterToField

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

Arguments

  • $key mixed
  • $filter mixed

filterTranslationFiles

mixed AdminTranslationsControllerCore::filterTranslationFiles($list)

Filter the translation files contained in a .gzip pack and return only the ones that we want.

Right now the function only needs to check that the modules for which we want to add translations are present on the shop (installed or not).

$list is the output of Archive_Tar::listContent()

Arguments

  • $list mixed

findAndFillTranslations

void AdminTranslationsControllerCore::findAndFillTranslations(array $files, string $theme_name, string $module_name, string|boolean $dir)

This method get translation for each files of a module, compare with global $_MODULES array and fill AdminTranslations::modules_translations array With key as English sentences and values as their iso code translations.

Arguments

  • $files array
  • $theme_name string
  • $module_name string
  • $dir string|boolean

findAndWriteTranslationsIntoFile

void AdminTranslationsControllerCore::findAndWriteTranslationsIntoFile(string $file_name, array $files, string $theme_name, string $module_name, string|boolean $dir)

This method check each file (tpl or php file), get its sentences to translate, compare with posted values and write in iso code translation file.

Arguments

  • $file_name string
  • $files array
  • $theme_name string
  • $module_name string
  • $dir string|boolean

getAllModuleFiles

mixed AdminTranslationsControllerCore::getAllModuleFiles(array $modules, string $root_dir, string $lang, boolean $is_default)

This method get translation in each translations file.

The file depend on $lang param.

Arguments

  • $modules array - list of modules
  • $root_dir string - path where it get each modules
  • $lang string - iso code of choosen language to translate
  • $is_default boolean - set it if modules are located in root/prestashop/modules folder This allow to distinguish overrided prestashop theme and original module

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

getFileToParseByTypeTranslation

array AdminTranslationsControllerCore::getFileToParseByTypeTranslation()

Get list of files which must be parsed by directory and by type of translations

getInformations

mixed AdminTranslationsControllerCore::getInformations()

Get all informations on : languages, theme and the translation type.

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

getListModules

array AdminTranslationsControllerCore::getListModules()

Check if directory and file exist and return an list of modules

getMailContent

array AdminTranslationsControllerCore::getMailContent(string $dir, string $file)

Get content of the mail file.

Arguments

  • $dir string
  • $file string

getMailFiles

array AdminTranslationsControllerCore::getMailFiles(string $dir, string $group_name)

Get each informations for each mails found in the folder $dir.

Arguments

  • $dir string
  • $group_name string

getMailPattern

mixed AdminTranslationsControllerCore::getMailPattern()

getModuleTranslations

mixed AdminTranslationsControllerCore::getModuleTranslations()

This method merge each arrays of modules translation in the array of modules translations

getModulesHasMails

array AdminTranslationsControllerCore::getModulesHasMails($with_module_name)

Check in each module if contains mails folder.

Arguments

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

getSubjectMail

array AdminTranslationsControllerCore::getSubjectMail($dir, $file, $subject_mail)

Get list of subjects of mails

Arguments

  • $dir mixed
  • $file mixed
  • $subject_mail mixed

getSubjectMailContent

array AdminTranslationsControllerCore::getSubjectMailContent($directory)

Arguments

  • $directory mixed - : name of directory

getTinyMCEForMails

mixed AdminTranslationsControllerCore::getTinyMCEForMails($iso_lang)

Arguments

  • $iso_lang mixed

getTranslationsInformations

mixed AdminTranslationsControllerCore::getTranslationsInformations()

Get all translations informations for all type of translations

array( 'type' => array( 'name' => string : title for the translation type, 'var' => string : name of var for the translation file, 'dir' => string : dir of translation file 'file' => string : file name of translation file ) )

init

mixed AdminControllerCore::init()

Init context and dependencies, handles POST and GET

initBreadcrumbs

mixed AdminControllerCore::initBreadcrumbs($tab_id, $tabs)

Set breadcrumbs array for the controller page

Arguments

  • $tab_id mixed
  • $tabs mixed

initContent

mixed AdminTranslationsControllerCore::initContent()

AdminController::initContent() override

initCursedPage

void AdminControllerCore::initCursedPage()

initialize the invalid doom page of death

initFooter

mixed AdminControllerCore::initFooter()

Assign smarty variables for the footer

initForm

\call AdminTranslationsControllerCore::initForm($method_name)

This function create vars by default and call the good method for generate form

Arguments

  • $method_name mixed

initFormBack

mixed AdminTranslationsControllerCore::initFormBack()

This method generate the form for back translations

initFormErrors

mixed AdminTranslationsControllerCore::initFormErrors()

This method generate the form for errors translations

initFormFields

mixed AdminTranslationsControllerCore::initFormFields()

This method generate the form for fields translations

initFormFront

mixed AdminTranslationsControllerCore::initFormFront()

This method generate the form for front translations

initFormMails

mixed AdminTranslationsControllerCore::initFormMails($no_display)

This method generate the form for mails translations

Arguments

  • $no_display mixed

initFormModules

mixed AdminTranslationsControllerCore::initFormModules()

This method generate the form for modules translations

initFormPDF

mixed AdminTranslationsControllerCore::initFormPDF()

This method generate the form for PDF translations

initHeader

mixed AdminControllerCore::initHeader()

Assign smarty variables for the header

initMain

mixed AdminTranslationsControllerCore::initMain()

Generate the Main page

initModal

mixed AdminControllerCore::initModal()

initPageHeaderToolbar

mixed AdminControllerCore::initPageHeaderToolbar()

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 AdminTranslationsControllerCore::initToolbar()

AdminController::initToolbar() override

initToolbarTitle

void AdminControllerCore::initToolbarTitle()

set default toolbar_title to admin breadcrumb

isCached

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

Arguments

  • $template mixed
  • $cacheId mixed
  • $compileId 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')

listFiles

mixed AdminTranslationsControllerCore::listFiles($dir, $list, $file_ext)

recursively list files in directory $dir

Arguments

  • $dir mixed
  • $list mixed
  • $file_ext mixed

loadObject

object|boolean 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

myErrorHandler

mixed ControllerCore::myErrorHandler($errno, $errstr, $errfile, $errline)

Arguments

  • $errno mixed
  • $errstr mixed
  • $errfile mixed
  • $errline mixed

parsePdfClass

array AdminTranslationsControllerCore::parsePdfClass(string $file_path, string $file_type, $lang_array, string $tab, array $tabs_array, $count_missing)

Parse PDF class

Arguments

  • $file_path string - file to parse
  • $file_type string - type of file
  • $lang_array mixed
  • $tab string - name to use with the md5 key
  • $tabs_array array
  • $count_missing mixed

postImage

boolean AdminControllerCore::postImage(integer $id)

Overload this method for custom checking

Arguments

  • $id integer - Object id used for deleting images

postProcess

mixed AdminTranslationsControllerCore::postProcess()

AdminController::postProcess() override

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

Arguments

  • $text_delimiter mixed

processFilter

mixed AdminControllerCore::processFilter()

Set the filters used for the list display

processPosition

mixed AdminControllerCore::processPosition()

Change object position

processResetFilters

mixed AdminControllerCore::processResetFilters($list_id)

Cancel all filters for this tab

Arguments

  • $list_id mixed

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

recursiveGetModuleFiles

mixed AdminTranslationsControllerCore::recursiveGetModuleFiles(string $path, array $array_files, string $module_name, string $lang_file, boolean $is_default)

This get files to translate in module directory.

Recursive method allow to get each files for a module no matter his depth.

Arguments

  • $path string - directory path to scan
  • $array_files array - by reference - array which saved files to parse.
  • $module_name string - module name
  • $lang_file string - full path of translation file
  • $is_default boolean

redirect

mixed AdminTranslationsControllerCore::redirect(boolean $save_and_stay, boolean $conf)

This method redirect in the translation main page or in the translation page

Arguments

  • $save_and_stay boolean - : true if the user has clicked on the button "save and stay"
  • $conf boolean - : id of confirmation message

refresh

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

Arguments

  • $file_to_refresh mixed
  • $external_file mixed

removeCSS

mixed ControllerCore::removeCSS($css_uri, $css_media_type)

Arguments

  • $css_uri mixed
  • $css_media_type mixed

removeJS

mixed ControllerCore::removeJS($js_uri)

Arguments

  • $js_uri mixed

renderDetails

mixed AdminControllerCore::renderDetails()

Override to render the view page

renderForm

mixed AdminControllerCore::renderForm()

Function used to render the form for this controller

renderKpis

mixed AdminTranslationsControllerCore::renderKpis()

renderList

mixed AdminControllerCore::renderList()

Function used to render the list to display for this controller

renderModal

mixed AdminControllerCore::renderModal()

renderModulesList

mixed AdminControllerCore::renderModulesList()

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 !)

setDeprecatedMedia

mixed AdminControllerCore::setDeprecatedMedia()

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

setTypeSelected

mixed AdminTranslationsControllerCore::setTypeSelected($type_selected)

Arguments

  • $type_selected mixed

smartyOutputContent

mixed ControllerCore::smartyOutputContent($content)

Arguments

  • $content mixed

submitAddLang

mixed AdminTranslationsControllerCore::submitAddLang()

submitCopyLang

mixed AdminTranslationsControllerCore::submitCopyLang()

submitExportLang

mixed AdminTranslationsControllerCore::submitExportLang()

submitImportLang

mixed AdminTranslationsControllerCore::submitImportLang()

submitTranslationsMails

mixed AdminTranslationsControllerCore::submitTranslationsMails()

This method is used to write translation for mails.

This writes subject translation files (in root/mails/lang_choosen/lang.php or root/PS_THEMES_DIR/mails/lang_choosen/lang.php) and mails files.

theme_exists

mixed AdminTranslationsControllerCore::theme_exists($theme)

Arguments

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

userParseFile

\return AdminTranslationsControllerCore::userParseFile($content, $type_translation, string|boolean $type_file, string $module_name)

This method parse a file by type of translation and type file

Arguments

  • $content mixed
  • $type_translation mixed - : front, back, errors, modules...
  • $type_file string|boolean - : (tpl|php)
  • $module_name string - : name of the module

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

writeSubjectTranslationFile

mixed AdminTranslationsControllerCore::writeSubjectTranslationFile($sub, $path)

Arguments

  • $sub mixed
  • $path mixed

writeTranslationFile

mixed AdminTranslationsControllerCore::writeTranslationFile(boolean $override_file)

Read the Post var and write the translation file.

This method overwrites the old translation file.

Arguments

  • $override_file boolean - : set true if this file is a override