PHP Classes

File: docs.php

Recommend this page to a friend!
  Classes of Piotr Malinski   HTML Friends   docs.php   Download  
File: docs.php
Role: Example script
Content type: text/plain
Description: Documentation with examples
Class: HTML Friends
PHP wrapper to use dhtmlgoodies.com DHTML widgets
Author: By
Last change:
Date: 18 years ago
Size: 6,782 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>
<head>
<title>HTML Friends DOCS</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META name="Author" content="Riklaunim">
<style type="text/css">
                body {
 margin: 0; padding: 0;
    background-color: #eeeeee;
    font-family:Verdana;
    font-size:12px;
}

.code {
  border: 1px #DDDDDD solid;
  font-family: tahoma;
  font-size: 11px;
  padding-top: 1px;
  padding-right: 3px;
  padding-bottom: 2px;
  padding-left: 16px;
  text-align: left;
  background-color:#9bb89b;
}
</style></head><body>
<center><h1>HTML Friends</h1><h2>Easy use of JS/DHTML in PHP</h2></center>
This class contains a set of various JavaScript/DHTML scripts with a easy to use PHP "API" :) Author: Piotr MaliƄski <a href="mailto:riklaunim@gmail.com">email</a>. Scripts from www.dhtmlgoodies.com and other sites.<BR>
<B>USAGE</B>:<BR>
Start with:
<div class="code"><pre>include 'html_friends.php';
$a = new html_friends();</pre></div>
Now you can use scripts from the class. The *_init methods return CSS and JS files "inclusion" and the best place for them is the HEAD tag but it isn't required. *_init should be called only once<BR><BR>

<B>COLOR PICKER</B>
<div class="code"><pre>echo $a->color_picker_init();
echo '< form >'.$a->color_picker('FIELD NAME').'< /form >';</pre></div>
Creates a color picker, which can be used in forms:
<?PHP
include 'html_friends.php';
$a = new html_friends();
echo
$a->color_picker_init();
echo
'<form>'.$a->color_picker('zzz').'</form>'; ?><BR><BR>


<B>FLOATING WINDOWS</B>
<div class="code"><pre>echo $a->floating_window_init();
echo $a->floating_window_make('text', 1, 100, 100, 100, 150);
echo $a->floating_window_make('TEXT OF THE TAB', ID NUMER, WIDTH, HEIGHT, X, Y);</pre></div>
Creates floating windows, something like popups but HTML tables :) X - show the window X pixels from the left, Y - from the top. Each window has to have an unique ID. See <a href="example3.php">example3.php</a><BR><BR>


<B>DATE PICKER</B>
<div class="code"><pre>echo $a->calendar_init();
echo '< form action="'.$_SERVER['REQUEST_URI'].'" method="post" >'.$a->calendar().'< input type="submit" value="Submit me" >< /form >';</pre></div>
Creates a text field (name dataArea0 for the first one, dataArea1 for the second one and so on) where you can select a date from a calendar:
<?PHP
echo $a->calendar_init();
echo
$a->calendar();
?><BR><BR><BR><BR><BR>

<B>TABBED TABLE</B>
<div class="code"><pre>echo $a->tab_init();
$ar = array('TABNAME' => 'TAB TEXT', 'Tab 1' => '<B>tab</B> text', 'Foo' => 'Bar');
echo $a->tab($ar);</pre></div>
Creates a tabbet table with nice tab switcher:
<?PHP
echo $a->tab_init();
$ar = array('Tab1' => 'aaaa aaaaaa aaaa a', 'Tab 2' => '<B>sss</B>ssssss sssss', 'Foo' => 'sssssssss sssssssss');
echo
$a->tab($ar);
?><BR><BR>

