2012-04-02 13:04:53 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* OpenSQLManager
|
|
|
|
*
|
|
|
|
* Free Database manager for Open Source Databases
|
|
|
|
*
|
2012-04-20 13:30:27 -04:00
|
|
|
* @package OpenSQLManager
|
2012-04-02 13:04:53 -04:00
|
|
|
* @author Timothy J. Warren
|
|
|
|
* @copyright Copyright (c) 2012
|
|
|
|
* @link https://github.com/aviat4ion/OpenSQLManager
|
|
|
|
* @license http://philsturgeon.co.uk/code/dbad-license
|
|
|
|
*/
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// ! Global Functions
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
namespace OpenSQLManager;
|
|
|
|
|
2012-04-02 13:04:53 -04:00
|
|
|
/**
|
|
|
|
* Convert an array to an object
|
|
|
|
*
|
|
|
|
* @param array $array
|
|
|
|
* @return object
|
|
|
|
*/
|
|
|
|
function array_to_object($array)
|
|
|
|
{
|
|
|
|
if (is_object($array))
|
|
|
|
{
|
|
|
|
return $array;
|
|
|
|
}
|
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
$obj = new \StdClass();
|
2012-04-02 13:04:53 -04:00
|
|
|
|
2012-05-14 13:25:32 -04:00
|
|
|
foreach($array as $k => &$v)
|
2012-04-02 13:04:53 -04:00
|
|
|
{
|
|
|
|
$obj->$k = $v;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
2012-04-19 21:55:44 -04:00
|
|
|
* Create info dialog to return an informational message
|
2012-04-02 13:04:53 -04:00
|
|
|
*
|
|
|
|
* @param string $message
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function alert($message)
|
|
|
|
{
|
2012-05-29 14:29:20 -04:00
|
|
|
return \wxMessageBox($message, 'Info', wxOK);
|
2012-04-02 13:04:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create info dialog to retun an informational message
|
|
|
|
*
|
|
|
|
* @param string $message
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function error($message)
|
|
|
|
{
|
2012-05-29 14:29:20 -04:00
|
|
|
/*$dialog = new GTKMessageDialog(
|
2012-04-02 13:04:53 -04:00
|
|
|
NULL,
|
|
|
|
Gtk::DIALOG_MODAL,
|
|
|
|
Gtk::MESSAGE_ERROR,
|
|
|
|
Gtk::BUTTONS_OK,
|
|
|
|
$message
|
|
|
|
);
|
|
|
|
|
|
|
|
$dialog->set_position(Gtk::WIN_POS_CENTER);
|
|
|
|
$dialog->run();
|
2012-05-29 14:29:20 -04:00
|
|
|
$dialog->destroy();*/
|
2012-04-02 13:04:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a binary confirmation dialog
|
|
|
|
*
|
|
|
|
* @param string $message
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
function confirm($message)
|
|
|
|
{
|
2012-05-29 14:29:20 -04:00
|
|
|
/*$dialog = new GTKMessageDialog(
|
2012-04-02 13:04:53 -04:00
|
|
|
NULL,
|
|
|
|
Gtk::DIALOG_MODAL,
|
|
|
|
Gtk::MESSAGE_QUESTION,
|
|
|
|
Gtk::BUTTONS_YES_NO,
|
|
|
|
$message
|
|
|
|
);
|
|
|
|
|
|
|
|
$dialog->set_position(Gtk::WIN_POS_CENTER);
|
|
|
|
$answer = $dialog->run();
|
|
|
|
$dialog->destroy();
|
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
return ($answer === Gtk::RESPONSE_YES) ? TRUE : FALSE;*/
|
2012-04-02 13:04:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display About menu with version information
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function about()
|
|
|
|
{
|
2012-05-29 14:29:20 -04:00
|
|
|
/*$dlg = new \wxAboutDialogInfo();
|
2012-04-02 13:04:53 -04:00
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
$dlg->SetName(PROGRAM_NAME);
|
|
|
|
$dlg->SetVersion(VERSION);
|
2012-04-02 13:04:53 -04:00
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
$dlg->SetCopyright("Copyright (c) ".date('Y')." Timothy J. Warren");
|
2012-04-02 13:04:53 -04:00
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
$dlg->SetWebSite('https://github.com/aviat4ion/OpenSQLManager','Fork on Github');
|
2012-04-02 13:04:53 -04:00
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
$dlg->SetLicense(file_get_contents(BASE_DIR . "/LICENSE"));
|
2012-04-02 13:04:53 -04:00
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
$dlg->SetDevelopers(array(
|
2012-04-02 13:04:53 -04:00
|
|
|
'Timothy J. Warren',
|
|
|
|
));
|
2012-05-29 14:29:20 -04:00
|
|
|
|
|
|
|
\wxGenericAboutBox($dlg);*/
|
2012-04-02 13:04:53 -04:00
|
|
|
}
|
|
|
|
// End of functions.php
|