diff --git a/admin/index.php b/admin/index.php index 6c3e2915..c47ac1d6 100644 --- a/admin/index.php +++ b/admin/index.php @@ -2,6 +2,9 @@ // few things we'll need require '../common.php'; +define('ADMIN_PANEL', true); +define('MYAAC_ADMIN', true); + if(file_exists(BASE . 'config.local.php')) { require_once BASE . 'config.local.php'; } @@ -12,8 +15,6 @@ if(file_exists(BASE . 'install') && (!isset($config['installed']) || !$config['i throw new RuntimeException('Setup detected that install/ directory exists. Please visit this url to start MyAAC Installation.
Delete install/ directory if you already installed MyAAC.
Remember to REFRESH this page when you\'re done!'); } -define('ADMIN_PANEL', true); - $content = ''; // validate page diff --git a/admin/tools/phpinfo.php b/admin/tools/phpinfo.php index 5b791d07..96a9aad9 100644 --- a/admin/tools/phpinfo.php +++ b/admin/tools/phpinfo.php @@ -1,4 +1,6 @@ ' . - $locale['step_database_error_mysql_connect_2'] . - '' . '
' . $error; + $database_error = '

' . $locale['step_database_error_mysql_connect'] . '

'; + + $database_error .= '

' . $locale['step_database_error_mysql_connect_2'] . '

'; + + $database_error .= ''; + + $database_error .= '
+ ' . $error . ' +
'; } else { if($db->hasTable('accounts')) diff --git a/install/includes/functions.php b/install/includes/functions.php index e4ce4522..b9934928 100644 --- a/install/includes/functions.php +++ b/install/includes/functions.php @@ -62,9 +62,9 @@ function next_buttons($previous = true, $next = true) $ret .= ''; */ if($previous) - $ret .= ''; + $ret .= ''; if($next) - $ret .= ''; + $ret .= ''; $ret .= ''; return $ret; diff --git a/install/steps/1-welcome.php b/install/steps/1-welcome.php index 47ef9d15..93e01050 100644 --- a/install/steps/1-welcome.php +++ b/install/steps/1-welcome.php @@ -1,7 +1,7 @@ ' . $locale['already_installed'] . '

'; + echo '
' . $locale['already_installed'] . '
'; } else { unset($_SESSION['saved']); diff --git a/install/steps/3-requirements.php b/install/steps/3-requirements.php index 5b5e0aba..63b3dc2a 100644 --- a/install/steps/3-requirements.php +++ b/install/steps/3-requirements.php @@ -26,11 +26,11 @@ $extensions_optional = [ function version_check($name, $ok, $info = '', $warning = false) { global $failed; - echo '

' . $name; + echo '

' . $name; if(!empty($info)) echo ': ' . $info . ''; - echo '

