Skip to content

Commit

Permalink
Users: Remove "Customizing" panel. Is not database/server related. No…
Browse files Browse the repository at this point in the history
…w user "Customizing" screen is opened from footer button and is visible on all screens.

Crowdin footer button with % of localization. Crowdin project created and all current resource files is uploaded. Need community help to cover all translations. Now easily can be added new translations.
  • Loading branch information
dumitru committed Nov 28, 2015
1 parent a5bec2d commit af17278
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 123 deletions.
2 changes: 1 addition & 1 deletion assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ body {
}

.margin-left-10px {
margin-left: 10px
margin-left: 10px !important;
}
3 changes: 2 additions & 1 deletion inc/session.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ function initialize_session()
's_users_panels' => array(array('usr_user', $ptitle_strings['usr_user'], 'open'),
array('usr_role', $ptitle_strings['usr_role'], 'close'),
// array('usr_grant',$ptitle_strings['usr_grant'],'close')),
array('usr_cust', $ptitle_strings['usr_cust'], 'close'), ),
//array('usr_cust', $ptitle_strings['usr_cust'], 'close'),
),
// panels on the Admin page
's_admin_panels' => array(array('adm_server',$ptitle_strings['adm_server'],'open'),
array('adm_dbstat',$ptitle_strings['adm_dbstat'],'close'),
Expand Down
44 changes: 0 additions & 44 deletions panels/usr_cust.php

This file was deleted.

41 changes: 41 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
require('./inc/script_start.inc.php');

if (isset($_POST['usr_cust_save'])) {

$old_settings = $s_cust;

$s_cust['language'] = get_request_data('usr_cust_language');
$s_cust['askdel'] = get_request_data('usr_cust_askdel') == $usr_strings['Yes'] ? 1 : 0;

$settings_changed = true;
}

// reset the customizing values to the configuration defaults
if (isset($_POST['usr_cust_defaults'])) {

$old_settings = $s_cust;
$s_cust = get_customize_defaults($s_useragent);

$settings_changed = true;
}

if ($settings_changed = true && isset($old_settings)) {

if ($old_settings['language'] != $s_cust['language']) {

include('./lang/' . $s_cust['language'] . '.inc.php');
fix_language($s_cust['language']);
}

set_customize_cookie($s_cust);

// force reloading of the stylesheet
$s_stylesheet_etag = '';
}

require('./inc/script_end.inc.php');

header("Location: " . $_SERVER["HTTP_REFERER"]);

?>
41 changes: 0 additions & 41 deletions user.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,47 +156,6 @@
unset($s_confirmations[$_POST['confirm_subject']]);
}


//
// customizing
//
if (have_panel_permissions($s_login['user'], 'usr_cust')) {

if (isset($_POST['usr_cust_save'])) {

$old_settings = $s_cust;

$s_cust['language'] = get_request_data('usr_cust_language');
$s_cust['askdel'] = get_request_data('usr_cust_askdel') == $usr_strings['Yes'] ? 1 : 0;

$settings_changed = true;
}

// reset the customizing values to the configuration defaults
if (isset($_POST['usr_cust_defaults'])) {

$old_settings = $s_cust;
$s_cust = get_customize_defaults($s_useragent);

$settings_changed = true;
}

if ($settings_changed = true && isset($old_settings)) {

if ($old_settings['language'] != $s_cust['language']) {

include('./lang/' . $s_cust['language'] . '.inc.php');
fix_language($s_cust['language']);
}

set_customize_cookie($s_cust);

// force reloading of the stylesheet
$s_stylesheet_etag = '';
}
}


