diff --git a/core/block.class.php b/core/block.class.php
index 0beab722..1c33aed7 100644
--- a/core/block.class.php
+++ b/core/block.class.php
@@ -9,12 +9,14 @@ class Block {
* @retval string
*/
var $header;
+
/**
* The content
*
* @retval string
*/
var $body;
+
/**
* Where the block should be placed. The default theme supports
* "main" and "left", other themes can add their own areas
@@ -22,6 +24,7 @@ class Block {
* @retval string
*/
var $section;
+
/**
* How far down the section the block should appear, higher
* numbers appear lower. The scale is 0-100 by convention,
@@ -31,11 +34,29 @@ class Block {
*/
var $position;
- public function __construct($header, $body, /*string*/ $section="main", /*int*/ $position=50) {
+ /**
+ *
+ */
+ var $id;
+
+ public function __construct($header, $body, /*string*/ $section="main", /*int*/ $position=50, $id=null) {
$this->header = $header;
$this->body = $body;
$this->section = $section;
$this->position = $position;
+ $this->id = str_replace(' ', '_', is_null($id) ? (is_null($header) ? md5($body) : $header) . $section : $id);
+ }
+
+ public function get_html($hidable=false) {
+ $h = $this->header;
+ $b = $this->body;
+ $i = $this->id;
+ $html = "$h
";
+ if(!is_null($b)) $html .= "
error: {$block->header} using an unknown section ({$block->section})";
@@ -234,23 +234,6 @@ $header_html
EOD;
}
- function block_to_html($block, $hidable=false) {
- $h = $block->header;
- $s = $block->section;
- $b = $block->body;
- $i = str_replace(' ', '_', $h.$s);
- $html = "$h
\n";
- }
- else {
- if(!is_null($h)) $html .= "\n$h
\n";
- }
- if(!is_null($b)) $html .= "
error: {$block->header} using an unknown section ({$block->section})"; @@ -85,20 +85,5 @@ $header_html