CDM
[ class tree: CDM ] [ index: CDM ] [ all elements ]

Class: CDMObjectTree

Source Location: /modules/xbs_cdm/class/CDMTree.php

Class Overview


A tree structure with CDMBaseObjects as nodes This is based on XoopsObjectTree which doesn't work as expected


Author(s):

  • A Kitson (http://xoobs.net)

Copyright:

  • (c) 2005 Ashley Kitson, Great Britain

Methods



Class Details

[line 51]
A tree structure with CDMBaseObjects as nodes This is based on XoopsObjectTree which doesn't work as expected



Tags:

copyright:  (c) 2005 Ashley Kitson, Great Britain
author:  A Kitson (http://xoobs.net)


[ Top ]


Class Methods


constructor CDMObjectTree [line 69]

CDMObjectTree CDMObjectTree( array &$objectArr, string $myId, string $parentId)

Constructor



Parameters:

array   $objectArr   Array of CDMObjects
string   $myId   field name of object ID
string   $parentId   field name of parent object ID

[ Top ]

method getSelArr [line 199]

an getSelArr( [string $dispFld = 'cd_value'], [string $prefix = '-'])

Function getSelArr

creates an associative array of code=>value where value is indented by $prefix if not a level zero node in the tree. Primarily intended to be used by CDMFormTreeSelect() to create a selection form box




Tags:

return:  associative array 'code => value' of the code set in tree hierarchy order


Parameters:

string   $dispFld   name of field to use for value
string   $prefix   character used to indent tree hierarchy

[ Top ]

method getTree [line 94]

array &getTree( )

Get the tree



Tags:

return:  Associative array comprising the tree


[ Top ]

method makeSelBox [line 147]

string &makeSelBox( string $name, string $fieldName, [string $selected = ''], [string $prefix = '-'], [bool $addEmptyOption = false], [integer $key = 0])

Make a select box with options from the tree

NB, this makes only the selection box, not its label etc. To use a fully formed selection box use CDMFormTreeSelect() to be found in class.cdm.form.php




Tags:

return:  HTML select box


Parameters:

string   $name   Name of the select box
string   $fieldName   Name of the member variable from the node objects that should be used as the title for the options.
string   $selected   Value to display as selected
string   $prefix   String to indent deeper levels
bool   $addEmptyOption   Set TRUE to add an empty option with value "0" at the top of the hierarchy
integer   $key   ID of the object to display as the root of select options

[ Top ]


Documentation generated on Fri, 03 Mar 2006 08:55:52 +0000 by phpDocumentor 1.3.0RC3