Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IntroController.php « controllers « src - github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 81b8f544f940173bf7d0cfc89ce827049b8b641e (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php

/**
 * PHPPgAdmin v6.0.0-RC8
 */

namespace PHPPgAdmin\Controller;

/**
 * Base controller class.
 *
 * @package PHPPgAdmin
 */
class IntroController extends BaseController
{
    protected $no_db_connection = true;

    /**
     * Default method to render the controller according to the action parameter.
     */
    public function render()
    {
        if (null === $this->container->requestobj->getAttribute('route')) {
            echo $this->doDefault();
        } else {
            $body = $this->container->responseobj->getBody();
            $body->write($this->doDefault());

            return $this->container->responseobj;
        }
    }

    /**
     * Intro screen.
     *
     * Release: intro,v 1.19 2007/07/12 19:26:22 xzilla Exp $
     */
    public function doDefault()
    {
        $intro_html = $this->printHeader('Intro', $this->scripts, false);
        $intro_html .= $this->printBody(false);

        $intro_html .= $this->printTrail('root', false);

        $intro_html .= $this->printTabs('root', 'intro', false);

        $intro_html .= '<h1 style="margin-top:2em">'.$this->appName.' '.$this->appVersion.'</h1>';
        $intro_html .= '<h3>(PHP '.PHP_VERSION.')</h3>';

        $intro_html .= '<form method="get" action="intro">';
        $intro_html .= '<table>';
        $intro_html .= '<tr class="data1">';
        $intro_html .= '<th class="data">'.$this->lang['strlanguage'].'</th>';
        $intro_html .= '<td>';
        $intro_html .= '<select name="language" onchange="this.form.submit()">';

        $language = isset($_SESSION['webdbLanguage']) ? $_SESSION['webdbLanguage'] : 'english';
        foreach ($this->appLangFiles as $k => $v) {
            $selected = ($k == $language) ? ' selected="selected"' : '';
            $intro_html .= "\t<option value=\"{$k}\"".$selected.">{$v}</option>".PHP_EOL;
        }

        $intro_html .= '</select>';
        $intro_html .= '</td>';
        $intro_html .= '</tr>';
        $intro_html .= '<tr class="data2">';
        $intro_html .= '<th class="data">'.$this->lang['strtheme'].'</th>';
        $intro_html .= '<td>';
        $intro_html .= '<select name="theme" onchange="this.form.submit()">';

        foreach ($this->appThemes as $k => $v) {
            $selected = ($k == $this->conf['theme']) ? ' selected="selected"' : '';
            $intro_html .= "\t<option value=\"{$k}\"".$selected.">{$v}</option>".PHP_EOL;
        }

        $intro_html .= '</select>';
        $intro_html .= '</td>';
        $intro_html .= '</tr>';
        $intro_html .= '</table>';
        $intro_html .= '<noscript><p><input type="submit" value="'.$this->lang['stralter'].'" /></p></noscript>';
        $intro_html .= '</form>';

        $intro_html .= '<p>'.$this->lang['strintro'].'</p>';

        $intro_html .= '<ul class="intro">';
        $intro_html .= '	<li><a href="https://github.com/HuasoFoundries/phpPgAdmin6">'.$this->lang['strppahome'].'</a></li>';
        $intro_html .= '<li><a href="'.$this->lang['strpgsqlhome_url'].'">'.$this->lang['strpgsqlhome'].'</a></li>';
        $intro_html .= '<li><a href="https://github.com/HuasoFoundries/phpPgAdmin6/issues">'.$this->lang['strreportbug'].'</a></li>';
        //$intro_html .= '<li><a href="' . $this->lang['strviewfaq_url'] . '">' . $this->lang['strviewfaq'] . '</a></li>';
        $intro_html .= '</ul>';

        if ($this->container->requestobj->getQueryParam('language')) {
            $this->misc->setReloadBrowser(true);
        }

        $intro_html .= $this->printFooter(false);

        return $intro_html;
    }
}