Skip to content

Latest commit

 

History

History
638 lines (340 loc) · 14.3 KB

class.HelperOptionsCore.md

File metadata and controls

638 lines (340 loc) · 14.3 KB

Class HelperOptionsCore

Use this helper to generate preferences forms, with values stored in the configuration table

Contents

Properties

Methods

Properties

$required

public mixed $required = false

$base_folder

public string $base_folder

$base_tpl

public string $base_tpl = 'content.tpl'

$context

public mixed $context

$currentIndex

public mixed $currentIndex

$identifier

public mixed $identifier

$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

$title

public mixed $title

$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 HelperOptionsCore::__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

displayOptionTypeDisabled

mixed HelperOptionsCore::displayOptionTypeDisabled($key, $field, $value)

Type = disabled

@ TODO

Arguments

  • $key mixed
  • $field mixed
  • $value mixed

displayOptionTypeImage

mixed HelperOptionsCore::displayOptionTypeImage($key, $field, $value)

Type = image @ TODO

Arguments

  • $key mixed
  • $field mixed
  • $value mixed

displayOptionTypePrice

mixed HelperOptionsCore::displayOptionTypePrice($key, $field, $value)

Type = price @ TODO

Arguments

  • $key mixed
  • $field mixed
  • $value mixed

generate

void HelperCore::generate()

default behaviour for helper is to return a tpl fetched

generateOptions

string HelperOptionsCore::generateOptions($option_list)

Generate a form for options

Arguments

  • $option_list mixed

getOptionValue

mixed HelperOptionsCore::getOptionValue($key, $field)

Arguments

  • $key mixed
  • $field 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

renderAssoShop

string HelperCore::renderAssoShop(string $type)

Render an area to determinate shop association

Arguments

  • $type string - 'shop' or 'group_shop'

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

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