Bracket Node API Functions

Functions

 bracket_api_design_list ()
 bracket_api_design_exists ($design)
 bracket_api_create_bracket ($title, $design)
 bracket_api_load_bracket ($nid)
 bracket_api_update_bracket ($node)
 bracket_api_delete_bracket ($nid)
 bracket_api_image ($node)
 bracket_api_pdf ($node)
 bracket_api_clone_bracket ($node, $title)
 bracket_api_xml_export ($node, $opt= 'bracket')
 bracket_api_xml_import ($xml, &$node, $opt= 'bracket')

Detailed Description

Bracket Nodes The bracket module allows for the creation and manipuation of tournament brackets. Brackets are stored as nodes and consist of competitors, matches, rounds, and results. Since there are so many different bracket configurations, each bracket structure is defined and managed by a bracket "design". The design determines the number of competitors in the bracket, the configuration of the bracket (single-elimination, double elimination, etc), and produces the bracket displays.

Bracket Object Internally, bracket information is stored in a Bracket object - as defined in bracket_class.inc. Competitor, Round, Match, and Result objects are utilized as well in order to store information for their respective data types. The bracket objects can be manipulated directly and then saved in order to update the bracket. However, the number of Competitor, Round, Match, and Result objects should not be modified as this may cause problems in the bracket rendering. The number of objects in the Bracket object is fixed at bracket creation time.


Function Documentation

bracket_api_clone_bracket ( node,
title 
)

clone a bracket node

Parameters:
$node the bracket node to clone
$title the title of the new bracket
Returns:
the new bracket node or FALSE if clone failed
bracket_api_create_bracket ( title,
design 
)

Create a new bracket node

Parameters:
$title the bracket title
$design the bracket design
Returns:
the bracket node or FALSE if create failed
bracket_api_delete_bracket ( nid  ) 

Delete a bracket node

Parameters:
$nid the node id of the bracket node to be deleted
bracket_api_design_exists ( design  ) 

Check to see if design files exist

Parameters:
$design the design name
Returns:
TRUE if design files exist, FALSE if not
bracket_api_design_list (  ) 

Return an associative array of the available bracket designs

Returns:
the design array - the key is the design code - the value is the design description
bracket_api_image ( node  ) 

get bracket image

Parameters:
$node the bracket node
Returns:
the bracket image or FALSE if failure occurrs
bracket_api_load_bracket ( nid  ) 

Load a bracket node

Parameters:
$nid the node id of the bracket node to be loaded
Returns:
the bracket node or FALSE if load failed
bracket_api_pdf ( node  ) 

get bracket pdf

Parameters:
$node the bracket node
Returns:
the bracket pdf or FALSE if failure occurrs
bracket_api_update_bracket ( node  ) 

Update a bracket node

Parameters:
$node the bracket node to be updated
bracket_api_xml_export ( node,
opt = 'bracket' 
)

Export the bracket as an xml document

Parameters:
$node the node object containing the bracket
$opt option - 'bracket' = export entire bracket, 'results' = export results only
Returns:
a string containing an XML document representing the bracket
bracket_api_xml_import ( xml,
&$  node,
opt = 'bracket' 
)

Import a bracket from an xml document

Parameters:
$xml the xml document containing the bracket to import
$node the node object to receive the bracket
$opt option - 'bracket' = import entire bracket, 'results' = import competitors from results export matching seeds
Returns:
TRUE if bracket was imported, FALSE if an error occurred
 All Data Structures Files Functions Variables
Generated on Sat Jul 10 15:07:40 2010 by  doxygen 1.6.3