aecbcbd709d07b4a5336dec848b2f91377ac682f
[plewww.git] / plekit / php / nifty.php
1 <?php
2
3   // $Id$
4
5 require_once 'prototype.php';
6
7 drupal_set_html_head('
8 <script type="text/javascript" src="/plekit/niftycorner/niftycube.js"></script>
9 <script type="text/javascript" src="/plekit/niftycorner/nifty_init.js"></script>
10 <script type="text/javascript"> Event.observe(window,"load", nifty_init); </script>
11 ');
12
13 class PlekitNifty {
14   var $id;
15   var $class;
16   var $size;
17
18   function __construct ($id, $class, $size='medium') {
19     $this->id = $id;
20     $this->class=$class;
21     $this->size=$size;
22   }
23
24   function start () { print $this->start_html(); }
25   function start_html () {
26     $html="";
27     $html .= "<div";
28     if ($this->id) $html .= " id='$this->id'";
29     $html .= " class='";
30     if ($this->class) $html .= $this->class . " ";
31     $html .= "nifty-$this->size";
32     // close the class quote
33     $html .= "'>";
34     return $html;
35   }
36
37   function end () { print $this->end_html();} 
38   function end_html () {
39     return "</div>";
40   }
41
42 }
43
44 ?>