//
// print out all the panels
//
Expand Down
139 changes: 103 additions & 36 deletions views/footer.php
Original file line number Diff line number Diff line change
@@ -1,57 +1,124 @@
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<table>
<tr>
<td>
<p class="text-muted"><?=date('Y')?> - <a href="https://github.com/mariuz/firebirdwebadmin">FirebirdWebAdmin</a> <?php echo VERSION; ?></p>
</td>
<?php
if (DEBUG === true) {
echo "<td width=\"30%\">&nbsp;</td><td><div align=\"left\">\n";
<div class="container">
<table>
<tr>
<td>
<p class="text-muted">
<?= date('Y') ?>
-
<a href="https://github.com/mariuz/firebirdwebadmin">FirebirdWebAdmin</a>
<?php echo VERSION; ?>

show_time_consumption($start_time, microtime());
<button type="button" class="btn btn-default btn-xs margin-left-10px" data-toggle="modal"
data-target="#userSettings">
<span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
<?php echo $ptitle_strings["usr_cust"]; ?>
</button>

// echo 'cookie size: '.strlen($_COOKIE[get_customize_cookie_name()])."<br>\n";
// debug_var($_COOKIE[get_customize_cookie_name()]);
<a class="margin-left-10px" target="_blank" href="https://crowdin.com/project/firebirdwebadmin"><img src="https://d322cqt584bo4o.cloudfront.net/firebirdwebadmin/localized.svg"></a>
</p>
</td>
<?php
if (DEBUG === true) {
echo "<td width=\"20%\">&nbsp;</td><td><div align=\"left\">\n";

// display links to display the session, post or get variables
$session_url = url_session('./inc/display_variable.php?var=SESSION');
echo '<a href="'.$session_url.'" target="_blank">[ Session ]</a>'."\n";
show_time_consumption($start_time, microtime());

$post_url = url_session('./inc/display_variable.php?var=POST');
echo '<a href="'.$post_url.'" target="_blank">[ POST ]</a>'."\n";
// echo 'cookie size: '.strlen($_COOKIE[get_customize_cookie_name()])."<br>\n";
// debug_var($_COOKIE[get_customize_cookie_name()]);

$get_url = url_session('./inc/display_variable.php?var=GET');
echo '<a href="'.$get_url.'" target="_blank">[ GET ]</a>'."\n";
// display links to display the session, post or get variables
$session_url = url_session('./inc/display_variable.php?var=SESSION');
echo '<a href="' . $session_url . '" target="_blank">[ Session ]</a>' . "\n";

$kill_url = url_session('./inc/kill_session.php');
echo '<a href="'.$kill_url.'">[ kill session ]</a>'."\n";
$post_url = url_session('./inc/display_variable.php?var=POST');
echo '<a href="' . $post_url . '" target="_blank">[ POST ]</a>' . "\n";

// Save the contents of $_POST and $_GET in session
$s_POST = $_POST;
$s_GET = $_GET;
$get_url = url_session('./inc/display_variable.php?var=GET');
echo '<a href="' . $get_url . '" target="_blank">[ GET ]</a>' . "\n";

echo "</div>\n</td>";
}
?>
</tr>
</table>
</div>
$kill_url = url_session('./inc/kill_session.php');
echo '<a href="' . $kill_url . '">[ kill session ]</a>' . "\n";

// Save the contents of $_POST and $_GET in session
$s_POST = $_POST;
$s_GET = $_GET;

echo "</div>\n</td>";
}
?>
</tr>
</table>
</div>

<!-- User Settings Modal -->
<div class="modal fade" id="userSettings" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form method="post" action="settings.php" name="usr_cust_save"
class="form-horizontal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel"><?php echo $ptitle_strings["usr_cust"]; ?></h4>
</div>
<div class="modal-body">

<?php if (empty($_COOKIE)):
echo '<div class="alert alert-danger" role="alert">' . $MESSAGES['COOKIES_NEEDED'] . "</div>";
else: ?>
<div class="form-group margin-left-10px">
<h4><?php echo $usr_strings['Appearance']; ?></h4>
</div>
<div class="form-group margin-left-10px">
<label for="usr_cust_language"
class="col-sm-4 control-label"><?php echo $usr_strings['Language']; ?></label>

<div class="col-sm-5">
<?php echo get_selectlist('usr_cust_language', get_customize_languages(), $s_cust['language']); ?>
</div>
</div>
<div class="form-group margin-left-10px">
<h4><?php echo $usr_strings['Attitude']; ?></h4>
</div>
<div class="form-group margin-left-10px">
<label for="usr_cust_askdel"
class="col-sm-4 control-label"><?php echo $usr_strings['AskDel']; ?></label>

<div class="col-sm-5">
<?php echo get_selectlist('usr_cust_askdel', array($usr_strings['Yes'], $usr_strings['No']), ($s_cust['askdel'] == 1 ? $usr_strings['Yes'] : $usr_strings['No'])); ?>
</div>
</div>
<?php endif; ?>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" name="usr_cust_save"
value="<?php echo $button_strings['Save']; ?>">
<input type="submit" class="btn btn-default" name="usr_cust_defaults"
value="<?php echo $button_strings['Defaults']; ?>">
<button type="button" class="btn btn-default"
data-dismiss="modal"><?php echo $ptitle_strings["Close"]; ?></button>

</div>
</form>
</div>
</div>
</div>
</footer>
<!--Scripts-->
<script src="https://code.jquery.com/jquery.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<script src="./js/miscellaneous.js" type="text/javascript"></script>
<?= js_global_variables()
.js_xml_http_request_client()
.js_request_close_panel()
.$js_stack
<?= js_global_variables()
. js_xml_http_request_client()
. js_request_close_panel()
. $js_stack
?>
</body>
</html>

0 comments on commit af17278

Please sign in to comment.