<?php
## +---------------------------------------------------------------------------+
## | 1. Creating & Calling: |
## +---------------------------------------------------------------------------+
## *** define a relative (virtual) path to tabs.class.php file
define ("TABS_DIR", ""); /* Ex.: "tabs/" */
## *** include Tabs class
require_once(TABS_DIR."tabs.class.php");
## *** create Tabs object
$tabs = new Tabs();
## +---------------------------------------------------------------------------+
## | 2. General Settings: |
## +---------------------------------------------------------------------------+
## *** set unique numeric (integer-valued) identifier for Tabs
## *** (if you want to use several independently configured Tabs objects on single page)
$tabs->SetId(23);
## *** set style for Tabs
## *** "xp", "dark-red", "light-green", "g-style", "grey", "black" or your own style
$tabs->SetStyle("g-style");
## *** set Tabs direction - ltr|rtl
/// $tabs->SetDirection("ltr");
## *** set Tabs caption
/// $tabs->SetCaption("ApPHP Tabs v".Tabs::Version());
## *** show debug info - false|true
$tabs->Debug(true);
## *** choose mode of displaying child tabs - links|dropdown|tabs
$tabs->SetChildTabsType("dropdown");
## *** set form submission type: "get", "post" or "ajax"
$tabs->SetSubmissionType("post");
## *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.)
/// $tabs->SetHttpVars(array("id"));
## *** allow refreshing selected tabs
/// $tabs->AllowRefreshSelectedTabs(false);
## *** use an anchor to navigate to tabs object after a tab is clicked - true|false
/// $tabs->UseAnchor(false);
## *** create the anchor automatically - true|false
/// $tabs->CreateAnchorAuto(false);
## *** if the CreateAnchorAuto is set to true you have to create the anchor manually
/// echo '<a name="tabs"></a>';
## +---------------------------------------------------------------------------+
## | 3. Adding tabs: |
## +---------------------------------------------------------------------------+
## *** add tabs
## arguments:
## arg #1 - tab's caption
## arg #2 - file associated with this tab (optional)
## arg #3 - icon associated with this tab (optional)
## arg #4 - tab's tooltip
## Example 1: $tabs->AddTab("Title");
## Example 2: $tabs->AddTab("Title", "text.txt");
## Example 3: $tabs->AddTab("Title", "text.txt", "icon.gif");
## Example 4: $tabs->AddTab("Title", "text.txt", "icon.gif", "tooltip");
$son = $tabs->AddTab("Son's Title #1");
$son2 = $tabs->AddTab("Son's Title #2");
$grandson1=$son->AddTab("Grandson's Title #1");
$grandson2=$son->AddTab("Grandson's Title #2", "examples/code.php");
## *** associate a tab with HTML code snippet:
/// $grandson1->SetInnerHTML("<b><i><span onclick='alert(\"How do you do?\")'>HTML</span></i> code snippet</b>");
## *** open a tab in a new window
/// $grandson2->OpenNewWindow(true);
## *** set a tooltip for a tab
/// $son->SetTooltip("Child tab's tooltip");
## +---------------------------------------------------------------------------+
## | 4. Display Settings: |
## +---------------------------------------------------------------------------+
## *** set container's width
## *** for example "200px" or "40%" or "auto" (default)
/// $tabs->SetWidth("200px");
## *** set container's height
## *** for example "200px" or "auto" (default)
/// $tabs->SetHeight("200px");
## +---------------------------------------------------------------------------+
## | 5. Disabling Tabs: |
## +---------------------------------------------------------------------------+
/// $grandson2->Disable();
## +---------------------------------------------------------------------------+
## | 6. Choosing tabs which will be selected by default: |
## +---------------------------------------------------------------------------+
/// $tabs->SetDefaultTab($son);
/// $son->SetDefaultTab($grandson2);
## +---------------------------------------------------------------------------+
## | 7. Draw Tabs: |
## +---------------------------------------------------------------------------+
$tabs->Display();
?>