\fi_protie_navigation

Versatile class for drawing dynamically navigation elements according to user preferences.

// Initializes the class $navigation = new fi_protie_navigation();

// Display only nodes (folders) $navigation->list_leaves = false;

// Expand the whole site tree instead of the active path $navigation->follow_all = true;

// Skip 1 level from the beginning of the active path $navigation->skip_levels = 1;

// Finally draw the navigation $navigation->draw();

See the attributes of this class for additional customizing options.

Summary

Methods
Properties
Constants
__construct()
draw()
set_root_element_id()
$root_id
$skip_levels
$list_leaves
$list_nodes
$follow_selected
$follow_all
$show_only_current
$list_levels
$root_object_id
$css_list_style
$component_name_to_class
$has_children_to_class
$object_status_to_class
$css_node
$css_leaf
$css_selected
$css_active
$css_link
No constants found
No protected methods found
No protected properties found
N/A
get_node_path()
_list_child_nodes()
_list_child_elements()
_get_css_classes()
_display_element()
$_nap
$node_path
$_level
N/A

Properties

$root_id

$root_id : integer

ID for the folder to get the navigation

Type

integer

$skip_levels

$skip_levels : integer

The amount of lowest level elements to be skipped.

Type

integer

$list_leaves

$list_leaves : boolean

Switch to determine if navigation should display leaves or pages.

Type

boolean

$list_nodes

$list_nodes : boolean

List only the leaf elements or pages

Type

boolean

$follow_selected

$follow_selected : boolean

Switch to determine if navigation should follow node path (on true) or stop on the spot.

Type

boolean

$follow_all

$follow_all : boolean

Switch to determine if navigation should follow all the nodes or only the current

Type

boolean

$show_only_current

$show_only_current : boolean

Switch to determine if navigation should show only the information of the currently selected node.

Type

boolean

$list_levels

$list_levels : integer

Restrict the amount of levels listed.

Type

integer

$root_object_id

$root_object_id : integer

ID of the root level list object

Type

integer

$css_list_style

$css_list_style : string

CSS class for styling the lists

Type

string

$component_name_to_class

$component_name_to_class : boolean

Add component name to list item ul class name

Type

boolean

$has_children_to_class

$has_children_to_class : boolean

Check if item has children and if so, add node/leaf class to list item

Type

boolean

$object_status_to_class

$object_status_to_class : boolean

Should the object's status be added to list item ul class names Since this forces us to load the entire object, set it to false if you don't need it

Type

boolean

$css_node

$css_node : string

CSS class for nodes

Type

string

$css_leaf

$css_leaf : string

CSS class for leaves

Type

string

$css_selected

$css_selected : string

CSS class for the elements in node path. All the elements in node path will have this class.

Type

string

$css_active

$css_active : string

CSS class for the current, active node or leaf. There can be only one active element.

Type

string

$css_link

$css_link : string

CSS class for links

Type

string

$_nap

$_nap : \midcom_helper_nav

MidCOM helper class for navigation subsystem. Uses class 'midcom.helper.nav'

Type

\midcom_helper_nav

$node_path

$node_path : Array

Stores the navigation access point history or in other words path to the current point.

Type

Array

$_level

$_level : integer

Number of the parsed level

Type

integer

Methods

__construct()

__construct(  $id = null) 

Here we initialize the classes and variables needed through the class.

Parameters

$id

draw()

draw() 

Draw the navigation.

set_root_element_id()

set_root_element_id(integer  $id) 

Set the root element id

Parameters

integer $id

root ul id

get_node_path()

get_node_path() 

Traverses through the node path to fetch the location of the current navigation access point.

_list_child_nodes()

_list_child_nodes(  $id) 

Traverse the child nodes starting from the requested node id

Parameters

$id

_list_child_elements()

_list_child_elements(  $id) 

Traverse the child elements starting from the requested node id

Parameters

$id

_get_css_classes()

_get_css_classes(  $child,   $item,   $item_counter,   $item_count) 

Parameters

$child
$item
$item_counter
$item_count

_display_element()

_display_element(  $item,   $css_classes) 

Parameters

$item
$css_classes