<B>HORIZONTAL MENU</B>
<div class="code"><pre>echo $a->rollv_menu_init();
$a1 = array('Menu 1', 'Menu 2', 'Menu 3');
$a2 = array('Menu 1' => array('Google' => 'http://www.google.pl', 'Yahoo' => 'http://www.yahoo.cm'), 'Menu 2' => array('2Google' => 'http://www.google.pl', '22Yahoo' => 'http://www.yahoo.cm'), 'Menu 3' => array('BLAGoogle' => 'http://www.google.pl', 'BLAYahoo' => 'http://www.yahoo.cm'));
echo $a->rollv_menu($a1, $a2);</pre></div>
Creates a drop down menu. $a1 - array with names of menu "categories", $a2 - associative array where Keys are category names and Values are arrays of: Link name => Link URL<BR><BR>
<?PHP echo $a->rollv_menu_init();
$a1 = array('Menu 1', 'Menu 2', 'Menu 3');
$a2 = array('Menu 1' => array('Google' => 'http://www.google.pl', 'Yahoo' => 'http://www.yahoo.cm'), 'Menu 2' => array('2Google' => 'http://www.google.pl', '22Yahoo' => 'http://www.yahoo.cm'), 'Menu 3' => array('BLAGoogle' => 'http://www.google.pl', 'BLAYahoo' => 'http://www.yahoo.cm'));

echo
$a->rollv_menu($a1, $a2); ?><BR><BR><BR><BR><BR>


<B>VERTICAL MENU</B>
<div class="code"><pre>echo $a->roll_menu_init();

$a1 = array('Menu 1', 'Menu 2', 'Menu 3');
$a2 = array('Menu 1' => array('Google' => 'http://www.google.pl', 'Yahoo' => 'http://www.yahoo.cm'), 'Menu 2' => array('2Google' => 'http://www.google.pl', '22Yahoo' => 'http://www.yahoo.cm'), 'Menu 3' => array('BLAGoogle' => 'http://www.google.pl', 'BLAYahoo' => 'http://www.yahoo.cm'));

echo $a->roll_menu($a1, $a2);</pre></div>
Same arrays as HORIZONTAL MENU, generates Vertical drop down menu.<BR><BR>

<B>TOOLTIP</B>
<div class="code"><pre>echo $a->tooltip_init();
echo $a->tooltip('URL LINK', 'Tooltip text', 'link name');</pre></div>
<?PHP
echo $a->tooltip_init();
echo
$a->tooltip('#', 'Bla bla bla <B>Im a tooltip</B>', 'mouseover me!');
?><BR><BR>


<B>COLOR PICKER</B>
<div class="code"><pre>echo $a-> order_list_init();
$ar = array('KEY' => 'VALUE', 'foo1' => 'Bar', 'foo2' => 'Something');
echo $a->order_list($ar, 'SAVE TEXT');</pre></div>
Creates a list (LI) from $ar which can be sorted by DRAG and DROP. $a->order_list will return sorted $ar when the "save" link will be clicked. See <a href="example1.php">example1.php</a>.<BR><BR>


<B>Nice Table</B>
<div class="code"><pre><code><span style="color: #007700">);echo&nbsp;</span><span style="color: #0000BB">$a</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table_init</span><span style="color: #007700">();<br />echo&nbsp;</span><span style="color: #0000BB">$a</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">(</span><span style="color: #DD0000">'&lt;table&gt;<br />&lt;thead&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;th&gt;Ingredients&lt;/th&gt;&lt;th&gt;serves&nbsp;12&lt;/th&gt;&lt;th&gt;serves&nbsp;24&lt;/th&gt;&lt;/tr&gt;<br />&lt;/thead&gt;<br />&lt;tfoot&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&nbsp;colspan="3"&gt;&lt;ol&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;test&nbsp;hehehehe&nbsp;&nbsp;:)&lt;/li&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ol&gt;&lt;/td&gt;&lt;/tr&gt;<br />&lt;/tfoot&gt;<br />&lt;tbody&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;milk&lt;/td&gt;&lt;td&gt;1&nbsp;quart&lt;/td&gt;&lt;td&gt;2&nbsp;quart&lt;/td&gt;&lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&nbsp;class="odd"&gt;&lt;td&gt;cinnamon&nbsp;sticks&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;vanilla&nbsp;bean,&nbsp;split&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;<br />&lt;/tbody&gt;&lt;/table&gt;'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>
</span>
</code></pre></div>
Creates a very nice table. See <a href="example2.php">example2.php</a>