'; + echo '
'; if(!$ok && !$warning) $failed = true; } @@ -67,11 +67,14 @@ foreach ($extensions_optional as $ext => $errorMsg) { version_check(str_replace('$EXTENSION$', strtoupper($ext), $locale['step_requirements_extension']) , $loaded, $loaded ? $locale['loaded'] : $locale['not_loaded'] . '. ' . $errorMsg, true); } -if($failed) -{ - echo '
' . $locale['step_requirements_failed']; +echo '
'; + +if($failed) { + echo '
' . $locale['step_requirements_failed'] . '
'; echo next_form(true, false); -} -else +}else { echo next_form(true, true); +} + +echo '
'; ?> \ No newline at end of file diff --git a/install/steps/5-database.php b/install/steps/5-database.php index 1b5a6be7..ca06cc7f 100644 --- a/install/steps/5-database.php +++ b/install/steps/5-database.php @@ -95,8 +95,10 @@ if(!$error) { } ?> -
- - -
\ No newline at end of file +
+
+ + +
+
\ No newline at end of file diff --git a/install/template/style.css b/install/template/style.css index c6d1ae66..ee9760ea 100644 --- a/install/template/style.css +++ b/install/template/style.css @@ -1,299 +1,13 @@ -* { - margin: 0; padding: 0; -} +@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400&display=swap'); + body { - text-align: center; - font: 12px Verdana; - color: #000000; - background-color: #000000; -} -img { - border: 0; + font-family: 'Roboto', sans-serif; } -.break { - font-size: 0; - width: 0; height: 0; - clear: both; -} -.alignleft { - float: left; - margin: 4px 10px 5px 0; -} -.alignright { - float: right; - margin: 4px 0 5px 10px; -} -.aligncenter { - text-align: center; +h1{ + font-weight: 100 !important; } -/** BEGIN wrapper **/ -#wrapper { - background: #ffffff url(images/background.jpg) repeat-x 0 0; - width: 980px; -} - -#header { - margin-bottom: 10px; - border-bottom: 1px solid #eee; - padding-bottom: 15px; -} - -#footer { - padding-top: 15px; - border-top: 1px solid #eee; - margin-top: 10px; - text-align: right; - color: #555; -} - -#header h1 { - font-weight: bold; - margin: 0; - padding: 0; -} - -#header span { - font-size: 25px; - color: #000; - font-weight: bold; - padding-left: 40px; - line-height: 80px; -} - -#version { - float: right; - color: #000; - font-size: 17px; - padding-top: 25px; - padding-right: 5px; -} - -/** BEGIN body **/ -#body { - background: url(images/wrapper.gif) repeat-y 0 0; -} -/** END body **/ - -/** BEGIN content **/ -#content { - width: 642px; - float: left; - padding: 20px 18px 20px 20px; - color: #434242; -} - - /** begin headers **/ - h1, h2, h3, h4, h5, h6 { - font-family: Tahoma; - margin-bottom: 10px; - } - h2, h3, h4, h5, h6 { - margin-top: 30px; - } - h1 { font-size: 2em; } - h2 { font-size: 1.6em; } - h3 { font-size: 1.3em; } - h4, h5, h6 { font-size: 1em; } - /** end headers **/ - - /** begin messages **/ - .error, .success, .note, .warning { - font-weight: bold; - font-size: 0.9em; - padding: 4px 10px 4px 24px; - background-repeat: no-repeat; - background-position: 5px 6px; - border-style: solid; - border-width: 1px; - line-height: 1.6em; - margin-bottom: 10px; - } - .error { - background-color: #FDD9D9; - background-image: url(images/error.gif); - border-color: #FBA3A3; - color: #D80303; - } - .success { - background-color: #E4FCD9; - background-image: url(images/success.gif); - border-color: #BFFDA3; - color: #35A502; - } - .note { - background-color: #DDEAFA; - background-image: url(images/note.gif); - border-color: #A3D8FD; - color: #026DA5; - } - .warning { - background-color: #FBF0B3; - background-image: url(images/warning.gif); - border-color: #FBBB95; - color: #FD6002; - } - /** end messages **/ - - /** begin form **/ - form { - border: 1px solid #DDDDDD; - padding: 16px; - } - form .input { - padding-top: 12px; - clear: both; - } - form .first { - padding-top: 0; - } - form .input p { - margin-bottom: 7px !important; - } - form input { - margin-right: 5px; - } - form label { - margin-right: 10px; - color: #8B8B8B; - } - form input.text, form textarea { - border: 1px solid #BEBDBD; - font-size: 1em; - font-family: Verdana; - background-color: #F3F3F3; - color: #808080; - padding: 2px; - max-width: 100%; - } - .positive, .negative { - font-size: 0.9em; - font-weight: bold; - padding: 1px 0 0 20px; - background-repeat: no-repeat; - background-position: 0 0; - display: inline; - margin-top: 2px; - } - .positive { - background-image: url(images/positive.gif); - color: #35A502; - } - .negative { - background-image: url(images/negative.gif); - color: #D80303; - } - form textarea { - line-height: 1.6em; - } - form button, form input.button { - font-size: 0.9em; - font-family: Verdana; - font-weight: bold; - color: #ffffff; - background: #B6B4B4 url(images/button.gif) repeat-x 0 0; - border: 1px solid #B6B4B4; - padding: 5px 10px; - } - /** end form **/ - - /** begin table **/ - table { - - } - table th { - font-size: 0.9em; - color: #ffffff; - background-color: #679BC5; - padding: 2px 4px; - line-height: 1.6em; - } - table td { - line-height: 1.6em; - padding: 2px 4px; - } - table tr.odd td { background-color: #EEEEEE; } - table tr.even td { background-color: #E5E5E5; } - - /** end table **/ - - /** begin paragraphs, lists, etc. **/ - #content p { - line-height: 1.6em; - margin-bottom: 10px; - } - #content ul, #content ol { - list-style-position: inside; - } - #content li { - line-height: 1.6em; - padding: 2px 0 2px 0; - } - a { - color: #679BC5; - } - a:hover { - color: #ff0000; - text-decoration: none; - } - blockquote { - padding: 10px; - background-color: #eeeeee; - line-height: 1.6em; - border-width: 2px 0 1px; - border-style: solid; - border-color: #e0e0e0; - } - /** end paragraphs, lists, etc. **/ - -/** END content **/ - -/** BEGIN sidebar **/ -#sidebar { - width: 300px; - float: right; - padding: 10px 0; -} - #sidebar h2 { - background: green url(images/sidehead.gif) no-repeat 0 0; - margin: 0 10px; - font-size: 1em; - color: #ffffff; - padding: 7px 10px; - } - #sidebar ul { - list-style-type: none; - background: #E0E0E0 url(images/sidebody.gif) no-repeat 0 bottom; - padding: 10px; - margin: 0 10px 10px; - } - #sidebar ul li { - padding: 4px 0 4px 14px; - background: none; - line-height: 1.6em; - font-size: 0.9em; - font-weight: bold; - } - #sidebar ul li a { - color: #000000; - text-decoration: none; - } - #sidebar ul li a:hover { - text-decoration: none; - color: #ff0000; - } - - #sidebar ul li a:active { - text-decoration: none; - color: #ff0000; - } - - #sidebar ul li current { - text-decoration: none; - color: #ff0000; - } - .current { - text-decoration: none; - color: #ff0000; - } \ No newline at end of file +h3 { + font-weight: 300 !important; +} \ No newline at end of file diff --git a/install/template/template.php b/install/template/template.php index a728a2d0..862a97af 100644 --- a/install/template/template.php +++ b/install/template/template.php @@ -1,48 +1,74 @@ - - + + + MyAAC - <?php echo $locale['installation']; ?> + -
- - -
+
+ + - +
-
+ - -
+
- + +
+ + ' . $locale['step_' . $step . '_title'] . ''; + else + echo '

