FORMfields


FORMfields.FfMenuHelper

Class FfMenuHelper

FfMenuHelper

public class FfMenuHelper

A class used to build dynamic 2 tier menus that are styled with CSS.

Since:
FORMfields v3.0

Method Summary
string

getMenu(string selectedTab, string selectedLink, array menuArray)

Returns the HTML to display a horizontal 2 tier menu.

string

getMenuLinks(array menuLinks, mixed selectedLink, sring the)

Returns the HTML that displays the tab sub links in a horizontal menu.

string

getNotSelectedTab(array tab, boolean first)

Returns the HTML used to display an unselected tab in a horizontal menu.

string

getSectionFooter(string classPrefix)

Returns the HTML to display the footer of a section widget.

string

getSectionHeader(string classPrefix)

Returns the HTML to display the header of a section widget.

string

getSectionTitleFooter(string classPrefix, string title)

Returns the HTML to display the footer of a section title widget.

string

getSectionTitleHeader(string title, string classPrefix)

Returns the HTML to display the header of a section title widget.

string

getSelectedTab(array tab, boolean first)

Returns the HTML used to display a selected tab in a horizontal menu.

string

getTitle(string title, string classPrefix)

Returns the HTML to display the title widget.

string

getVerticalMenu(string selectedTab, string selectedLink, array menuArray)

Returns the HTML to display a vertical 2 tier menu.

string

getVerticalMenuLinks(array menuLinks, mixed selectedLink, string the)

Returns the HTML that displays the tab sub links in a vertical menu.

string

getVerticalNotSelectedTab(array tab)

Returns the HTML used to display an unselected tab in a vertical menu.

string

getVerticalSelectedTab(array tab)

Returns the HTML used to display a selected tab in a vertical menu.

void

printMenu(string selectedTab, string selectedLink, array menuArray)

Echos the HTML to display a horizontal 2 tier menu.

void

printMenuLinks(array menuLinks, mixed selectedLink, sring the)

Echos the HTML that displays the tab sub links in a horizontal menu.

void

printNotSelectedTab(array tab, boolean first)

Echos the HTML used to display an unselected tab in a horizontal menu.

void

printSectionFooter(string classPrefix)

Echos the HTML to display the footer of a section widget.

void

printSectionHeader(string classPrefix)

Echos the HTML to display a section header widget.

void

printSectionTitleFooter(string classPrefix, string title)

Echos the HTML to display the footer of a section title widget.

void

printSectionTitleHeader(string title, string classPrefix)

Echos the HTML to display the header of a section title widget.

void

printSelectedTab(array tab, boolean first)

Echos the HTML used to display a selected tab in a horizontal menu.

void

printTitle(string title, string classPrefix)

Echo the HTML to display the title widget.

void

printVerticalMenu(string selectedTab, string selectedLink, array menuArray)

Echos the HTML to display a vertical 2 tier menu.

void

printVerticalMenuLinks(array menuLinks, mixed selectedLink, string the)

Echos the HTML that displays the tab sub links in a vertical menu.

void

printVerticalNotSelectedTab(array tab)

Echos the HTML used to display an unselected tab in a vertical menu.

void

printVerticalSelectedTab(array tab)

Echos the HTML used to display a selected tab in a vertical menu.

Method Detail

getMenu

public string getMenu(string selectedTab, string selectedLink, array menuArray)

Returns the HTML to display a horizontal 2 tier menu. An example menuArray: $menuItem1 =
array(
array("Sub Item 1a", "subItem1a.php", null),
array("Sub Item 1b", "subItem1b.php", null),
array("Sub Item 1c", "subItem1c.php", null)
);

$menuItem2 =
array(
array("Sub Item 2a", "subItem2a.php", null),
array("Sub Item 2b", "subItem2b.php", null),
array("Sub Item 2c", "subItem2c.php", null)
);

$menuItem3 =
array(
array("Sub Item 3a", "subItem3a.php", null),
array("Sub Item 3b", "subItem3b.php", null),
array("Sub Item 3c", "subItem3c.php", null, "target=\"_blank\"")
);

$menuArray =
array(
array("Item 1", "menuItem1.php", $menuItem1),
array("Item 2", "menuItem2.php", $menuItem2),
array("Item 3", "menuItem3.php", $menuItem3, "target=\"_blank\"")
);

