Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
3 lars 1
<?php
2
 
3
    /**
4
     * @package   php_share
5
     * @author    Lars Tiefland <tiefland@weban.de>
6
     * @copyright 2010 Webagentur Niewerth
7
     * @license   propietary http://www.weban.de
8
     * @version   $Rev: 460 $
9
     * @filesource
10
     *
11
     */
12
 
13
    /**
14
     *
15
     * @package   php_share
16
     * @author    Lars Tiefland <tiefland@weban.de>
17
     * @copyright 2010 Webagentur Niewerth
18
     */
19
 
20
    // SVN: $Id: index.php 460 2011-03-28 21:19:56Z tiefland $
21
 
22
    $GLOBALS["languages"] = $GLOBALS["lang"]->getLangs( "array" );
23
 
24
    if ( $_GET["language"] )
25
    {
26
        $sprache = strtolower( $_GET["language"] );
27
        if ( array_key_exists( $sprache, $GLOBALS["languages"] ) )
28
        {
29
            $_SESSION["sprache"] = $sprache;
30
        }
31
        else
32
        {
33
            $_SESSION["sprache"] = strtolower( $GLOBALS["INI"]["language"] );
34
        }
35
    }
36
    $GLOBALS["lang"]->setLang( $_SESSION["sprache"] );
37
 
38
    if ( $_SESSION["sprache"] != strtolower( $GLOBALS["INI"]["language"] ) )
39
    {
40
        // Fallbacksprache auf "$GLOBALS["INI"]["language"]" setzen
41
        $GLOBALS["lang"] = &$GLOBALS["lang"]->getDecorator( 'Lang' );
42
        $GLOBALS["lang"]->setOption( 'fallbackLang', strtolower( $GLOBALS["INI"]["language"] ) );
43
    }
44
 
45
    $pages = getPagesCommon();
46
    foreach ( $pages as $page )
47
    {
48
        $items = array();
49
        $r_items = $GLOBALS["lang"]->getPage( $page );
50
        foreach ( $r_items as $item_id => $item )
51
        {
52
            $item = utf8_encode( $item );
53
            $items[$item_id] = $item;
54
        }
55
        $GLOBALS["langstrings"][strtolower( $page )] = $items;
56
    }
57
?>