' . $locale['step_' . $step] . '

'; + ?> + + +
+
+
+
+
+
+
+ + + + +
+ +
+ +
+
- + \ No newline at end of file diff --git a/install/tools/5-database.php b/install/tools/5-database.php index e80aba70..95378226 100644 --- a/install/tools/5-database.php +++ b/install/tools/5-database.php @@ -1,4 +1,6 @@ hasTable('z_forum')) { success($locale['step_database_adding_field'] . ' z_forum.closed...'); } } -} \ No newline at end of file +} diff --git a/install/tools/7-finish.php b/install/tools/7-finish.php index 65787849..3d98b570 100644 --- a/install/tools/7-finish.php +++ b/install/tools/7-finish.php @@ -1,4 +1,6 @@ ' . $message . '
'; + if($return) { + // for install and admin pages use bootstrap classes + return '
' . $message . '
'; + } - echo '
' . $message . '
'; + echo '
' . $message . '
'; return true; } function success($message, $return = false) { @@ -39,28 +41,9 @@ function note($message, $return = false) { return message($message, 'note', $return); } function error($message, $return = false) { - return message($message, 'error', $return); + return message($message, ((defined('MYAAC_INSTALL') || defined('MYAAC_ADMIN')) ? 'danger' : 'error'), $return); } -function message1($head, $message, $type, $icon , $return) -{//return '
' . $message . '
'; - if($return) - return '

'.$head.':

'.$message.'
'; - echo '

'.$head.':

