1 |
jonen |
1.1 |
<?php |
2 |
|
|
|
3 |
|
|
/** |
4 |
|
|
* this file holds special DIVtag rendering functions. |
5 |
|
|
* Since the <div> is commonly used for special things |
6 |
|
|
* we automate some common used <div> content </div> |
7 |
|
|
* rendering functions. |
8 |
|
|
* |
9 |
|
|
* $Id: divtag_utils.inc,v 1.7 2002/07/30 06:45:51 hemna Exp $ |
10 |
|
|
* |
11 |
|
|
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
12 |
|
|
* @package phpHtmlLib |
13 |
|
|
* |
14 |
|
|
*/ |
15 |
|
|
|
16 |
|
|
|
17 |
|
|
/** |
18 |
|
|
* make sure we include the required functions |
19 |
|
|
*/ |
20 |
|
|
require_once("$phphtmllib/tag_utils/html_utils.inc"); |
21 |
|
|
|
22 |
|
|
|
23 |
|
|
/** |
24 |
|
|
* Render a div w/ a spacer give as its content. |
25 |
|
|
* |
26 |
|
|
* @author Walter A. Boring IV |
27 |
|
|
* @param int $width - the width of the img |
28 |
|
|
* ( DEFAULT : 1) |
29 |
|
|
* @param int $height - the height of the img |
30 |
|
|
* ( DEFAULT : 1) |
31 |
|
|
* @return DIVtag object. |
32 |
|
|
*/ |
33 |
|
|
function div_build_spacergif_tag( $width, $height ) { |
34 |
|
|
$attributes = array( "style" => "font-family: times new roman; font-size: 2px;"); |
35 |
|
|
$div = new DIVtag( $attributes ); |
36 |
|
|
$div->push( build_spacergif_imgtag( $width, $height, "/images" ) ); |
37 |
|
|
return $div; |
38 |
|
|
} |
39 |
|
|
|
40 |
|
|
/** |
41 |
|
|
* build a new div tag with default attributes of |
42 |
|
|
* "align=center" |
43 |
|
|
* |
44 |
|
|
* @author Walter A. Boring IV |
45 |
|
|
* @param mixed - any # of arguments |
46 |
|
|
* that will live in the <div></div> |
47 |
|
|
* @return DIVtag object. |
48 |
|
|
*/ |
49 |
|
|
function html_div_center() { |
50 |
|
|
$attributes = array("align" => "center"); |
51 |
|
|
$tag = new DIVtag( $attributes ); |
52 |
|
|
$num_args = func_num_args(); |
53 |
|
|
for ($i=0;$i<$num_args;$i++) { |
54 |
|
|
$tag->push(func_get_arg($i)); |
55 |
|
|
} |
56 |
|
|
return $tag; |
57 |
|
|
} |
58 |
|
|
|
59 |
|
|
/** |
60 |
|
|
* build a new div tag with content |
61 |
|
|
* |
62 |
|
|
* @author Walter A. Boring IV |
63 |
|
|
* |
64 |
|
|
* @param string $class - the css class for the div |
65 |
|
|
* @param mixed - any # of arguments |
66 |
|
|
* that will live in the <div></div> |
67 |
|
|
* @return DIVtag object. |
68 |
|
|
*/ |
69 |
|
|
function html_div($class="") { |
70 |
|
|
|
71 |
|
|
$tag = new DIVtag(); |
72 |
|
|
if ($class != "") { |
73 |
|
|
$tag->set_class($class); |
74 |
|
|
} |
75 |
|
|
$num_args = func_num_args(); |
76 |
|
|
for ($i=1;$i<$num_args;$i++) { |
77 |
|
|
$tag->push(func_get_arg($i)); |
78 |
|
|
} |
79 |
|
|
return $tag; |
80 |
|
|
} |
81 |
|
|
|
82 |
|
|
|
83 |
|
|
/** |
84 |
|
|
* This builds the 1px font size |
85 |
|
|
* DIVtag object, which can |
86 |
|
|
* be used anywhere |
87 |
|
|
* |
88 |
|
|
* @param mixed - any # of arguments |
89 |
|
|
* that will live in the <div></div> |
90 |
|
|
* |
91 |
|
|
* @return DIVtag object. |
92 |
|
|
*/ |
93 |
|
|
function html_div_small() { |
94 |
|
|
$tag = new DIVtag( array("style" => "font-size: 1px;line-height: 1px;") ); |
95 |
|
|
$num_args = func_num_args(); |
96 |
|
|
for ($i=0;$i<$num_args;$i++) { |
97 |
|
|
$tag->push(func_get_arg($i)); |
98 |
|
|
} |
99 |
|
|
return $tag; |
100 |
|
|
} |
101 |
|
|
?> |