3d226dfeb89424af34c423264628eb2b4dfbe6b2
bernd Umstellung auf Theme-Suppor...

bernd authored 13 years ago

1) <?php
2) 
3) function show_page($path = NULL) 
4) {
bernd Auch $html_header muss dem...

bernd authored 13 years ago

5)   global $go, $title, $headline, $output, $module, $page, $html_header;
bernd Umstellung auf Theme-Suppor...

bernd authored 13 years ago

6)   if ($path) {
7)   	$module = $path;
8)   }
9)   $theme = config('theme');
bernd Setze "default" als Standar...

bernd authored 13 years ago

10)   if (! $theme)
11)     $theme = 'default';
bernd Umstellung auf Theme-Suppor...

bernd authored 13 years ago

12)   $theme_path = "themes/$theme/";
13)   $candidates = array();
14)   if ($page) {
15)     $candidates[] = "{$theme_path}page-$module-$page.tpl.php";
16)   }
17)   $candidates[] = "{$theme_path}page-$module.tpl.php";
18)   $candidates[] = "{$theme_path}page.tpl.php";
19)   if ($page) {
20)     $candidates[] = "modules/{$module}/theme/page-$page.tpl.php";
21)   }
22)   $candidates[] = "modules/{$module}/theme/page.tpl.php";
23)   if ($page) {
24)     $candidates[] = "themes/default/page-$module-$page.tpl.php";
25)   }
26)   $candidates[] = "themes/default/page-$module.tpl.php";
27)   $candidates[] = "themes/default/page.tpl.php";
28) 
29)   $theme_file = NULL;
30)   foreach ($candidates AS $c) {
31)   	if (file_exists($c)) {
32) 		$theme_file = $c;
33) 		break;
34) 	}
35)   }
36)   if (! file_exists($theme_file))
37)     die("cannot get any theme file");
38) 
39)   include('inc/top.php');
40)   if (!isset($title))
41)     $title = '';
bernd Benutze überall title() sta...

bernd authored 13 years ago

42)   if (!isset($headline))
43)     $headline = $title;