Bearsampp 2025.8.29
Loading...
Searching...
No Matches
class.tpl.aestan.php
Go to the documentation of this file.
1<?php
2/*
3 *
4 * * Copyright (c) 2021-2024 Bearsampp
5 * * License: GNU General Public License version 3 or later; see LICENSE.txt
6 * * Website: https://bearsampp.com
7 * * Github: https://github.com/Bearsampp
8 *
9 */
10
47{
48 // Glyph constants
49 const GLYPH_CONSOLEZ = 0;
50 const GLYPH_ADD = 1;
53 const GLYPH_BROWSER = 5;
54 const GLYPH_FILE = 6;
57 const GLYPH_START = 9;
58 const GLYPH_PAUSE = 10;
59 const GLYPH_STOP = 11;
60 const GLYPH_RELOAD = 12;
61 const GLYPH_CHECK = 13;
65 const GLYPH_WARNING = 19;
66 const GLYPH_EXIT = 20;
67 const GLYPH_ABOUT = 21;
71 const GLYPH_LIGHT = 25;
72 const GLYPH_GIT = 26;
73 const GLYPH_NODEJS = 28;
74 const GLYPH_NETWORK = 29;
75 const GLYPH_WEB_PAGE = 30;
76 const GLYPH_DEBUG = 31;
77 const GLYPH_TRASHCAN = 32;
78 const GLYPH_UPDATE = 33;
79 const GLYPH_RESTART = 34;
81 const GLYPH_RED_LIGHT = 36;
82 const GLYPH_COMPOSER = 37;
83 const GLYPH_PEAR = 38;
86 const GLYPH_NOTEPAD2 = 42;
87 const GLYPH_PASSWORD = 45;
90 const GLYPH_PYTHON = 50;
91 const GLYPH_RUBY = 52;
92 const GLYPH_PERL = 55;
94 const GLYPH_NGROK = 57;
95 const GLYPH_PWGEN = 58;
96 const GLYPH_XLIGHT = 59;
98 const GLYPH_BRUNO = 61;
99
100 // Service actions
101 const SERVICE_START = 'startresume';
102 const SERVICE_STOP = 'stop';
103 const SERVICE_RESTART = 'restart';
104 const SERVICES_CLOSE = 'closeservices';
105
106 // Image files
107 const IMG_BAR_PICTURE = 'bar.dat';
108 const IMG_GLYPH_SPRITES = 'sprites.dat';
109
116 public static function getGlyphFlah($lang)
117 {
118 }
119
125 public static function getItemSeparator()
126 {
127 return 'Type: separator';
128 }
129
141 public static function getItemConsoleZ($caption, $glyph, $id = null, $title = null, $initDir = null, $command = null)
142 {
143 global $bearsamppTools;
144
145 $args = '';
146 if ($id != null) {
147 $args .= ' -t ""' . $id . '""';
148 }
149 if ($title != null) {
150 $args .= ' -w ""' . $title . '""';
151 }
152 if ($initDir != null) {
153 $args .= ' -d ""' . $initDir . '""';
154 }
155 if ($command != null) {
156 $args .= ' -r ""' . $command . '""';
157 }
158
159 return self::getItemExe(
160 $caption,
161 $bearsamppTools->getConsoleZ()->getExe(),
162 $glyph,
163 $args
164 );
165 }
166
176 public static function getItemLink($caption, $link, $local = false, $glyph = self::GLYPH_WEB_PAGE)
177 {
179
180 if ($local) {
181 $link = $bearsamppRoot->getLocalUrl($link);
182 }
183
184 return self::getItemExe(
185 $caption,
186 $bearsamppConfig->getBrowser(),
187 $glyph,
188 $link
189 );
190 }
191
199 public static function getItemNotepad($caption, $path)
200 {
201 global $bearsamppConfig;
202
203 return self::getItemExe(
204 $caption,
205 $bearsamppConfig->getNotepad(),
206 self::GLYPH_FILE,
207 $path
208 );
209 }
210
220 public static function getItemExe($caption, $exe, $glyph, $params = null)
221 {
222 return 'Type: item; ' .
223 'Caption: "' . $caption . '"; ' .
224 'Action: run; ' .
225 'FileName: "' . $exe . '"; ' .
226 (!empty($params) ? 'Parameters: "' . $params . '"; ' : '') .
227 'Glyph: ' . $glyph;
228 }
229
237 public static function getItemExplore($caption, $path)
238 {
239 return 'Type: item; ' .
240 'Caption: "' . $caption . '"; ' .
241 'Action: shellexecute; ' .
242 'FileName: "' . $path . '"; ' .
243 'Glyph: ' . self::GLYPH_FOLDER_OPEN;
244 }
245
254 private static function getActionService($service, $action, $item = false)
255 {
256 global $bearsamppLang;
257 $result = 'Action: ' . $action;
258
259 if ($service != null) {
260 $result = 'Action: service; ' .
261 'Service: ' . $service . '; ' .
262 'ServiceAction: ' . $action;
263 }
264
265 if ($item) {
266 $result = 'Type: item; ' . $result;
267 if ($action == self::SERVICE_START) {
268 $result .= '; Caption: "' . $bearsamppLang->getValue(Lang::MENU_START_SERVICE) . '"' .
269 '; Glyph: ' . self::GLYPH_START;
270 } elseif ($action == self::SERVICE_STOP) {
271 $result .= '; Caption: "' . $bearsamppLang->getValue(Lang::MENU_STOP_SERVICE) . '"' .
272 '; Glyph: ' . self::GLYPH_STOP;
273 } elseif ($action == self::SERVICE_RESTART) {
274 $result .= '; Caption: "' . $bearsamppLang->getValue(Lang::MENU_RESTART_SERVICE) . '"' .
275 '; Glyph: ' . self::GLYPH_RELOAD;
276 }
277 } elseif ($action != self::SERVICES_CLOSE) {
278 $result .= '; Flags: ignoreerrors waituntilterminated';
279 }
280
281 return $result;
282 }
283
290 public static function getActionServiceStart($service)
291 {
292 return self::getActionService($service, self::SERVICE_START, false);
293 }
294
301 public static function getItemActionServiceStart($service)
302 {
303 return self::getActionService($service, self::SERVICE_STOP, true);
304 }
305
312 public static function getActionServiceStop($service)
313 {
314 return self::getActionService($service, self::SERVICE_STOP, false);
315 }
316
323 public static function getItemActionServiceStop($service)
324 {
325 return self::getActionService($service, self::SERVICE_START, true);
326 }
327
334 public static function getActionServiceRestart($service)
335 {
336 return self::getActionService($service, self::SERVICE_RESTART, false);
337 }
338
345 public static function getItemActionServiceRestart($service)
346 {
347 return self::getActionService($service, self::SERVICE_RESTART, true);
348 }
349
355 public static function getActionServicesClose()
356 {
357 return self::getActionService(null, self::SERVICES_CLOSE, false);
358 }
359
365 public static function getItemActionServicesClose()
366 {
367 return self::getActionService(null, self::SERVICES_CLOSE, true);
368 }
369
375 public static function getSectionMessages()
376 {
377 global $bearsamppLang;
378
379 return '[Messages]' . PHP_EOL .
380 'AllRunningHint=' . $bearsamppLang->getValue(Lang::ALL_RUNNING_HINT) . PHP_EOL .
381 'SomeRunningHint=' . $bearsamppLang->getValue(Lang::SOME_RUNNING_HINT) . PHP_EOL .
382 'NoneRunningHint=' . $bearsamppLang->getValue(Lang::NONE_RUNNING_HINT) . PHP_EOL;
383 }
384
390 public static function getSectionConfig()
391 {
392 global $bearsamppCore;
393 return '[Config]' . PHP_EOL .
394 'ImageList=' . self::IMG_GLYPH_SPRITES . PHP_EOL .
395 'ServiceCheckInterval=1' . PHP_EOL .
396 'TrayIconAllRunning=' . self::GLYPH_SERVICE_ALL_RUNNING . PHP_EOL .
397 'TrayIconSomeRunning=' . self::GLYPH_SERVICE_SOME_RUNNING . PHP_EOL .
398 'TrayIconNoneRunning=' . self::GLYPH_SERVICE_NONE_RUNNING . PHP_EOL .
399 'ID={' . strtolower(APP_TITLE) . '}' . PHP_EOL .
400 'AboutHeader=' . APP_TITLE . PHP_EOL .
401 'AboutVersion=Version ' . $bearsamppCore->getAppVersion() . PHP_EOL;
402 }
403
409 public static function getSectionMenuRightSettings()
410 {
411 return '[Menu.Right.Settings]' . PHP_EOL .
412 'BarVisible=no' . PHP_EOL .
413 'SeparatorsAlignment=center' . PHP_EOL .
414 'SeparatorsFade=yes' . PHP_EOL .
415 'SeparatorsFadeColor=clBtnShadow' . PHP_EOL .
416 'SeparatorsFlatLines=yes' . PHP_EOL .
417 'SeparatorsGradientEnd=clSilver' . PHP_EOL .
418 'SeparatorsGradientStart=clGray' . PHP_EOL .
419 'SeparatorsGradientStyle=horizontal' . PHP_EOL .
420 'SeparatorsSeparatorStyle=shortline' . PHP_EOL;
421 }
422
429 public static function getSectionMenuLeftSettings($caption)
430 {
431 return '[Menu.Left.Settings]' . PHP_EOL .
432 'AutoLineReduction=no' . PHP_EOL .
433 'BarVisible=yes' . PHP_EOL .
434 'BarCaptionAlignment=bottom' . PHP_EOL .
435 'BarCaptionCaption=' . $caption . PHP_EOL .
436 'BarCaptionDepth=1' . PHP_EOL .
437 'BarCaptionDirection=downtoup' . PHP_EOL .
438 'BarCaptionFont=Tahoma,14,clWhite' . PHP_EOL .
439 'BarCaptionHighlightColor=clNone' . PHP_EOL .
440 'BarCaptionOffsetY=0' . PHP_EOL .
441 'BarCaptionShadowColor=clNone' . PHP_EOL .
442 'BarPictureHorzAlignment=center' . PHP_EOL .
443 'BarPictureOffsetX=0' . PHP_EOL .
444 'BarPictureOffsetY=0' . PHP_EOL .
445 'BarPicturePicture=' . self::IMG_BAR_PICTURE . PHP_EOL .
446 'BarPictureTransparent=yes' . PHP_EOL .
447 'BarPictureVertAlignment=bottom' . PHP_EOL .
448 'BarBorder=clNone' . PHP_EOL .
449 'BarGradientEnd=$00c07840' . PHP_EOL .
450 'BarGradientStart=$00c07840' . PHP_EOL .
451 'BarGradientStyle=horizontal' . PHP_EOL .
452 'BarSide=left' . PHP_EOL .
453 'BarSpace=0' . PHP_EOL .
454 'BarWidth=32' . PHP_EOL .
455 'SeparatorsAlignment=center' . PHP_EOL .
456 'SeparatorsFade=yes' . PHP_EOL .
457 'SeparatorsFadeColor=clBtnShadow' . PHP_EOL .
458 'SeparatorsFlatLines=yes' . PHP_EOL .
459 'SeparatorsFont=Arial,8,clWhite,bold' . PHP_EOL .
460 'SeparatorsGradientEnd=$00FFAA55' . PHP_EOL .
461 'SeparatorsGradientStart=$00550000' . PHP_EOL .
462 'SeparatorsGradientStyle=horizontal' . PHP_EOL .
463 'SeparatorsSeparatorStyle=caption' . PHP_EOL;
464 }
465}
$result
global $bearsamppLang
global $bearsamppRoot
global $bearsamppCore
const NONE_RUNNING_HINT
const MENU_STOP_SERVICE
const ALL_RUNNING_HINT
const MENU_RESTART_SERVICE
const SOME_RUNNING_HINT
const MENU_START_SERVICE
static getActionService($service, $action, $item=false)
static getActionServiceStop($service)
const GLYPH_SERVICE_SOME_RUNNING
static getItemExe($caption, $exe, $glyph, $params=null)
const GLYPH_SERVICE_NONE_RUNNING
static getSectionConfig()
const GLYPH_SERVICES_STOP
const GLYPH_FOLDER_DISABLED
const IMG_GLYPH_SPRITES
const GLYPH_RED_LIGHT
const GLYPH_SERVICES_RESTART
const GLYPH_FOLDER_CLOSE
const GLYPH_SERVICE_REMOVE
static getItemActionServicesClose()
static getGlyphFlah($lang)
static getActionServiceStart($service)
const GLYPH_GHOSTSCRIPT
const GLYPH_FOLDER_ENABLED
static getSectionMessages()
static getItemActionServiceStop($service)
const GLYPH_SERVICES_START
const GLYPH_SERVICE_ALL_RUNNING
const GLYPH_HOSTSEDITOR
static getActionServiceRestart($service)
static getSectionMenuLeftSettings($caption)
static getItemConsoleZ($caption, $glyph, $id=null, $title=null, $initDir=null, $command=null)
static getItemExplore($caption, $path)
const GLYPH_FOLDER_OPEN
const GLYPH_SERVICE_INSTALL
static getItemLink($caption, $link, $local=false, $glyph=self::GLYPH_WEB_PAGE)
static getItemNotepad($caption, $path)
const GLYPH_IMAGEMAGICK
static getSectionMenuRightSettings()
const GLYPH_SSL_CERTIFICATE
static getActionServicesClose()
static getItemActionServiceStart($service)
const GLYPH_REBUILD_INI
static getItemSeparator()
static getItemActionServiceRestart($service)
global $bearsamppConfig
Definition homepage.php:27
const APP_TITLE
Definition root.php:13