File: common.php

package info (click to toggle)
bamboo 1.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 580 kB
  • ctags: 1,338
  • sloc: php: 4,061; makefile: 44; sh: 36
file content (43 lines) | stat: -rw-r--r-- 773 bytes parent folder | download
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
41
42
43
<?php

/***
 * common functions which are available in all decorators
 * 
 ***/

function img($file,$tags='') {
	global $decoratorurl;
	return "<img src=\"$decoratorurl/$file\" $tags>";
}

function decbase() {
	global $decoratorurl;
	return $decoratorurl;
}

function url($file) {
	global $decoratorurl;
	return "$decoratorurl/$file";
}


function stylesheet($path) {
	global $page, $root, $robot, $static;
	$dir = dirname($path);
	
#	if ($static) {
#		echo '<link rel="stylesheet" type="text/css" href="/style.css" />';
#	}
	if (!$robot) {
		echo '<link rel="stylesheet" type="text/css" title="default" href="'
		 . $root . '/?a=style&d=' . $page->get('decorator') . '" />';
	}
	else {
		echo "<style>";
		include($dir . '/style.php');
		echo "</style>";
	}
}

return;
?>