fixing fatal error after deleting server;
login screen: changing h2 to h3 and large buttons to medium; tooltip: show on hover instead of focus; changing styling of flashmessage (removing status text, adding icon, changing width); changing shortcodes from info to success for some actions; changing all php file permissions to 0644;pull/41/head
parent
9866ab0c22
commit
c7a3ba66c1
|
@ -362,24 +362,33 @@ abstract class AbstractController implements ControllerInterface {
|
|||
/**
|
||||
* Add one or multiple message to the stack to be displayed to the user
|
||||
* @param string|array $msg
|
||||
* @param string $status success/warning/error
|
||||
* @param string $shortcode info/success/warning/error
|
||||
* @return \psm\Module\AbstractModule
|
||||
*/
|
||||
public function addMessage($msg, $status = 'info') {
|
||||
public function addMessage($msg, $shortcode = 'info') {
|
||||
if(!is_array($msg)) {
|
||||
$msg = array($msg);
|
||||
}
|
||||
if($status == 'error') {
|
||||
$shortcode = 'important';
|
||||
} else {
|
||||
$shortcode = $status;
|
||||
switch($shortcode) {
|
||||
case 'error':
|
||||
$icon = 'exclamation-sign';
|
||||
break;
|
||||
case 'success':
|
||||
$icon = 'ok-sign';
|
||||
break;
|
||||
case 'warning':
|
||||
$icon = 'question-sign';
|
||||
break;
|
||||
default:
|
||||
$icon = 'info-sign';
|
||||
break;
|
||||
}
|
||||
|
||||
foreach($msg as $m) {
|
||||
$this->messages[] = array(
|
||||
'message' => $m,
|
||||
'status' => ($status == null) ? '' : strtoupper($status),
|
||||
'shortcode' => $shortcode,
|
||||
'icon' => $icon,
|
||||
);
|
||||
}
|
||||
return $this;
|
||||
|
|
|
@ -164,7 +164,7 @@ class ConfigController extends AbstractController {
|
|||
}
|
||||
}
|
||||
|
||||
$this->addMessage(psm_get_lang('config', 'updated'));
|
||||
$this->addMessage(psm_get_lang('config', 'updated'), 'success');
|
||||
|
||||
if($clean['language'] != psm_get_conf('language')) {
|
||||
header('Location: ' . $_SERVER['REQUEST_URI']);
|
||||
|
|
|
@ -136,7 +136,7 @@ class ServerController extends AbstractServerController {
|
|||
array('server_id' => $server_id)
|
||||
);
|
||||
if (empty($edit_server)) {
|
||||
$this->addMessage('Invalid server id');
|
||||
$this->addMessage('Invalid server id', 'error');
|
||||
return $this->initializeAction('index');
|
||||
}
|
||||
|
||||
|
@ -191,12 +191,12 @@ class ServerController extends AbstractServerController {
|
|||
$clean,
|
||||
array('server_id' => $server_id)
|
||||
);
|
||||
$this->addMessage(psm_get_lang('servers', 'updated'));
|
||||
$this->addMessage(psm_get_lang('servers', 'updated'), 'success');
|
||||
} else {
|
||||
// add
|
||||
$clean['status'] = 'on';
|
||||
$this->db->save(PSM_DB_PREFIX.'servers', $clean);
|
||||
$this->addMessage(psm_get_lang('servers', 'inserted'));
|
||||
$this->addMessage(psm_get_lang('servers', 'inserted'), 'success');
|
||||
}
|
||||
}
|
||||
$this->initializeAction('index');
|
||||
|
@ -210,13 +210,14 @@ class ServerController extends AbstractServerController {
|
|||
$id = intval($_GET['id']);
|
||||
// do delete
|
||||
$res = $this->db->delete(PSM_DB_PREFIX . 'servers', array('server_id' => $id));
|
||||
if($res->rowCount() == 1) {
|
||||
|
||||
if($res == 1) {
|
||||
$this->db->delete(PSM_DB_PREFIX.'log', array('server_id' => $id));
|
||||
$this->db->delete(PSM_DB_PREFIX.'users_servers', array('server_id' => $id));
|
||||
$this->db->delete(PSM_DB_PREFIX.'servers_uptime', array('server_id' => $id));
|
||||
$this->db->delete(PSM_DB_PREFIX.'servers_history', array('server_id' => $id));
|
||||
}
|
||||
$this->addMessage(psm_get_lang('system', 'deleted'));
|
||||
$this->addMessage(psm_get_lang('system', 'deleted'), 'success');
|
||||
}
|
||||
$this->initializeAction('index');
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<!--%tpl_login-->
|
||||
<div class="container">
|
||||
<form class="form-signin" method="post">
|
||||
<h2 class="form-signin-heading">{title_sign_in}</h2>
|
||||
<h3 class="form-signin-heading">{title_sign_in}</h3>
|
||||
<input type="text" name="user_name" class="input-block-level" placeholder="{label_username}" value="{value_user_name}" required>
|
||||
<input type="password" name="user_password" class="input-block-level" placeholder="{label_password}" required>
|
||||
<input type="hidden" name="action" value="login">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="user_rememberme" value="1" {value_rememberme}> {label_remember_me}
|
||||
</label>
|
||||
<button class="btn btn-large btn-primary" type="submit">{label_login}</button>
|
||||
<a class="btn btn-large" href="?action=forgot">{label_password_forgot}</a>
|
||||
<button class="btn btn-primary" type="submit">{label_login}</button>
|
||||
<a class="btn" href="?action=forgot">{label_password_forgot}</a>
|
||||
</form>
|
||||
</div>
|
||||
<!--%%tpl_login-->
|
||||
|
@ -17,10 +17,10 @@
|
|||
<!--%tpl_login_forgot-->
|
||||
<div class="container">
|
||||
<form class="form-signin" method="post">
|
||||
<h2 class="form-signin-heading">{title_forgot}</h2>
|
||||
<h3 class="form-signin-heading">{title_forgot}</h3>
|
||||
<input type="text" name="user_name" class="input-block-level" placeholder="{label_username}" value="{value_user_name}" required>
|
||||
<button class="btn btn-large btn-primary" type="submit">{label_submit}</button>
|
||||
<a class="btn btn-large" href="?">{label_go_back}</a>
|
||||
<button class="btn btn-primary" type="submit">{label_submit}</button>
|
||||
<a class="btn" href="?">{label_go_back}</a>
|
||||
</form>
|
||||
</div>
|
||||
<!--%%tpl_login_forgot-->
|
||||
|
@ -28,12 +28,12 @@
|
|||
<!--%tpl_login_reset-->
|
||||
<div class="container">
|
||||
<form class="form-signin" method="post">
|
||||
<h2 class="form-signin-heading">{title_reset}</h2>
|
||||
<h3 class="form-signin-heading">{title_reset}</h3>
|
||||
<input type="text" name="user_name" class="input-block-level" placeholder="{label_username}" value="{value_user_name}" required disabled="disabled">
|
||||
<input type="password" name="user_password_new" class="input-block-level" placeholder="{label_password}" required autocomplete="off">
|
||||
<input type="password" name="user_password_repeat" class="input-block-level" placeholder="{label_password_repeat}" required autocomplete="off">
|
||||
<button class="btn btn-large btn-primary" type="submit">{label_reset}</button>
|
||||
<a class="btn btn-large" href="?">{label_go_back}</a>
|
||||
<button class="btn btn-primary" type="submit">{label_reset}</button>
|
||||
<a class="btn" href="?">{label_go_back}</a>
|
||||
</form>
|
||||
</div>
|
||||
<!--%%tpl_login_reset-->
|
|
@ -51,10 +51,10 @@
|
|||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="flashmessage" class="alert alert-info hide">
|
||||
<div id="flashmessage" class="hide">
|
||||
<!--%tpl_repeat_messages-->
|
||||
<div>
|
||||
<p class="pull-left span1"><span class="label label-{shortcode}">{status}</span></p>
|
||||
<div class="alert alert-{shortcode}">
|
||||
<p class="pull-left span1"><i class="icon-{icon}"></i></p>
|
||||
<p>{message}</p>
|
||||
</div>
|
||||
<!--%%tpl_repeat_messages-->
|
||||
|
|
|
@ -10,7 +10,7 @@ body {
|
|||
.navbar-fixed-top .navbar-inner {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
body.install{
|
||||
padding-top:20px;
|
||||
}
|
||||
|
@ -82,4 +82,10 @@ legend{
|
|||
line-height: 18px;
|
||||
color: #333333;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#flashmessage {
|
||||
max-width: 350px;
|
||||
margin: auto;
|
||||
margin-bottom: 18px;
|
||||
}
|
|
@ -8,7 +8,7 @@ function sm_delete(id, mod) {
|
|||
|
||||
function psm_tooltips() {
|
||||
$('input[data-toggle="tooltip"]').tooltip({
|
||||
'trigger':'focus',
|
||||
'trigger':'hover',
|
||||
'placement': 'right',
|
||||
'container': 'body'
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue