2024.8.23
Loading...
Searching...
No Matches
class.tpl.app.python.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
10
/**
11
* Class TplAppPython
12
*
13
* This class provides methods to generate menu items and actions for managing Python tools
14
* within the Bearsampp application. It includes functionalities for accessing Python console,
15
* IDLE, and other Python-related executables.
16
*/
17
class
TplAppPython
18
{
19
// Constant for the Python menu identifier
20
const
MENU
=
'python'
;
21
22
/**
23
* Generates the main Python menu with options to access Python tools.
24
*
25
* @global object $bearsamppLang Provides language support for retrieving language-specific values.
26
*
27
* @return string The generated menu items and actions for Python.
28
*/
29
public
static
function
process
()
30
{
31
global
$bearsamppLang
;
32
33
return
TplApp::getMenu
(
$bearsamppLang
->getValue(
Lang::PYTHON
), self::MENU, get_called_class());
34
}
35
36
/**
37
* Generates the Python menu with options for accessing the Python console, IDLE, and other tools.
38
*
39
* @global object $bearsamppLang Provides language support for retrieving language-specific values.
40
* @global object $bearsamppTools Provides access to various tools and their configurations.
41
*
42
* @return string The generated menu items and actions for Python tools.
43
*/
44
public
static
function
getMenuPython
()
45
{
46
global
$bearsamppLang
, $bearsamppTools;
47
48
// Generate menu item for Python console
49
$resultItems =
TplAestan::getItemConsoleZ
(
50
$bearsamppLang
->getValue(
Lang::PYTHON_CONSOLE
),
51
TplAestan::GLYPH_PYTHON
,
52
$bearsamppTools->getConsoleZ()->getTabTitlePython()
53
) . PHP_EOL;
54
55
// Generate menu item for Python IDLE
56
$resultItems .=
TplAestan::getItemExe
(
57
$bearsamppLang
->getValue(
Lang::PYTHON
) .
' IDLE'
,
58
$bearsamppTools->getPython()->getIdleExe(),
59
TplAestan::GLYPH_PYTHON
60
) . PHP_EOL;
61
62
// Generate menu item for Python command prompt
63
$resultItems .=
TplAestan::getItemExe
(
64
$bearsamppLang
->getValue(
Lang::PYTHON_CP
),
65
$bearsamppTools->getPython()->getCpExe(),
66
TplAestan::GLYPH_PYTHON_CP
67
) . PHP_EOL;
68
69
return
$resultItems;
70
}
71
}
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
Lang\PYTHON
const PYTHON
Definition
class.lang.php:152
Lang\PYTHON_CONSOLE
const PYTHON_CONSOLE
Definition
class.lang.php:60
Lang\PYTHON_CP
const PYTHON_CP
Definition
class.lang.php:61
TplAestan\GLYPH_PYTHON_CP
const GLYPH_PYTHON_CP
Definition
class.tpl.aestan.php:91
TplAestan\getItemConsoleZ
static getItemConsoleZ($caption, $glyph, $id=null, $title=null, $initDir=null, $command=null)
Definition
class.tpl.aestan.php:142
TplAestan\GLYPH_PYTHON
const GLYPH_PYTHON
Definition
class.tpl.aestan.php:90
TplAestan\getItemExe
static getItemExe($caption, $exe, $glyph, $params=null)
Definition
class.tpl.aestan.php:221
TplAppPython
Definition
class.tpl.app.python.php:18
TplAppPython\getMenuPython
static getMenuPython()
Definition
class.tpl.app.python.php:44
TplAppPython\process
static process()
Definition
class.tpl.app.python.php:29
TplAppPython\MENU
const MENU
Definition
class.tpl.app.python.php:20
TplApp\getMenu
static getMenu($caption, $menu, $class)
Definition
class.tpl.app.php:190
Bearsampp-development
sandbox
core
classes
tpls
app
class.tpl.app.python.php
Generated by
1.11.0