Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tufan Baris YILDIRIM  >  D3Ribbon Menu  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example using
Class: D3Ribbon Menu
Generate HTML to display ribbon-like menus
Author: By
Last change:
Date: 2010-07-11 12:01
Size: 1,868 bytes
 

Contents

Class file image Download
<?php
    
include 'd3ribbon.php';

    
$ribbon=new d3ribbon();
    
$ribbon->stlye='blue';

    
// Building First category


    
$main_cat $ribbon->add_category('D3 Ribbon Main Cat','index.php?component=main_component','main_component');
    
$grp  $ribbon->add_group($main_cat,'Group Name',250,'grpid');
    
$grp2 $ribbon->add_group($main_cat,'Group Name 2',250,'grp2');
    
$ribbon->add_button($grp,'Users','index.php?component='.$main_cat.'&module=users','image yok','users');
    
$ribbon->add_button($grp,'Empooleys','index.php?component='.$main_cat.'&module=employees','image yok','employees');


    
// Seond Category on Main Category

    
$cat2 $ribbon->add_category('D3 Ribbon category 2','index.php?component=second_component','second_component');
    
$grp $ribbon->add_group($cat2,'2 Group Name',250,'second_grpid');
    
$ribbon->add_button($grp,'Others','index.php?component='.$cat2.'&module=other','image yok','other');


    
/**
    * set Selected Cat and button.
    */
    
$ribbon->selected_category_id = isset($_GET['component']) ? $_GET['component'] :'main_component' ;
    
$ribbon->selected_button_id = isset($_GET['module']) ? $_GET['module'] : null;


?>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>D3Ribbon</title>
        <meta name="author" content="Tufan Baris YILDIRIM">
        <meta http-equiv="reply-to" content="tfn.yldrm@hotmail.com">
        <?php
            
/**
            *  Printing Style link as <link href=...
            */
            
echo $ribbon->style_link();
        
?>

    </head>
    <body>

        <?php
            
/**
            * build and print ribbon menu
            *
            * @var d3ribbon
            */
            
$ribbon->build(false);

        
?>

    </body>
</html>