Rainbows Puppies & Sunshine Framework
Main Site About Files Reference
Framework Files Of This Specific Installation
Files Of This Specific Page

Reference Guide

The sections below detail the purpose of each of the 4 framework files, the elements contained in each file and the very bottom provides examples of each css element available within the framework. To configure and download the framework files use the Files Page.

Framework Files

template.php Implementation of a framework page that will be displayed in a browser. Combines all functions in proper order to produce a blank skeleton page of the framework. This file is intended to be used as the basis to create all pages of the framework.
sys.php Processes data of framework. Contains all the functions used to work with data: makes a database connection, validates input data, converts data and other non-layout related functions of the framework.
layout.php Base - Minimum functions needed to produce the HTML that will create an essentially blank page of the framework. These functions create the HTML head section, the page header, left menu column, body structure and footer of an HTML page.

Extended - Functions used to produce HTML for elements that are not part of the skeleton but very commonily used. These functions help to quickly generate input forms, form elements and tables to display data.
layout.css Base - Minimum CSS elements needed to create a page with this framework. These elements are the ones that appear in the page header, body structure and footer.

Extended - CSS elements used to for elements that are not part of the skeleton but very commonily used. Thses elements are for indentented paragraphs, H tags and commonly used form elements.


db_start() Makes database connection using database variables in configuration section.
0-success, 1-failure.
convert_date2date() Converts MySQL formatted date ('2010-01-01') to displayable date format ('1/1/2010') and vice versa.
validate_slength($s, $min, $max) Verifies a string's length is within a specified range.
0-success, 1-failure.
$s is string to test.
$min is minimum length of string.
$max is maximum length of string.
validate_nvalue($n, $min, $max) Verifies a number is within a specified range.
0-success, 1-failure.
$n is number to test.
$min is minimum value of number.
$max is maximum value of number.
validate_email($e) Verifies a string has valid format of email address.
0-success, 1-failure.
$e is email address to test.
validate_password($p1, $p2) Verifies two strings match each other and meet rules for being a password.
0-success, 1-failure.
$p1 is first instance of password.
$p1 is second instance of password.
validate_admin($p, $n) Determines if admin is signed on or not.
0-no, 1-yes
$p is password.
$n is admin name.
get_urll($u) Retrieves output of a url as a string.
$u is url to retreive.

layout.php, Base

hook_headincludes() Function to put any included files (i.e. javascript, css) that need to be loaded into the head of every html document framework produces.
hook_header() Function to put any html that needs to show in the header of every page framework produces.
hook_leftcolumn() Function to put any html that needs to show in the left column of every page framework produces.
hook_footer() Function to put any html that needs to show in the footer of every page framework produces.
html_htmlhead($title=" ") Spits out HTML code for head of document down to just before closing head tag.
$title will appear in title tag.
html_bodyhead() Spits out HTML code from closing head tag to beginning of main area.
html_bodyfoot() Spits out HTML code from closing of main area to end of document.
html_leftmenu() Creates HTML for menu appearing in left column.
html_horzmenu($pos="top") Creates HTML for horizontal menu of page.
$pos determines if it is top ("top") or bottom ("bottom") menu of page.
html_comments($s1, $s2="", $lines=2) Creates HTML comments.
$s1 is first line of comment.
$s2 is second line of comment.
$lines is how many lines comments take up.
html_div($t, $class="alert") Creates HTML for text inside a div, by default its an alert div.
$t is text to appear inside div tag.
$class is CSS class of div tag.
html_link($url, $t, $class="plain") Creates HTML for a hyperlink.
$url is where the link goes to.
$t is what will be shown on screen.
$class is CSS class of link.

layout.php, Extended

html_form($url, $action="post", $hidnames=0, $hidvalues=0) Creates HTML for form tag and any hidden tags of form.
$url is where the form's data will be sent.
$action is how to send the form's data, either "get" or "post".
$hidnames is names of all hidden tags the form has.
$hidvalues is values of all hidden tags the form has.
html_formhidden($name, $default) Creates HTML for hidden input tag.
$name is name of input.
$default is value of input.
html_forminput($size, $max, $name, $default="", $class="form_input") Creates HTML for text input tag.
$size is how large it should appear.
$max is how many characters can be typed into it.
$name is HTML name of the tag.
$default is default value it shows.
$class is the CSS class of the tag.
html_formselect($values, $displays, $name, $default="", $class="form_select") Creates HTML for select tag input.
$values is array or number that determines what is value of select tag. If number it shows from that number to $displays.
$displays is array or number that determines what is shown in select tag. If number it is upper bound.
$default is value of select tag that should be chosen initially.
$name is HTML name of the select tag.
$class is the CSS class of the select tag.
html_formcheckbox($name, $value=1, $checked=0) Creates HTML for checkbox.
$name is name of checkbox.
$value is value that checkbox returns when set to true.
$checked determines default value, 1=checked, 0 not checked.
html_formtextarea($name, $default="", $class="form_text") Creates HTML for textarea tag.
$name is name of textarea.
$default is value to appear inside textarea.
$class is CSS class of textarea.
html_formbutton($t, $class="form_button") Creates HTML for submit button of form.
$t is text to appear on button.
$class is CSS class of input.
html_horzform($rows, $columns=0) Creates HTML for entire form with horizontal rows of data.
$rows is array of array of strings which holds data for each cell of table.
$columns is array of strings that will be column headings.
html_vertform($cells) Creates HTML for entire form with vertical layout of data (1 record).
$cells is array of strings for cells of table, odd indexed items go in left cell, even indexed items on right.

layout.css, Base

a.home Link in top-left corner of site where site title/logo goes.
div.horzmenu_top Container for links in top horizontal menu just under site title/logo.
a.horzmenu_top Top horizontal menu link, inside div.horzmenu_top.
td.structure_left Table cell of left column of main portion of page.
td.structure_main Table cell of right column (main, large area) of page.
div.structure_main Container for entire main section of page.
h1 Tag in top left corner of main section of page to display page name.
div.horzmenu_bottom Container for links in bottom horizontal menu just under left column and main section.
a.horzmenu_bottom Bottom horizontal menu link, inside div.horzmenu_bottom

layout.css, Extended

h2 Creates a colored box used for headings.
h3 Creates left aligned, underline for subheadings.
p Main section paragraph tag which pads it left and right just enough to come off borders.
p.margin_left Paragraph that is indented to from the left.
p.margin_top Paragraph with extra space above where it starts.
a.plain Common link for use within content of main section.
div.alert Contains highlighted message to user.
form Form tag that doesn't have line breaks before or after it.
table.form_table Table tag for form with raised borders.
td.vertform_cell Table cell tag for form laid out vertically.
td.form_header Table cell tag for headers of a horizontal form table.
td.horzform_cell0 Tag for row of cells in horizontal form table with main color background.
td.horzform_cell1 Tag for row of cells in horizontal form table with secondary color background.
a.form Link to be used within a table form cell.
input.form_text Text box tag input
select.form_select Select tag input
input.form_button Input Button tag
textarea.form_text Textarea tag input

Extended CSS Examples





td.form_header td.form_header td.form_header td.form_header td.form_header





p.margin_left a.plain

Main Site About Files Reference
Rainbows Puppies & Sunshine