summaryrefslogtreecommitdiff
path: root/templates/themes/categories/info.php
blob: 003d30a5e537c41df3a53959ba16fb12bd6e5526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
	$theme = [];
	
	// Theme name
	$theme['name'] = \Categories::class;
	// Description (you can use Tinyboard markup here)
	$theme['description'] = 
'Group-ordered, category-aware modification of the Frameset theme, with removable sidebar frame.

Requires $config[\'categories\'].';
	$theme['version'] = 'v0.3';
	
	// Theme configuration	
	$theme['config'] = [];
	
	$theme['config'][] = ['title' => 'Site title', 'name' => 'title', 'type' => 'text'];
	
	$theme['config'][] = ['title' => 'Slogan', 'name' => 'subtitle', 'type' => 'text', 'comment' => '(optional)'];
	
	$theme['config'][] = ['title' => 'Main HTML file', 'name' => 'file_main', 'type' => 'text', 'default' => $config['file_index'], 'comment' => '(eg. "index.html")'];
	
	$theme['config'][] = ['title' => 'Sidebar file', 'name' => 'file_sidebar', 'type' => 'text', 'default' => 'sidebar.html', 'comment' => '(eg. "sidebar.html")'];
	
	$theme['config'][] = ['title' => 'News file', 'name' => 'file_news', 'type' => 'text', 'default' => 'news.html', 'comment' => '(eg. "news.html")'];
	
	// Unique function name for building everything
	$theme['build_function'] = 'categories_build';
	$theme['install_callback'] = 'categories_install';
	
	if (!function_exists('categories_install')) {
		function categories_install($settings) {
			global $config;
			
			if (!isset($config['categories'])) {
				return [false, '<h2>Prerequisites not met!</h2>' . 
					'This theme requires $config[\'boards\'] and $config[\'categories\'] to be set.'];
			}
		}
	}
?>