Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 54 lines (50 sloc) 1.073 kB
7161656 Initial import, 2.0rc1
shish authored
1 <?php
627ecdb @shish lots of docs
shish authored
2 /**
3 * A basic chunk of a page
db582a2 more documentation for code in core
shish authored
4 */
7161656 Initial import, 2.0rc1
shish authored
5 class Block {
627ecdb @shish lots of docs
shish authored
6 /**
7 * The block's title
8 *
572f845 @shish lots of docs, and some internal changes
shish authored
9 * @retval string
627ecdb @shish lots of docs
shish authored
10 */
7161656 Initial import, 2.0rc1
shish authored
11 var $header;
627ecdb @shish lots of docs
shish authored
12 /**
13 * The content
14 *
572f845 @shish lots of docs, and some internal changes
shish authored
15 * @retval string
627ecdb @shish lots of docs
shish authored
16 */
7161656 Initial import, 2.0rc1
shish authored
17 var $body;
627ecdb @shish lots of docs
shish authored
18 /**
19 * Where the block should be placed. The default theme supports
20 * "main" and "left", other themes can add their own areas
21 *
572f845 @shish lots of docs, and some internal changes
shish authored
22 * @retval string
627ecdb @shish lots of docs
shish authored
23 */
a625fcd the bulk of theme engine 2.0; it's still rough, but it works
shish authored
24 var $section;
627ecdb @shish lots of docs
shish authored
25 /**
26 * How far down the section the block should appear, higher
27 * numbers appear lower. The scale is 0-100 by convention,
28 * though any number or string will work.
29 *
572f845 @shish lots of docs, and some internal changes
shish authored
30 * @retval int
627ecdb @shish lots of docs
shish authored
31 */
a625fcd the bulk of theme engine 2.0; it's still rough, but it works
shish authored
32 var $position;
7161656 Initial import, 2.0rc1
shish authored
33
1e4d7d1 merge some useful parts of SCore
shish authored
34 public function __construct($header, $body, $section="main", $position=50) {
7161656 Initial import, 2.0rc1
shish authored
35 $this->header = $header;
36 $this->body = $body;
a625fcd the bulk of theme engine 2.0; it's still rough, but it works
shish authored
37 $this->section = $section;
38 $this->position = $position;
7161656 Initial import, 2.0rc1
shish authored
39 }
40 }
0d12608 move subclass to below main class, for consistency with later work
shish authored
41
db582a2 more documentation for code in core
shish authored
42
627ecdb @shish lots of docs
shish authored
43 /**
44 * A generic navigation block with a link to the main page.
45 *
46 * Used because "new NavBlock()" is easier than "new Block('Navigation', ..."
db582a2 more documentation for code in core
shish authored
47 */
0d12608 move subclass to below main class, for consistency with later work
shish authored
48 class NavBlock extends Block {
1e4d7d1 merge some useful parts of SCore
shish authored
49 public function __construct() {
50 parent::__construct("Navigation", "<a href='".make_link()."'>Index</a>", "left", 0);
0d12608 move subclass to below main class, for consistency with later work
shish authored
51 }
52 }
7161656 Initial import, 2.0rc1
shish authored
53 ?>
Something went wrong with that request. Please try again.