HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: Splurgh

» Return to Contents



The splurgh functions build up a special compressed format of a tree structure, that is output as javascript code. Javascript functions in javascript.php interpret the compressed format, expanding it into a full uncompressed page.

sources/splurgh.php

Global_functions_splurgh.php

Function summary

string splurgh_master_build (string key_name, array map, URLPATH url_stub, ID_TEXT _cache_file, TIME last_change_time, ?AUTO_LINK first_id)
string _splurgh_do_node (array map, AUTO_LINK node, string chain, array fulltable, integer nest)

string splurgh_master_build(string key_name, array map, URLPATH url_stub, ID_TEXT _cache_file, TIME last_change_time, ?AUTO_LINK first_id)

Get a splurghified version of the specified item.

Parameters…

Name key_name
Description The name of what the key we want to reference is in our array of maps (e.g. 'id')
Type string

Name map
Description A row of maps for data we are splurghing; this is probably just the result of $GLOBALS['SITE_DB']->query_select
Type array

Name url_stub
Description The stub that links will be passed through
Type URLPATH

Name _cache_file
Description The page name we will be saving customised HTML under
Type ID_TEXT

Name last_change_time
Description The time we did our last change to the data being splurghed (so it can see if we can simply decache instead of deriving)
Type TIME

Name first_id
Description The ID that is at the root of our tree (NULL: db_get_first_id)
Default value
Type ?AUTO_LINK

Returns…

Description A string of HTML that represents our splurghing (will desplurgh in the users browser)
Type string

Return to the function index for this class Expand: View the source code to this function

string _splurgh_do_node(array map, AUTO_LINK node, string chain, array fulltable, integer nest)

Build up the splurgh nodes recursively for given details.

Parameters…

Name map
Description A row of maps for data we are splurghing; this is probably just the result of $GLOBALS['SITE_DB']->query_select
Type array

Name node
Description The node we are examining
Type AUTO_LINK

Name chain
Description The chain we have built up during our recursion
Type string

Name fulltable
Description Nodes marked as done (so we don't repeat them in other hierarchy positions if it they get repeated)
Type array

Name nest
Description The level of recursion
Type integer

Returns…

Description A specially encoded string that represents our splurghing
Type string

Return to the function index for this class Expand: View the source code to this function