PHP Classes
elePHPant
Icontem

LinkRow: Quick button row generation

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2003-11-03 (12 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 825 All time: 4,021 This week: 2,110Up
Version License Categories
class_linkrow 1.0GNU General Publi...HTML
Description Author

Given a list of description and href URL, generate a row of button in horizontal/vertical, embeded in table/span tag. A simple class good enough for maybe internal web server. For more complex link row please refer to
http://www.chipchapin.com/WebTools/MenuTools/

The appearance of the button and table is fully given over to the stylesheet. You just need to specify which class you want to use for
individual buttons, and in the style sheet, you just enter:

<style>
.button { ... }
.button:link { ... }
.button:visited { ... }
.button:active { ... }
</style>

Picture of Mark Quah
Name: Mark Quah <contact>
Classes: 7 packages by
Country: Singapore Singapore

Details
CLASS_LINKROW.PHP
=================

A simple implementation of drop-down buttons.

header1 | header2 | header3 | ....
   |         |
   V         V
 item11    item21
 item12

Mouse hover over header1 will drop down list of item11 and item12.
Each button, includer header and item, can be either a http link or just a comment.
The presentation of the button are based on CSS style and can be specified individualy.

To construct above lists:

   $linkrow = new LINKROW();      // no parameter needed
   // Add first column
   $linkrow->AddColumn();         // start of first column
   $linkrow->AddItem("header1", "", "header-no-link");  // header button (always display)
   $linkrow->AddItem("item11", "http://item11", "linkstyle");  // first button with link
   $linkrow->AddItem("item12", "", "commentstyle");  // second button is just a comment
   // Add second column
   $linkrow->AddColumn();         // start of first column
   $linkrow->AddItem("header2", "http://header2", "header-with-link");  // header button (always display)
   $linkrow->AddItem("item21", "http://item21", "linkstyle");  // first button with link
   // Add third column
   $linkrow->AddColumn();         // start of first column
   $linkrow->AddItem("header3", "http://header3", "header-with-link");  // header button (always display)
   // Add fourth column
   $linkrow->AddColumn();         // start of first column
    ....

You need to create the corresponding style in the html page:

<style>
.header-no-link     {....}
.header-with-link   {....}
.linkstyle          {....}
.commentstyle       {....}
:hover { background:white; ...}    // nice to have
</style>

Embeded in the place you want to display the list:

    <?php $linkrow->GenDropTable(); ?>

Tested on IE 6 and Netscape 7.


FUNCTION
========

    LINKROW()   : instantiate the class
    AddColumn() : Add a column marker
    AddItem( "Description", "Link", "Style")
            Description: Text appears on the screen
            Link: If something is keyed in, it will be put into:
                  <A HREF="Link">DESCRIPTION</A>. If not, only Description will be printed
            STYLE: the format will use class="Style" in the <DIV> tag.
    GenDropTable() : return a string

  Files folder image Files  
File Role Description
Accessible without login Plain text file class_linkrow.php Class PHP Class to generate button rows
Plain text file README Doc. How to use LinkRow
Accessible without login HTML file sampleoutput.html Output Sample Output
Accessible without login Plain text file sample_linkrow.php Example Sample script demonstrate functions.

 Version Control Unique User Downloads Download Rankings  
 0%
Total:825
This week:0
All time:4,021
This week:2,110Up