Bearsampp 2026.7.11
Loading...
Searching...
No Matches
TplAppTools Class Reference

Static Public Member Functions

static getActionDelSslCertificate ()
static getActionGenSslCertificate ()
static getActionMakeRootCa ()
static getMenuTools ()
static process ()

Data Fields

const ACTION_DEL_SSL_CERTIFICATE = 'delSslCertificate'
const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate'
const ACTION_MAKE_ROOT_CA = 'makeRootCA'
const MENU = 'tools'

Detailed Description

Class TplAppTools

This class provides methods to generate menu items and actions for managing various tools within the Bearsampp application. It includes functionalities for accessing tools like Git, Python, Composer, Ghostscript, Ngrok, Pear, Perl, Ruby and more.

Definition at line 18 of file class.tpl.app.tools.php.

Member Function Documentation

◆ getActionDelSslCertificate()

getActionDelSslCertificate ( )
static

Generates the action to delete an SSL certificate.

Returns
string The generated action to delete an SSL certificate.

Definition at line 215 of file class.tpl.app.tools.php.

216 {
218 }
const DEL_SSL_CERTIFICATE
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)

References Action\DEL_SSL_CERTIFICATE, and TplApp\getActionRun().

Here is the call graph for this function:

◆ getActionGenSslCertificate()

getActionGenSslCertificate ( )
static

Generates the action to generate an SSL certificate.

Returns
string The generated action to generate an SSL certificate.

Definition at line 205 of file class.tpl.app.tools.php.

206 {
208 }
const GEN_SSL_CERTIFICATE

References Action\GEN_SSL_CERTIFICATE, and TplApp\getActionRun().

Here is the call graph for this function:

◆ getActionMakeRootCa()

getActionMakeRootCa ( )
static

Generates the action to create a new Root CA.

Returns
string The generated action to create a new Root CA.

Definition at line 195 of file class.tpl.app.tools.php.

196 {
198 }
const MAKE_ROOT_CA

References TplApp\getActionRun(), and Action\MAKE_ROOT_CA.

Here is the call graph for this function:

◆ getMenuTools()

getMenuTools ( )
static

Generates the Tools menu with options for accessing various tools like Git, Python, Composer, etc.

@global object $bearsamppLang Provides language support for retrieving language-specific values. @global object $bearsamppCore Provides access to core functionalities and configurations. @global object $bearsamppTools Provides access to various tools and their configurations.

Returns
string The generated menu items and actions for Tools.

Definition at line 49 of file class.tpl.app.tools.php.

50 {
52 $resultItems = $resultActions = '';
53
54 // Git
55 $tplGit = TplAppGit::process();
56 $resultItems .= $tplGit[TplApp::SECTION_CALL] . PHP_EOL;
57 $resultActions .= $tplGit[TplApp::SECTION_CONTENT] . PHP_EOL;
58
59 // Python
60 $tplPython = TplAppPython::process();
61 $resultItems .= $tplPython[TplApp::SECTION_CALL] . PHP_EOL;
62 $resultActions .= $tplPython[TplApp::SECTION_CONTENT] . PHP_EOL;
63
64 // Bruno postman IDE
65 $resultItems .= TplAestan::getItemExe(
66 $bearsamppLang->getValue(Lang::BRUNO),
67 $bearsamppTools->getBruno()->getExe(),
69 ) . PHP_EOL;
70
71 // Composer
72 $resultItems .= TplAestan::getItemPowerShell(
75 null,
76 $bearsamppTools->getPowerShell()->getTabTitleComposer(),
78 null
79 ) . PHP_EOL;
80
81 // Ghostscript
82 $resultItems .= TplAestan::getItemPowerShell(
85 null,
86 $bearsamppTools->getPowerShell()->getTabTitleGhostscript(),
88 null
89 ) . PHP_EOL;
90
91 // Ngrok
92 $resultItems .= TplAestan::getItemPowerShell(
93 $bearsamppLang->getValue(Lang::NGROK),
95 null,
96 $bearsamppTools->getPowerShell()->getTabTitleNgrok(),
98 null
99 ) . PHP_EOL;
100
101 // Pear
102 $resultItems .= TplAestan::getItemPowerShell(
103 $bearsamppLang->getValue(Lang::PEAR),
105 null,
106 $bearsamppTools->getPowerShell()->getTabTitlePear(),
107 Path::getModuleSymlinkPath($bearsamppBins->getPhp()) . '/pear',
108 null
109 ) . PHP_EOL;
110
111 // Perl
112 $resultItems .= TplAestan::getItemPowerShell(
113 $bearsamppLang->getValue(Lang::PERL),
115 null,
116 $bearsamppTools->getPowerShell()->getTabTitlePerl(),
118 null
119 ) . PHP_EOL;
120
121 // Ruby
122 $resultItems .= TplAestan::getItemPowerShell(
123 $bearsamppLang->getValue(Lang::RUBY),
125 null,
126 $bearsamppTools->getPowerShell()->getTabTitleRuby(),
128 null
129 ) . PHP_EOL;
130
131 // Line Separator
132 $resultItems .= TplAestan::getItemSeparator() . PHP_EOL;
133
134 // Console
135 $resultItems .= TplAestan::getItemPowerShell(
136 $bearsamppLang->getValue(Lang::CONSOLE),
138 null,
139 $bearsamppTools->getPowerShell()->getTabTitleDefault(),
141 ) . PHP_EOL;
142
143 // HostsEditor
144 $resultItems .= TplAestan::getItemExe(
148 ) . PHP_EOL;
149
150 // Pwgen password manager
151 $resultItems .= TplAestan::getItemExe(
152 $bearsamppLang->getValue(Lang::PWGEN),
155 ) . PHP_EOL;
156
157 // Line Separator
158 $resultItems .= TplAestan::getItemSeparator() . PHP_EOL;
159
160 // Generate rootCA certificate
161 $tplMakeRootCa = TplApp::getActionMulti(
162 self::ACTION_MAKE_ROOT_CA, null,
164 false, get_called_class()
165 );
166 $resultItems .= $tplMakeRootCa[TplApp::SECTION_CALL] . PHP_EOL;
167 $resultActions .= $tplMakeRootCa[TplApp::SECTION_CONTENT] . PHP_EOL;
168
169 // Generate SSL Certificate
170 $tplGenSslCertificate = TplApp::getActionMulti(
171 self::ACTION_GEN_SSL_CERTIFICATE, null,
173 false, get_called_class()
174 );
175 $resultItems .= $tplGenSslCertificate[TplApp::SECTION_CALL] . PHP_EOL;
176 $resultActions .= $tplGenSslCertificate[TplApp::SECTION_CONTENT] . PHP_EOL;
177
178 // Delete SSL Certificate
179 $tplDelSslCertificate = TplApp::getActionMulti(
180 self::ACTION_DEL_SSL_CERTIFICATE, null,
182 false, get_called_class()
183 );
184 $resultItems .= $tplDelSslCertificate[TplApp::SECTION_CALL] . PHP_EOL;
185 $resultActions .= $tplDelSslCertificate[TplApp::SECTION_CONTENT];
186
187 return $resultItems . PHP_EOL . $resultActions;
188 }
global $bearsamppBins
global $bearsamppLang
global $bearsamppRoot
global $bearsamppCore
const COMPOSER
const GHOSTSCRIPT
const RUBY
const BRUNO
const CONSOLE
const NGROK
const MENU_GEN_SSL_CERTIFICATE
const HOSTSEDITOR
const PWGEN
const PEAR
const PERL
const MENU_GEN_ROOT_CA
const DELSSL_TITLE
static getHostsEditorExe($aetrayPath=false)
static getRootPath($aetrayPath=false)
static getWwwPath($aetrayPath=false)
static getModuleSymlinkPath($module)
static getPwgenExe($aetrayPath=false)
static getItemPowerShell($caption, $glyph, $id=null, $title=null, $initDir=null, $command=null)
static getItemExe($caption, $exe, $glyph, $params=null)
const GLYPH_POWERSHELL
const GLYPH_GHOSTSCRIPT
const GLYPH_HOSTSEDITOR
const GLYPH_SSL_CERTIFICATE
static getItemSeparator()
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
const SECTION_CALL
const SECTION_CONTENT

References $bearsamppBins, $bearsamppCore, $bearsamppLang, $bearsamppRoot, Lang\BRUNO, Lang\COMPOSER, Lang\CONSOLE, Lang\DELSSL_TITLE, TplApp\getActionMulti(), Path\getHostsEditorExe(), TplAestan\getItemExe(), TplAestan\getItemPowerShell(), TplAestan\getItemSeparator(), Path\getModuleSymlinkPath(), Path\getPwgenExe(), Path\getRootPath(), Path\getWwwPath(), Lang\GHOSTSCRIPT, TplAestan\GLYPH_BRUNO, TplAestan\GLYPH_COMPOSER, TplAestan\GLYPH_GHOSTSCRIPT, TplAestan\GLYPH_HOSTSEDITOR, TplAestan\GLYPH_NGROK, TplAestan\GLYPH_PEAR, TplAestan\GLYPH_PERL, TplAestan\GLYPH_POWERSHELL, TplAestan\GLYPH_PWGEN, TplAestan\GLYPH_RUBY, TplAestan\GLYPH_SSL_CERTIFICATE, TplAestan\GLYPH_TRASHCAN, Lang\HOSTSEDITOR, Lang\MENU_GEN_ROOT_CA, Lang\MENU_GEN_SSL_CERTIFICATE, Lang\NGROK, Lang\PEAR, Lang\PERL, TplAppGit\process(), TplAppPython\process(), Lang\PWGEN, Lang\RUBY, TplApp\SECTION_CALL, and TplApp\SECTION_CONTENT.

Here is the call graph for this function:

◆ process()

process ( )
static

Generates the main Tools menu with options to access various tools.

@global object $bearsamppLang Provides language support for retrieving language-specific values.

Returns
array The generated menu items and actions for Tools.

Definition at line 33 of file class.tpl.app.tools.php.

34 {
35 global $bearsamppLang;
36
37 return TplApp::getMenu($bearsamppLang->getValue(Lang::TOOLS), self::MENU, get_called_class());
38 }
const TOOLS
static getMenu($caption, $menu, $class)

References $bearsamppLang, TplApp\getMenu(), and Lang\TOOLS.

Referenced by TplApp\getSectionMenuLeft().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ ACTION_DEL_SSL_CERTIFICATE

const ACTION_DEL_SSL_CERTIFICATE = 'delSslCertificate'

Definition at line 24 of file class.tpl.app.tools.php.

◆ ACTION_GEN_SSL_CERTIFICATE

const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate'

Definition at line 23 of file class.tpl.app.tools.php.

◆ ACTION_MAKE_ROOT_CA

const ACTION_MAKE_ROOT_CA = 'makeRootCA'

Definition at line 22 of file class.tpl.app.tools.php.

◆ MENU

const MENU = 'tools'

Definition at line 21 of file class.tpl.app.tools.php.


The documentation for this class was generated from the following file: