Standard buttons for my PHP applications

What is this

A graphical library (css with in-lined images) and a single PHP function that generates complete HTML either as an A-tag for URLs or a SPAN-tag for on-page Javascript functions.

Or look at this CSS only page

Get started

Use

Call CtrlBut function to supply complete HTML as an A or SPAN tag.
A typical call might be CtrlBut('change',123,'http:foo.com?id=%%&action=edit','Edit') or CtrlBut('no',123,'LocalDelete(%%)','Delete')

Images

Hover over image for name. This will be used as the first argument in CtrlBut()

Calling the CtrlBut() function

function CtrlBut($Type,$Id,$Action,$Title='')

Return <A> or <SPAN> styled as one of our standard control buttons
Type is one of the following strings for live buttons
add,back,bottom,change,down,fly (ie.external link)
get,go,help,info,mail,no,put,top,up,view,yes
or
topx,bottomx,upx,downx (disabled list navigation)

Id is some Id which may be a null string.
In the case of a SPAN this will be used as an element Id

Action is either http... or a javascript function
The Id will be substituted into a two percent sign placemarker
eg http://some.place?id=%%
eg DoMyJsThing(%%)

Title becomes a hover-over-hint. If not supplied then a default is used.

Examples

URL to index page CtrlBut('back','123','http:vulpeculox.net/misc','Back to index')
Javascript call CtrlBut('info','456','ClicketyClick(%%)')
%% is place holder for id
Javascript call CtrlBut('top','-2','ClicketyClick(this.id)')
this is the SPAN element
Disabled CtrlBut('bottomx','','ClicketyClick()','Go to end of list')
The x in the type is the disabling key
1 If you want to play with the raw images and css file then Download this zip file