Parameters:
selectedTab - the tab text of the selected tab or null
selectedLink - the tab text of the selected tab sub link or null
menuArray - array of tab menu items where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag
Returns:
the HTML to display a horizontal 2 tier menu
Since:
FORMfields v3.0

getMenuLinks

public string getMenuLinks(array menuLinks, mixed selectedLink, sring the)

Returns the HTML that displays the tab sub links in a horizontal menu.

Parameters:
menuLinks - an array of arrays where the 1st element is the link text, the 2nd is the link URL, 3rd is another link array and the 4th is any extra HTML included in the tab's a tag.
the - link text of the selected link
Returns:
the HTML that displays the tab sub links.
Since:
FORMfields v3.0

getNotSelectedTab

public string getNotSelectedTab(array tab, boolean first)

Returns the HTML used to display an unselected tab in a horizontal menu.

Parameters:
tab - where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag
first - true if this is the 1st or leftmost tab
Returns:
the HTML used to display an unselected tab in a horizontal menu.
Since:
FORMfields v3.0

getSectionFooter

public string getSectionFooter(string classPrefix)

Returns the HTML to display the footer of a section widget.

Parameters:
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffRoundBox.
Returns:
the HTML to display the footer of a section widget
Since:
FORMfields v3.0

getSectionHeader

public string getSectionHeader(string classPrefix)

Returns the HTML to display the header of a section widget.

Parameters:
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffRoundBox.
Returns:
the HTML to display the header of a section widget
Since:
FORMfields v3.0

getSectionTitleFooter

public string getSectionTitleFooter(string classPrefix, string title)

Returns the HTML to display the footer of a section title widget.

Parameters:
title - the title text
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffSectionTitle.
Returns:
the HTML to display the footer of a section title widget.
Since:
FORMfields v3.0

getSectionTitleHeader

public string getSectionTitleHeader(string title, string classPrefix)

Returns the HTML to display the header of a section title widget.

Parameters:
title - the title text
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffSectionTitle.
Returns:
the HTML to display the header of a section title widget.
Since:
FORMfields v3.0

getSelectedTab

public string getSelectedTab(array tab, boolean first)

Returns the HTML used to display a selected tab in a horizontal menu.

Parameters:
tab - where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag.
first - true if this is the 1st or leftmost tab
Returns:
the HTML used to display a selected tab in a horizontal menu.
Since:
FORMfields v3.0

getTitle

public string getTitle(string title, string classPrefix)

Returns the HTML to display the title widget.

Parameters:
title - the title text
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffTitle.
Returns:
the HTML to display the title widget
Since:
FORMfields v3.0

getVerticalMenu

public string getVerticalMenu(string selectedTab, string selectedLink, array menuArray)

Returns the HTML to display a vertical 2 tier menu. An example menuArray: $menuItem1 =
array(
array("Sub Item 1a", "subItem1a.php", null),
array("Sub Item 1b", "subItem1b.php", null),
array("Sub Item 1c", "subItem1c.php", null)
);

$menuItem2 =
array(
array("Sub Item 2a", "subItem2a.php", null),
array("Sub Item 2b", "subItem2b.php", null),
array("Sub Item 2c", "subItem2c.php", null)
);

$menuItem3 =
array(
array("Sub Item 3a", "subItem3a.php", null),
array("Sub Item 3b", "subItem3b.php", null),
array("Sub Item 3c", "subItem3c.php", null, "target=\"_blank\"")
);

$menuArray =
array(
array("Item 1", "menuItem1.php", $menuItem1),
array("Item 2", "menuItem2.php", $menuItem2),
array("Item 3", "menuItem3.php", $menuItem3, "target=\"_blank\"")
);

Parameters:
selectedTab - the tab text of the selected tab or null
selectedLink - the tab text of the selected tab sub link or null
menuArray - array of tab menu items where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag
Returns:
the HTML to display a vertical 2 tier menu
Since:
FORMfields v3.0

getVerticalMenuLinks

public string getVerticalMenuLinks(array menuLinks, mixed selectedLink, string the)

Returns the HTML that displays the tab sub links in a vertical menu.

Parameters:
menuLinks - an array of arrays where the 1st element is the link text, the 2nd is the link URL, 3rd is another link array and the 4th is any extra HTML included in the tab's a tag.
the - link text of the selected link
Returns:
the HTML that displays the tab sub links.
Since:
FORMfields v3.0

