1<?php
2/** Multitemplate for DokuWiki
3 * By Terence J. Grant
4 * tjgrant [at] tatewake [dot] com
5 * License: GPL v2
6 */
7function mt_beginsWith( $str, $sub ) {
8	return ( substr( $str, 0, strlen( $sub ) ) === $sub );
9}
10
11@include(dirname(__FILE__).'/local_pref.php');
12
13if (isset($ID) == TRUE)
14{
15	foreach($multitemplate as $mt_namespace => $mt_othertemplate)
16	{
17		if (mt_beginsWith($ID, $mt_namespace))
18		{
19			$DOKU_TPL		= DOKU_TPL.'../'.$mt_othertemplate.'/';
20			$DOKU_TPLINC	= DOKU_TPLINC.'../'.$mt_othertemplate.'/';
21			@include(dirname(__FILE__).'/'.'../'.$mt_othertemplate.'/'.$mt_file);
22			break;
23		}
24	}
25}
26else
27{
28	$DOKU_TPL		= DOKU_TPL.'../'.$multitemplate[''].'/';
29	$DOKU_TPLINC	= DOKU_TPLINC.'../'.$multitemplate[''].'/';
30	@include(dirname(__FILE__).'/'.'../'.$multitemplate[''].'/'.$mt_file);
31}
32
33?>