Methods to access properties of a theme
Located in /program/lib/theme.class.php (line 34)
Class | Description |
---|---|
![]() |
/program/themes/frugal/frugal.class.php - the class that comprises the most minimal theme |
construct a Theme object
this stores the information about this theme from the database. Also, we construct/read the tree of nodes for this area $area_id. This information will be used lateron when constructing the navigation. The node to display is $node_id.
add a line or array of lines to the content part of the document
add a header to the HTML head part of the document
add an HTTP-header
add a message to the list of inline messages, part of the BODY of the document
add a line with meta-information to the HTML head part of the document
add a line with http-equiv meta-information to the HTML head part of the document
add a message to the list of popup-messages at the BOTTOM of the document
add a message to the list of popup-messages at the TOP of the document
add a link to a stylesheet to the HTML head part of the document
set breadcrumbs in tree AND construct list of clickable anchors
Note: the anchors are created with the current setting of the preview mode, so if that changes after we construct a list of anchors we're in trouble. I prefer late binding, so the real list to use should be created in the phase where the HTML-code is constructed. Mmmmm...
calculate the visibility of the nodes in the tree
construct an alphanumeric string from a node title (for a readable bookmark)
this strips everything from $title except alphanumerics and spaces. The spaces are translated to an underscore. Length of result is limited to an arbitrary length of 50 characters.
return the reconstructed URL in a single (indented) line
This constructs the exact URL (including the GET-parameters) of the current script. This URL is returned as HTML so it can be displyed. It is NOT meant to be a clickable link, but as a documentation of the actual URL that was used. Note that this URL can be suppressed by an appropriate 'display:none' in the stylesheet, making it an item that only appears on a hardcopy (media="print") and not on screen.
show 'powered by' and (maybe) report basic performance indicators
This calculates the execution time of the script and the number of queries. Note a special trick: we retrieve the translated string in a dummy variable before calculating the number of queries because otherwise we might miss one or more query from the language/translation subsystem.
Note: for the time being the performance report commented out (2010-12-08).
get all lines in the content DIV in a single properly indented string
construct breadcrumb trail
get a perhaps bulleted list of messages in a DIV
This constructs an unordered list with messages, if there are any If there is no message at all, an empty string is returned (without DIV). If there is a single message, no bullet is added to the message. If there are two or more messages, bullets are added.
Note that this routine is an exception with respect to the DIV-tags: this helper routine DOES generate its own DIVs whenever there is at least 1 message. This means that there is no DIV at all when there are no messages.
construct an output page in HTML
This constructs a full HTML-page, starting at the DTD and ending with the html closing tag.
The page is constructed using nested DIVs, the layout is taken care of in a separate style sheet. All knowledge about the structure of the page is contained in this routine.
The performance of the script (# of queries, execution time) is calculated as late as possible, to catch as much as we can. Therefore the construction is done in two parts and performance is calculated last.
The contents of the various DIVs is constructed in various helper routines in order to make this routine easy to read (by humans that is). The various helper routines all are called with a string of space characters; this should improve the the readability of the page that is generated eventually.
Note that the routine $this->get_div_messages() does in fact generate its own DIV tags. This is done in order to completely get rid of the message DIV, we do not even want to see an empty DIV if there are no message.
The same logic applies to the breadcrumb trail.
get all lines in the HTML head section in a single properly indented string
construct a simple jumplist to navigate to other areas
this constructs a listbox with areas to which the current user has access. The user can pick an area from the list and press the [Go] button to navigate to that area. Only the active areas are displayed. Private areas are only displayed when the user actually has access to those areas.
get lines from an array in a single properly indented string
This is a workhorse to convert an array of lines to a properly indented block of text.
construct an image tag with the area logo
This constructs HTML-code that displays the logo.
construct javascript alerts for messages
This constructs a piece of HTML that yields 0 or more calles to the javascript alert() function, once per message. If no messages need to be displayed an empty string is returned.
retrieve configuration parameters for this combination of theme and area
construct a list of quicklinks for bottom of page (if any)
(see also get_quicktop()).
workhorse for constructing list of quicklinks
This creates HTML-code for links that can be displayed at the top of the page. These links are the pages (but not subsections) defined in the quicktop_section_id in $this->config.
Note that this array may or may not exist and also that the section may or may not exist and that the section may or may not contain any visible pages. Mmm, that's a lot of may/maynot's...
Also note that these links are always displayed as text, even if a graphics image is defined in the corresponding node. The contents of the section can be found in $this->tree.
construct a list of quicklinks for top of page (if any)
(see also get_quickbottom()).
construct an anchor from a node record
This constructs an array with key-value-pairs that can be used to construct an HTML anchor tag. At least the following keys are created in the resulting array: 'href', 'title' and 'anchor'. The latter is either the text or a referenct to an image that is supposed to go between the opening tag and closing tag. Furtermore an optional key is created: target. The contents of the input array $attributes is merged into the result.
If the parameter $textonly is TRUE the key 'anchor' is always text. If $textonly is NOT TRUE, the 'anchor' may refer to an image.
Note that the link text is always non-empty. If the node record has an empty link_text, the word 'node' followed by the node_id is returned. (Otherwise it will be hard to make an actual clickable link).
send collected HTTP-headers to user's browser
This sends the headers that still need to be sent. These are collected in the array $this->http_headers. If headers are already sent, this fact is logged (and the collected headers are not sent).
send collected output to user's browser
This first sends any pending HTTP-headers and subsequently outputs the page that is constructed by $this->get_html()
Documentation generated on Wed, 11 May 2011 23:45:37 +0200 by phpDocumentor 1.4.0