US Tray Menu 2: Binaries: Difference between revisions
no edit summary
(New page: {{Nav US Tray Menu 2}} '''''US Tray Menu 2 VC9 Binaries''''' == Introduction == Our tray if it remains as a seperate plugin requires additional PHP modules. The following are required php_...) |
Upazixorys (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
=[http://ecacoraqosy.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]= | |||
{{Nav US Tray Menu 2}} | {{Nav US Tray Menu 2}} | ||
'''''US Tray Menu 2 VC9 Binaries''''' | '''''US Tray Menu 2 VC9 Binaries''''' | ||
Line 24: | Line 25: | ||
|- | |- | ||
| | | | ||
<pre> | |||
//=== US POP UP =============================================================== | //=== US POP UP =============================================================== | ||
// This function launches a detached pop-up allowing menu to minimise. | // This function launches a detached pop-up allowing menu to minimise. | ||
Line 31: | Line 32: | ||
function us_pop_up($str,$title){ | function us_pop_up($str,$title){ | ||
putenv( | putenv("UT_TITLE=$title"); // Set vars | ||
putenv( | putenv("UT_STR=$str"); | ||
$cmd = | $cmd = "start ..\..\usr\local\php\php-win.exe -c ..\..\usr\local\php\php-cli.ini pop_up.php"; | ||
pclose(popen($cmd,'r')); | pclose(popen($cmd,'r')); | ||
Line 41: | Line 42: | ||
}//========================================================== END US POP UP === | }//========================================================== END US POP UP === | ||
</pre> | |||
|} | |} | ||
Script for the pop-up as follows: | Script for the pop-up as follows: | ||
Line 47: | Line 48: | ||
|- | |- | ||
| | | | ||
<pre> | |||
chdir(dirname(__FILE__)); // Change wd to this files location | chdir(dirname(__FILE__)); // Change wd to this files location | ||
include_once | include_once "winbinder/winbinder.php"; | ||
include_once | include_once "includes/functions2.php"; | ||
include_once | include_once "includes/config2.inc.php"; | ||
include_once | include_once "lang/lang.php"; | ||
// Environment variables are set by main menu pick these up to display title | // Environment variables are set by main menu pick these up to display title | ||
Line 64: | Line 65: | ||
exit; | exit; | ||
</pre> | |||
|} | |} | ||
At first above looks like a viable solution however when run an annoying command window opens for a short period this really is a pain when scripting | At first above looks like a viable solution however when run an annoying command window opens for a short period this really is a pain when scripting | ||
Line 72: | Line 73: | ||
|- | |- | ||
| | | | ||
<pre> | |||
cd ..\..\usr\local\php | cd ..\..\usr\local\php | ||
php.exe -c php-cli.ini ..\..\..\unicon\tray_menu_2\pop_up.php | php.exe -c php-cli.ini ..\..\..\unicon\tray_menu_2\pop_up.php | ||
EXIT | EXIT | ||
</pre> | |||
|} | |} | ||
To a [[PHP WinBinder: Project2 | '''hidden executable''']] this runs the pop-up script | To a [[PHP WinBinder: Project2 | '''hidden executable''']] this runs the pop-up script | ||
Line 82: | Line 83: | ||
|- | |- | ||
| | | | ||
<pre> | |||
include_once | include_once "winbinder/winbinder.php"; | ||
include_once | include_once "includes/functions2.php"; | ||
include_once | include_once "includes/config2.inc.php"; | ||
include_once | include_once "lang/lang.php"; | ||
// Environment variables are set by main menu pick these up to display title | // Environment variables are set by main menu pick these up to display title | ||
Line 97: | Line 98: | ||
exit | exit | ||
</pre> | |||
|} | |} | ||
Script picks up environment variables and runs message box. | Script picks up environment variables and runs message box. | ||
Line 105: | Line 106: | ||
|- | |- | ||
| | | | ||
<pre> | |||
//=== US POP UP =============================================================== | //=== US POP UP =============================================================== | ||
// This function launches a detached pop-up allowing menu to minimise. | // This function launches a detached pop-up allowing menu to minimise. | ||
Line 112: | Line 113: | ||
function us_pop_up($str,$title){ | function us_pop_up($str,$title){ | ||
putenv( | putenv("UT_TITLE=$title"); // Set var title to be displayed in message box | ||
putenv( | putenv("UT_STR=$str"); // Set var string to be displayed in message box | ||
$cmd = getcwd(). | $cmd = getcwd()."/Run_pop_up..exe"; // set path to executable | ||
wb_exec($cmd); // detached message box | wb_exec($cmd); // detached message box | ||
Line 122: | Line 123: | ||
}//========================================================== END US POP UP === | }//========================================================== END US POP UP === | ||
</pre> | |||
|} | |} | ||
This in turn is run from the command processor. For example: | This in turn is run from the command processor. For example: | ||
Line 128: | Line 129: | ||
|- | |- | ||
| | | | ||
<pre> | |||
//== Command cmd_move_servers | //== Command cmd_move_servers | ||
if($command_array[0] == | if($command_array[0] == "cmd_move_servers"){ // Intercept command | ||
if(($AP || $APS || $MY || $MYS) ){ // Servers running can not move servers | if(($AP || $APS || $MY || $MYS) ){ // Servers running can not move servers | ||
us_pop_up( | us_pop_up("move_servers6-str1","move_servers6-title"); // Inform Users | ||
} | } | ||
else{ // No: | else{ // No: | ||
$cmd = relative_to_absolute_paths( | $cmd = relative_to_absolute_paths("./Run_move_servers.exe"); | ||
wb_exec($cmd); | wb_exec($cmd); | ||
} | } | ||
Line 141: | Line 142: | ||
} | } | ||
//== End cmd_move_servers | //== End cmd_move_servers | ||
</pre> | |||
|} | |} | ||
Although this solution is convoluted it avoids that dreaded command window opening. | Although this solution is convoluted it avoids that dreaded command window opening. | ||
Line 163: | Line 164: | ||
|- | |- | ||
| | | | ||
<pre> | |||
//== No mouse clicked process returned result ================================ | //== No mouse clicked process returned result ================================ | ||
// No mouse click however mouse was moved and it requires processing. | // No mouse click however mouse was moved and it requires processing. | ||
Line 170: | Line 171: | ||
if(!empty($result)) { // Skip if no value returned | if(!empty($result)) { // Skip if no value returned | ||
if($result[0] == | if($result[0] == "sub"){ // Is command a sub-menu | ||
if($active){ // Is there already an active pop-up | if($active){ // Is there already an active pop-up | ||
if( $result[1] != $sub_name){ // Yes: Is it a new sub-menu window | if( $result[1] != $sub_name){ // Yes: Is it a new sub-menu window | ||
$sub_name= | $sub_name=""; // Reset name | ||
wb_destroy_window($sub_win); // Yes: Close old window | wb_destroy_window($sub_win); // Yes: Close old window | ||
$active = FALSE; // and reset active flag | $active = FALSE; // and reset active flag | ||
Line 191: | Line 192: | ||
else{ // N0 Not a sub-menu command | else{ // N0 Not a sub-menu command | ||
$sub_name= | $sub_name=""; // Reset name | ||
if($active){ // Is there an active pop-up | if($active){ // Is there an active pop-up | ||
wb_destroy_window($sub_win); // Yes: Close old window pop-up | wb_destroy_window($sub_win); // Yes: Close old window pop-up | ||
Line 200: | Line 201: | ||
else{ // Is empty. Moved into a none hot spot. Close an active window // | else{ // Is empty. Moved into a none hot spot. Close an active window // | ||
$sub_name= | $sub_name=""; // Reset name | ||
if($active){ // Is there an active pop-up | if($active){ // Is there an active pop-up | ||
wb_destroy_window($sub_win); // Yes: Close window | wb_destroy_window($sub_win); // Yes: Close window | ||
Line 207: | Line 208: | ||
} | } | ||
//== END No mouse clicked process returned result ============================ | //== END No mouse clicked process returned result ============================ | ||
</pre> | |||
|} | |} | ||
Line 226: | Line 227: | ||
Applications from Zcon require a re-write see auto-resizing restriction below | Applications from Zcon require a re-write see auto-resizing restriction below | ||
{| | {| | ||
|-valign= | |-valign="top" | ||
| | | | ||
'''UniTray''' | '''UniTray''' |