Project

General

Profile

1 1939 darkviper
<?php
2
/**
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
/**
20
 * include.php
21
 *
22
 * @category     Modules
23
 * @package      Modules_MultiLingual
24
 * @author       Werner v.d.Decken <wkl@isteam.de>
25
 * @author       Dietmar Wöllbrink <dietmar.woellbrink@websiteBaker.org>
26
 * @copyright    Werner v.d.Decken <wkl@isteam.de>
27
 * @license      http://www.gnu.org/licenses/gpl.html   GPL License
28
 * @version      0.0.1
29 1970 Luisehahne
 * @revision     $Revision$
30
 * @link         $HeadURL$
31
 * @lastmodified $Date$
32 1939 darkviper
 * @since        File available since 09.01.2013
33
 * @description  provides a flexible posibility for changeing to a translated page
34
 */
35
36
if(!function_exists('language_menu'))
37
{
38 1945 darkviper
	function language_menu($sExtension = "auto")
39 1939 darkviper
	{
40
		global $wb;
41 1986 Luisehahne
		$oReg   = WbAdaptor::getInstance();
42
        if(!$oReg->PageLanguages) {return false;}
43 1945 darkviper
		$sExtension = strtolower($sExtension);
44
		switch($sExtension)
45
		{
46
			case 'png':
47
			case 'svg':
48
				break;
49
			default:
50
				$sExtension = 'auto';
51
		}
52
53 1986 Luisehahne
		if ( ($wb->page_id  < 1) ){ return false; }
54 1939 darkviper
		$oPageLang = new m_MultiLingual_Lib();
55 1945 darkviper
        $oPageLang->setExtension($sExtension);
56 1939 darkviper
		$sRetVal = $oPageLang->getLangMenu();
57
		return $sRetVal;
58
	}
59
}