'.$message.'
'; - return true; -} -function success1($message, $return = false) { - return message('Info', $message, 'success','success', $return); -} -function warning1($message, $return = false) { - return message('Warning',$message, 'warning','ban', $return); -} -function note1($message, $return = false) { - return message('Info',$message, 'info','info', $return); -} -function error1($message, $return = false) { - return message("Alert", $message, 'danger','check', $return); -} function longToIp($ip) { $exp = explode(".", long2ip($ip)); diff --git a/system/locale/en/install.php b/system/locale/en/install.php index 3c45f288..36500d1c 100644 --- a/system/locale/en/install.php +++ b/system/locale/en/install.php @@ -20,7 +20,7 @@ $locale['not_loaded'] = 'Not loaded'; $locale['loading_spinner'] = 'Please wait, installing...'; $locale['importing_spinner'] = 'Please wait, importing data...'; $locale['please_fill_all'] = 'Please fill all inputs!'; -$locale['already_installed'] = 'MyAAC has been already installed. Please delete install/ directory. If you want to reinstall MyAAC - please delete config.local.php file from the main directory and refresh the page.'; +$locale['already_installed'] = 'MyAAC has been already installed. Please delete install/ directory. If you want to reinstall MyAAC - please delete config.local.php file from the main directory and refresh the page.'; // welcome $locale['step_welcome'] = 'Welcome'; diff --git a/system/templates/install.admin.html.twig b/system/templates/install.admin.html.twig index 42b49c41..26786d4d 100644 --- a/system/templates/install.admin.html.twig +++ b/system/templates/install.admin.html.twig @@ -1,32 +1,26 @@ - +{% if errors is not empty %} +
+ {% for error in errors %} + {{ error }} + {% endfor %} +
+{% endif %} +
- - {% for value in ['email', account, 'password', 'player_name'] %} - - - - - {% endfor %} -
- -
- -
- {{ locale['step_admin_' ~ value ~ '_desc']|raw }} -
+ + {% for value in ['email', account, 'password', 'player_name'] %} + +
+ + + {{ locale['step_admin_' ~ value ~ '_desc']|raw }} +
- {% if errors is defined %} - {% for error in errors %} -

{{ error }}

- {% endfor %} - {% endif %} + {% endfor %} + +
{{ buttons|raw }} +
+
diff --git a/system/templates/install.config.html.twig b/system/templates/install.config.html.twig index 64765910..a6ba24f7 100644 --- a/system/templates/install.config.html.twig +++ b/system/templates/install.config.html.twig @@ -1,71 +1,51 @@ +{% if errors is not empty %} +
+ {% for error in errors %} + {{ error }} + {% endfor %} +
+{% endif %} +
- - {% for value in ['server_path', 'mail_admin'] %} - - - - - {% endfor %} - - - - - - - - - - - - -
- -
- -
- {{ locale['step_config_' ~ value ~ '_desc'] }} -
- -
- -
- {{ locale.step_config_timezone_desc }} -
- -
- -
- {{ locale.step_config_client_desc }} -
- -
- - -
- {{ locale.step_config_usage_desc }} -
- {% if errors is defined %} - {% for error in errors %} -

{{ error }}

- {% endfor %} - {% endif %} + {% for value in ['server_path', 'mail_admin'] %} +
+ + + {{ locale['step_config_' ~ value ~ '_desc'] }} +
+ {% endfor %} + +
+ + + {{ locale.step_config_timezone_desc }} +
+ +
+ + + {{ locale.step_config_client_desc }} +
+ +
+ + + + {{ locale.step_config_usage_desc }} +
+ +
{{ buttons|raw }} +
+
\ No newline at end of file diff --git a/system/templates/install.license.html.twig b/system/templates/install.license.html.twig index e9998fbe..022650b6 100644 --- a/system/templates/install.license.html.twig +++ b/system/templates/install.license.html.twig @@ -1,6 +1,8 @@
- + +
{{ buttons|raw }} +
\ No newline at end of file diff --git a/system/templates/install.welcome.html.twig b/system/templates/install.welcome.html.twig index b422ddb6..5d8270d7 100644 --- a/system/templates/install.welcome.html.twig +++ b/system/templates/install.welcome.html.twig @@ -1,12 +1,17 @@ +

{{ locale.step_welcome_desc }}:

+
-

{{ locale.step_welcome_desc }}

- {% for locale_ in locales %} {% endfor %}
+
{{ buttons|raw }} +