Skip to content

Latest commit

 

History

History
1122 lines (573 loc) · 23.7 KB

class.HelperListCore.md

File metadata and controls

1122 lines (573 loc) · 23.7 KB

Class HelperListCore

Contents

Properties

Methods

Properties

$_defaultOrderBy

public string $_defaultOrderBy = false

$_filter

protected array $_filter

$_list

protected array $_list = array()

$_pagination

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

$_tmpTableFilter

protected array $_tmpTableFilter = ''

$actions

public array $actions = array()

$ajax_params

public mixed $ajax_params = array()

$bulk_actions

public mixed $bulk_actions = false

$cache_lang

public array $cache_lang = array()

$colorOnBackground

public mixed $colorOnBackground

$content_tpl

protected mixed $content_tpl = 'list_content.tpl'

$deleted

protected mixed $deleted

$fieldsDisplay

protected mixed $fieldsDisplay

$footer_tpl

protected mixed $footer_tpl = 'list_footer.tpl'

$header_tpl

protected mixed $header_tpl = 'list_header.tpl'

$identifier

public mixed $identifier

$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', 'id_attribute_group' => 'id_attribute_group', 'id_carrier' => 'id_carrier', 'id_tab' => 'id_tab', 'id_feature' => 'id_feature')

$is_cms

protected mixed $is_cms = false

$is_dnd_identifier

protected mixed $is_dnd_identifier = false

$listTotal

public integer $listTotal

$list_skip_actions

public array $list_skip_actions = array()

$no_back

public boolean $no_back = true

$no_link

public boolean $no_link = false

$orderBy

public string $orderBy

$orderWay

public string $orderWay

$simple_header

public boolean $simple_header = false

$specificConfirmDelete

public mixed $specificConfirmDelete

$title

public \if $title = null

$tpl_delete_link_vars

public array $tpl_delete_link_vars = array()

$base_folder

public string $base_folder

$base_tpl

public string $base_tpl = 'content.tpl'

$context

public mixed $context

$currentIndex

public mixed $currentIndex

$override_folder

public string $override_folder

$ps_help_context

public mixed $ps_help_context

$show_toolbar

public mixed $show_toolbar = true

$table

public mixed $table

$token

public mixed $token

$toolbar_btn

public mixed $toolbar_btn

$toolbar_fix

public mixed $toolbar_fix = false

$tpl

protected \smartyTemplate $tpl

$tpl_vars

public mixed $tpl_vars = array()

Methods

__construct

mixed HelperListCore::__construct()

buildHtmlOptions

string HelperCore::buildHtmlOptions(array $html_options)

Create html a string containing html options eg: buildHtmlOptions(array('name' => 'myInputName', 'id' => 'myInputId')); return => 'name="myInputName" id="myInputId"'

Arguments

  • $html_options array

createTemplate

\Template HelperCore::createTemplate(string $tpl_name)

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

Arguments

  • $tpl_name string - filename

displayAssoShop

mixed HelperCore::displayAssoShop($type)

Arguments

  • $type mixed

displayDeleteLink

mixed HelperListCore::displayDeleteLink($token, $id)

Display delete action link

Arguments

  • $token mixed
  • $id mixed

displayDetailsLink

mixed HelperListCore::displayDetailsLink($token, $id)

Display action show details of a table row This action need an ajax request with a return like this: { use_parent_structure: true // If false, data need to be an html data: [ {field_name: 'value'} ], fields_display: // attribute $fieldsDisplay of the admin controller } or somethins like this: { use_parent_structure: false // If false, data need to be an html data: '

My html content

', fields_display: // attribute $fieldsDisplay of the admin controller }

Arguments

  • $token mixed
  • $id mixed

displayDuplicateLink

mixed HelperListCore::displayDuplicateLink($token, $id)

Display duplicate action link

Arguments

  • $token mixed
  • $id mixed

displayEditLink

mixed HelperListCore::displayEditLink($token, $id)

Display edit action link

Arguments

  • $token mixed
  • $id mixed

displayEnableLink

mixed HelperListCore::displayEnableLink(string $token, integer $id, integer $value, string $active, integer $id_category, integer $id_product)

Fetch the template for action enable

Arguments

  • $token string
  • $id integer
  • $value integer - state enabled or not
  • $active string - status
  • $id_category integer
  • $id_product integer

displayListContent

mixed HelperListCore::displayListContent($token)

Arguments

  • $token mixed

displayListFooter

mixed HelperListCore::displayListFooter($token)

Close list table and submit button

Arguments

  • $token mixed

displayListHeader

mixed HelperListCore::displayListHeader($token)

Display list header (filtering, pagination and column names)

Arguments

  • $token mixed

displayViewLink

mixed HelperListCore::displayViewLink($token, $id)

Display view action link

Arguments

  • $token mixed
  • $id mixed

generate

void HelperCore::generate()

default behaviour for helper is to return a tpl fetched

generateList

string HelperListCore::generateList(array $list, $fields_display)

Return an html list given the data to fill it up

Arguments

  • $list array - entries to display (rows)
  • $fields_display mixed

l

string HelperCore::l(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
  • $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')

renderAdminCategorieTree

string HelperCore::renderAdminCategorieTree(\type $trads, \type $selected_cat, \type $input_name, $use_radio, $use_search, $disabled_categories)

Arguments

  • $trads type - values of translations keys For the moment, translation are not automatic
  • $selected_cat type - array of selected categories Format Array ( [0] => 1 [1] => 2 ) OR Array ( [1] => Array ( [id_category] => 1 [name] => Home page [link_rewrite] => home ) )
  • $input_name type - name of input
  • $use_radio mixed
  • $use_search mixed
  • $disabled_categories mixed

selectInput

string HelperCore::selectInput(array $values, array $html_options, array $select_options)

Create a select input field

Arguments

  • $values array
  • $html_options array - any key => value options
  • $select_options array - key: the array value that will be used as a key in my select (optional) value: the array value that will be used as a label in my select (optional) empty: the label displayed as an empty value (optional) selected: the key corresponding to the selected value (optional)

setTpl

mixed HelperCore::setTpl($tpl)

Arguments

  • $tpl mixed