Skip to content

Latest commit

 

History

History
1121 lines (574 loc) · 24.3 KB

class.HelperListCore.md

File metadata and controls

1121 lines (574 loc) · 24.3 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)

$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

$fields_list

protected string $fields_list

$footer_tpl

protected mixed $footer_tpl = 'list_footer.tpl'

$header_tpl

protected mixed $header_tpl = 'list_header.tpl'

$identifier

public mixed $identifier

$is_cms

protected mixed $is_cms = false

$listTotal

public integer $listTotal

$list_skip_actions

public array $list_skip_actions = array()

$no_link

public boolean $no_link = false

$orderBy

public string $orderBy

$orderWay

public string $orderWay

$position_identifier

public mixed $position_identifier

$row_hover

public boolean $row_hover = true

$simple_header

public boolean $simple_header = false

$specificConfirmDelete

public mixed $specificConfirmDelete = null

$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

$module

public \Module $module

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

public mixed $toolbar_scroll = false

$tpl

protected \smartyTemplate $tpl

$tpl_vars

public mixed $tpl_vars = array()

Methods

__construct

mixed HelperListCore::__construct()

createTemplate

\Template HelperCore::createTemplate(string $tpl_name)

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

Arguments

  • $tpl_name string - filename

displayDefaultLink

mixed HelperListCore::displayDefaultLink($token, $id, $name)

Display delete action link

Arguments

  • $token mixed
  • $id mixed
  • $name mixed

displayDeleteLink

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

Display delete action link

Arguments

  • $token mixed
  • $id mixed
  • $name mixed

displayDetailsLink

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

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 $fields_list 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 $fields_list of the admin controller }

Arguments

  • $token mixed
  • $id mixed
  • $name mixed

displayDuplicateLink

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

Display duplicate action link

Arguments

  • $token mixed
  • $id mixed
  • $name mixed

displayEditLink

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

Display edit action link

Arguments

  • $token mixed
  • $id mixed
  • $name mixed

displayEnableLink

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

displayListFooter

mixed HelperListCore::displayListFooter()

Close list table and submit button

displayListHeader

mixed HelperListCore::displayListHeader()

Display list header (filtering, pagination and column names)

displayViewLink

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

Display view action link

Arguments

  • $token mixed
  • $id mixed
  • $name mixed

generate

void HelperCore::generate()

default behaviour for helper is to return a tpl fetched

generateList

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

Return an html list given the data to fill it up

Arguments

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

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

mixed HelperCore::renderAdminCategorieTree($translations, $selected_cat, $input_name, $use_radio, $use_search, $disabled_categories, $use_in_popup)

Arguments

  • $translations mixed
  • $selected_cat mixed
  • $input_name mixed
  • $use_radio mixed
  • $use_search mixed
  • $disabled_categories mixed
  • $use_in_popup mixed

renderCategoryTree

string HelperCore::renderCategoryTree(array $root, \type $selected_cat, string $input_name, boolean $use_radio, boolean $use_search, array $disabled_categories, boolean $use_in_popup, boolean $use_shop_context)

Arguments

  • $root array - array with the name and ID of the tree root category, if null the Shop's root category will be used
  • $selected_cat type - array of selected categories Format Array ( [0] => 1 [1] => 2 ) OR Array ( [1] => Array ( [id_category] => 1 [name] => Home page ) )
  • $input_name string - name of input
  • $use_radio boolean - use radio tree or checkbox tree
  • $use_search boolean - display a find category search box
  • $disabled_categories array
  • $use_in_popup boolean
  • $use_shop_context boolean

renderRequiredFields

string HelperCore::renderRequiredFields(string $class_name, string $identifier, array $table_fields)

Render a form with potentials required fields

Arguments

  • $class_name string
  • $identifier string
  • $table_fields array

renderShopList

mixed HelperCore::renderShopList()

setTpl

mixed HelperCore::setTpl($tpl)

Arguments

  • $tpl mixed