This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/core/block.class.php

54 lines
1.1 KiB
PHP
Raw Normal View History

<?php
2009-07-19 07:38:13 +00:00
/**
* A basic chunk of a page
*/
class Block {
2009-07-19 07:38:13 +00:00
/**
* The block's title
*
* @retval string
2009-07-19 07:38:13 +00:00
*/
var $header;
2009-07-19 07:38:13 +00:00
/**
* The content
*
* @retval string
2009-07-19 07:38:13 +00:00
*/
var $body;
2009-07-19 07:38:13 +00:00
/**
* Where the block should be placed. The default theme supports
* "main" and "left", other themes can add their own areas
*
* @retval string
2009-07-19 07:38:13 +00:00
*/
var $section;
2009-07-19 07:38:13 +00:00
/**
* How far down the section the block should appear, higher
* numbers appear lower. The scale is 0-100 by convention,
* though any number or string will work.
*
* @retval int
2009-07-19 07:38:13 +00:00
*/
var $position;
2012-02-02 13:58:48 +00:00
public function __construct($header, $body, /*string*/ $section="main", /*int*/ $position=50) {
$this->header = $header;
$this->body = $body;
$this->section = $section;
$this->position = $position;
}
}
2009-07-19 07:38:13 +00:00
/**
* A generic navigation block with a link to the main page.
*
* Used because "new NavBlock()" is easier than "new Block('Navigation', ..."
*/
class NavBlock extends Block {
public function __construct() {
parent::__construct("Navigation", "<a href='".make_link()."'>Index</a>", "left", 0);
}
}
?>