Bearsampp
2026.7.11
Toggle main menu visibility
Loading...
Searching...
No Matches
class.tpl.app.lang.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (c) 2021-2024 Bearsampp
4
* License: GNU General Public License version 3 or later; see LICENSE.txt
5
* Author: bear
6
* Website: https://bearsampp.com
7
* Github: https://github.com/Bearsampp
8
*/
9
17
class
TplAppLang
18
{
19
// Constant for the language menu identifier
20
const
MENU
=
'lang'
;
21
32
public
static
function
process
()
33
{
34
global
$bearsamppLang
;
35
36
return
TplApp::getMenu
(
$bearsamppLang
->getValue(
Lang::LANG
), self::MENU, get_called_class());
37
}
38
50
public
static
function
getMenuLang
()
51
{
52
global
$bearsamppLang
;
53
$items =
''
;
54
$actions =
''
;
55
56
foreach
(
$bearsamppLang
->getList() as $lang) {
57
$tplSwitchLang =
TplApp::getActionMulti
(
58
Action::SWITCH_LANG
, array($lang),
59
array(ucfirst($lang), $lang ==
$bearsamppLang
->getCurrent() ?
TplAestan::GLYPH_CHECK
:
''
),
60
false
, get_called_class()
61
);
62
63
// Item
64
$items .= $tplSwitchLang[
TplApp::SECTION_CALL
] . PHP_EOL;
65
66
// Action
67
$actions .= PHP_EOL . $tplSwitchLang[
TplApp::SECTION_CONTENT
] . PHP_EOL;
68
}
69
70
return
$items . $actions;
71
}
72
84
public
static
function
getActionSwitchLang
($lang)
85
{
86
return
TplApp::getActionRun
(
Action::SWITCH_LANG
, array($lang)) . PHP_EOL .
87
TplAppReload::getActionReload
();
88
}
89
}
90
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
Action\SWITCH_LANG
const SWITCH_LANG
Definition
class.action.php:51
Lang\LANG
const LANG
Definition
class.lang.php:52
TplAestan\GLYPH_CHECK
const GLYPH_CHECK
Definition
class.tpl.aestan.php:61
TplApp\getActionMulti
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
Definition
class.tpl.app.php:152
TplApp\getMenu
static getMenu($caption, $menu, $class)
Definition
class.tpl.app.php:190
TplApp\getActionRun
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)
Definition
class.tpl.app.php:115
TplApp\SECTION_CALL
const SECTION_CALL
Definition
class.tpl.app.php:23
TplApp\SECTION_CONTENT
const SECTION_CONTENT
Definition
class.tpl.app.php:24
TplAppLang
Definition
class.tpl.app.lang.php:18
TplAppLang\MENU
const MENU
Definition
class.tpl.app.lang.php:20
TplAppLang\process
static process()
Definition
class.tpl.app.lang.php:32
TplAppLang\getActionSwitchLang
static getActionSwitchLang($lang)
Definition
class.tpl.app.lang.php:84
TplAppLang\getMenuLang
static getMenuLang()
Definition
class.tpl.app.lang.php:50
TplAppReload\getActionReload
static getActionReload()
Definition
class.tpl.app.reload.php:44
sandbox
core
classes
tpls
app
class.tpl.app.lang.php
Generated by
1.17.0