bugfix: the slice page was broken when nobody is in slice
[plewww.git] / plekit / php / nifty.php
index 5aae788..6820065 100644 (file)
@@ -7,7 +7,38 @@ require_once 'prototype.php';
 drupal_set_html_head('
 <script type="text/javascript" src="/plekit/niftycorner/niftycube.js"></script>
 <script type="text/javascript" src="/plekit/niftycorner/nifty_init.js"></script>
-<script> Event.observe(window,"load", nifty_init); </script>
+<script type="text/javascript"> Event.observe(window,"load", nifty_init); </script>
 ');
 
+class PlekitNifty {
+  var $id;
+  var $class;
+  var $size;
+
+  function __construct ($id, $class, $size='medium') {
+    $this->id = $id;
+    $this->class = $class;
+    $this->size = $size;
+  }
+
+  function start () { print $this->start_html(); }
+  function start_html () {
+    $html="";
+    $html .= "<div";
+    if ($this->id) $html .= " id='$this->id'";
+    $html .= " class='";
+    if ($this->class) $html .= $this->class . " ";
+    $html .= "nifty-$this->size";
+    // close the class quote
+    $html .= "'>";
+    return $html;
+  }
+
+  function end () { print $this->end_html();}
+  function end_html () {
+    return "</div>";
+  }
+
+}
+
 ?>