getVerticalNotSelectedTab

public string getVerticalNotSelectedTab(array tab)

Returns the HTML used to display an unselected tab in a vertical menu.

Parameters:
tab - where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag.
Returns:
the HTML used to display an unselected tab in a horizontal menu.
Since:
FORMfields v3.0

getVerticalSelectedTab

public string getVerticalSelectedTab(array tab)

Returns the HTML used to display a selected tab in a vertical menu.

Parameters:
tab - where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag.
Returns:
the HTML used to display a selected tab in a vertical menu.
Since:
FORMfields v3.0

printMenu

public void printMenu(string selectedTab, string selectedLink, array menuArray)

Echos the HTML to display a horizontal 2 tier menu.

Parameters:
selectedTab - the tab text of the selected tab or null
selectedLink - the tab text of the selected tab sub link or null
menuArray - array of tab menu items where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag
Since:
FORMfields v3.0

printMenuLinks

public void printMenuLinks(array menuLinks, mixed selectedLink, sring the)

Echos the HTML that displays the tab sub links in a horizontal menu.

Parameters:
menuLinks - an array of arrays where the 1st element is the link text, the 2nd is the link URL, 3rd is another link array and the 4th is any extra HTML included in the tab's a tag.
the - link text of the selected link
Since:
FORMfields v3.0

printNotSelectedTab

public void printNotSelectedTab(array tab, boolean first)

Echos the HTML used to display an unselected tab in a horizontal menu.

Parameters:
tab - where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag
first - true if this is the 1st or leftmost tab
Since:
FORMfields v3.0

printSectionFooter

public void printSectionFooter(string classPrefix)

Echos the HTML to display the footer of a section widget.

Parameters:
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffRoundBox.
Since:
FORMfields v3.0

printSectionHeader

public void printSectionHeader(string classPrefix)

Echos the HTML to display a section header widget.

Parameters:
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffRoundBox.
Since:
FORMfields v3.0

printSectionTitleFooter

public void printSectionTitleFooter(string classPrefix, string title)

Echos the HTML to display the footer of a section title widget.

Parameters:
title - the title text
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffSectionTitle.
Since:
FORMfields v3.0

printSectionTitleHeader

public void printSectionTitleHeader(string title, string classPrefix)

Echos the HTML to display the header of a section title widget.

Parameters:
title - the title text
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffSectionTitle.
Since:
FORMfields v3.0

printSelectedTab

public void printSelectedTab(array tab, boolean first)

Echos the HTML used to display a selected tab in a horizontal menu.

Parameters:
tab - where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag
first - true if this is the 1st or leftmost tab
Since:
FORMfields v3.0

printTitle

public void printTitle(string title, string classPrefix)

Echo the HTML to display the title widget.

Parameters:
title - the title text
classPrefix - a string that is appended to the class name to uniquely identify the CSS for this widget. Defaulted to ffTitle.
Since:
FORMfields v3.0

printVerticalMenu

public void printVerticalMenu(string selectedTab, string selectedLink, array menuArray)

Echos the HTML to display a vertical 2 tier menu.

Parameters:
selectedTab - the tab text of the selected tab or null
selectedLink - the tab text of the selected tab sub link or null
menuArray - array of tab menu items where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag
Since:
FORMfields v3.0

printVerticalMenuLinks

public void printVerticalMenuLinks(array menuLinks, mixed selectedLink, string the)

Echos the HTML that displays the tab sub links in a vertical menu.

Parameters:
menuLinks - an array of arrays where the 1st element is the link text, the 2nd is the link URL, 3rd is another link array and the 4th is any extra HTML included in the tab's a tag.
the - link text of the selected link
Since:
FORMfields v3.0

printVerticalNotSelectedTab

public void printVerticalNotSelectedTab(array tab)

Echos the HTML used to display an unselected tab in a vertical menu.

Parameters:
tab - where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag.
Since:
FORMfields v3.0

printVerticalSelectedTab

public void printVerticalSelectedTab(array tab)

Echos the HTML used to display a selected tab in a vertical menu.

Parameters:
tab - where the 1st element is the tab text, the 2nd is the tab URL, the 3rd is another tab array and the 4th is any extra HTML included in the tab's a tag.
Since:
FORMfields v3.0

FORMfields