Skip to content

icms_view_Tree

Raimondas Rimkevičius edited this page Mar 9, 2020 · 1 revision
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!

icms_view_Tree

Handles all tree functions within ImpressCMS

  • Class name: icms_view_Tree
  • Namespace:

Properties

$table

public string $table
  • Visibility: public

$id

public string $id
  • Visibility: public

$pid

public string $pid
  • Visibility: public

$order

public string $order
  • Visibility: public

$title

public string $title
  • Visibility: public

$db

private object $db
  • Visibility: private

Methods

__construct

mixed icms_view_Tree::__construct(string table_name, string id_name, pid_name)

Constructor of class icms_view_Tree Sets the names of table, unique id, and parent id

  • Visibility: public

Arguments

  • table_name string - <p>Name of table containing the parent-child structure</p>
  • id_name string - <p>Name of the unique id field in the table</p>
  • pid_name mixed - <p>Name of the parent id field in the table</p>

__get

mixed icms_view_Tree::__get(string name)

Overloading method to allow access to private properties outside the class

Instead of creating separate methods for each private property, this allows you to access (read) the properties and still keep them from being written from the public scope

  • Visibility: public

Arguments

  • name string

getFirstChild

array icms_view_Tree::getFirstChild(int sel_id, string order)

Returns an array of first child objects for a given id($sel_id)

  • Visibility: public

Arguments

  • sel_id int
  • order string - <p>Sort field for the list</p>

getFirstChildId

array icms_view_Tree::getFirstChildId(int sel_id)

Returns an array of all FIRST child ids of a given id($sel_id)

  • Visibility: public

Arguments

  • sel_id int

getAllChildId

array icms_view_Tree::getAllChildId(int sel_id, string order, array idarray)

Returns an array of ALL child ids for a given id($sel_id)

  • Visibility: public

Arguments

  • sel_id int
  • order string - <p>Sort field for the list</p>
  • idarray array

getAllParentId

array icms_view_Tree::getAllParentId(int sel_id, string order, array idarray)

Returns an array of ALL parent ids for a given id($sel_id)

  • Visibility: public

Arguments

  • sel_id int
  • order string
  • idarray array

getPathFromId

string icms_view_Tree::getPathFromId(int sel_id, string title, string path)

Generates path from the root id to a given id($sel_id) the path is delimited with "/"

  • Visibility: public

Arguments

  • sel_id int
  • title string
  • path string

makeMySelBox

mixed icms_view_Tree::makeMySelBox(string title, string order, int preset_id, int none, string sel_name, string onchange)

Makes a nicely ordered selection box

  • Visibility: public

Arguments

  • title string - <p>Field containing the items to display in the list</p>
  • order string - <p>Sort order of the options</p>
  • preset_id int - <p>is used to specify a preselected item</p>
  • none int - <p>set to 1 to add an option with value 0</p>
  • sel_name string - <p>Name of the select element</p>
  • onchange string - <p>Action to take when the selection is changed</p>

getNicePathFromId

mixed icms_view_Tree::getNicePathFromId(int sel_id, string title, string funcURL, string path, string separator)

Generates nicely formatted linked path from the root id to a given id

  • Visibility: public

Arguments

  • sel_id int
  • title string
  • funcURL string
  • path string
  • separator string - <p>Allows custom designation of separator in linked path $return string $path</p>

getIdPathFromId

string icms_view_Tree::getIdPathFromId(int sel_id, string path)

Generates id path from the root id to a given id the path is delimited with "/"

  • Visibility: public

Arguments

  • sel_id int
  • path string

getAllChild

array icms_view_Tree::getAllChild(int sel_id, string order, array parray)
  • Visibility: public

Arguments

  • sel_id int
  • order string
  • parray array

getChildTreeArray

array icms_view_Tree::getChildTreeArray(int sel_id, string order, array parray, string r_prefix)
  • Visibility: public

Arguments

  • sel_id int
  • order string
  • parray array
  • r_prefix string
Clone this wiki locally