1<?php
2/********************************
3OSBib:
4A collection of PHP classes to create and manage bibliographic formatting for OS bibliography software
5using the OSBib standard.
6
7Released through http://bibliophile.sourceforge.net under the GPL licence.
8Do whatever you like with this -- some credit to the author(s) would be appreciated.
9
10If you make improvements, please consider contacting the administrators at bibliophile.sourceforge.net
11so that your improvements can be added to the release package.
12
13Adapted from WIKINDX: http://wikindx.sourceforge.net
14
15Mark Grimshaw 2005
16http://bibliophile.sourceforge.net
17********************************/
18/**
19*	Miscellaneous HTML elements
20*
21*	@author Mark Grimshaw
22*
23*	$Header: /cvsroot/bibliophile/OSBib/create/MISC.php,v 1.1 2005/06/20 22:26:51 sirfragalot Exp $
24*/
25class MISC
26{
27// Constructor
28	function MISC()
29	{
30	}
31// <hr>
32	function hr($class = FALSE)
33	{
34		$string = <<< END
35<hr class="$class" />
36END;
37		return $string . "\n";
38	}
39// <P>
40	function p($data = '', $class = FALSE, $align = "left")
41	{
42		$string = <<< END
43<p class="$class" align="$align">$data</p>
44END;
45		return $string . "\n";
46	}
47// <BR>
48	function br()
49	{
50		$string = <<< END
51<br />
52END;
53		return $string . "\n";
54	}
55// <UL>
56	function ul($data, $class = FALSE)
57	{
58		$string = <<< END
59<ul class="$class">$data</ul>
60END;
61		return $string . "\n";
62	}
63// <OL>
64	function ol($data, $class = FALSE, $type = "1")
65	{
66		$string = <<< END
67<ul class="$class" type="$type">$data</ul>
68END;
69		return $string . "\n";
70	}
71// <LI>
72	function li($data, $class = FALSE)
73	{
74		$string = <<< END
75<li class="$class">$data</li>
76END;
77		return $string . "\n";
78	}
79// <STRONG>
80	function b($data, $class = FALSE)
81	{
82		return <<< END
83<strong class="$class">$data</strong>
84END;
85	}
86// <EM>
87	function i($data, $class = FALSE)
88	{
89		return <<< END
90<em class="$class">$data</em>
91END;
92	}
93// <U>
94	function u($data, $class = FALSE)
95	{
96		return <<< END
97<u class="$class">$data</u>
98END;
99	}
100// <SPAN>
101	function span($data, $class = FALSE)
102	{
103		return <<< END
104<span class="$class">$data</span>
105END;
106	}
107// <Hx>
108	function h($data, $class = FALSE, $level = 4)
109	{
110		$tag = 'h' . $level;
111		$string = <<< END
112<$tag class="$class">$data</$tag>
113END;
114		return $string . "\n";
115	}
116// <img>
117	function img($src, $width, $height, $alt = "")
118	{
119		$string = <<< END
120<img src="$src" border="0" width="$width" height="$height" alt="$alt" />
121END;
122		return $string . "\n";
123	}
124// <A>
125	function a($class, $label, $link, $target = "_self")
126	{
127// NB - no blank line before END;
128		return <<< END
129<a class="$class" href="$link" target="$target">$label</a>
130END;
131	}
132// <A NAME="...">
133	function aName($name)
134	{
135		$string = <<< END
136<a name="$name"></a>
137END;
138		return $string . "\n";
139	}
140// <script src="...">
141	function jsExternal($src)
142	{
143		$string = <<< END
144<script src="$src" type="text/javascript"></script>
145END;
146		return $string . "\n";
147	}
148}
149?>
150