2014-05-21 Sergio Martin <sergio.martin@artica.es>

* general/main_menu.php
	godmode/setup/setup_visuals.php
	include/styles/pandora.css
	include/functions_config.php: Added autohidden menu
	feature



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9977 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2014-05-21 10:44:36 +00:00
parent f565589bdb
commit 3ece0e681b
5 changed files with 75 additions and 9 deletions

View File

@ -1,3 +1,11 @@
2014-05-21 Sergio Martin <sergio.martin@artica.es>
* general/main_menu.php
godmode/setup/setup_visuals.php
include/styles/pandora.css
include/functions_config.php: Added autohidden menu
feature
2014-05-21 Vanessa Gil <vanessa.gil@artica.es>
* images/dot_blue.png

View File

@ -20,8 +20,18 @@ if (! isset ($config["id_user"])) {
exit ();
}
$autohidden_menu = 0;
if (isset ($config["autohidden_menu"]) && $config["autohidden_menu"]) {
$autohidden_menu = 1;
}
if ($autohidden_menu) {
$menu_container_id = 'menu_container';
}
// Menu container prepared to autohide menu
echo '<div id="menu_container_old">';
echo '<div id="' . $menu_container_id . '">';
echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
require ("operation/menu.php");
@ -49,6 +59,9 @@ ui_require_jquery_file ('cookie');
?>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
var autohidden_menu = <?php echo $autohidden_menu; ?>;
$(document).ready( function() {
$("img.toggle").click (function () {
$(this).siblings ("ul").toggle ();
@ -63,13 +76,13 @@ $(document).ready( function() {
function handlerIn() {
handsIn = 1;
if(openTime == 0) {
$('#menu_container').animate({"left": "+=140px"}, 200);
show_menu();
openTime = new Date().getTime();
// Close in 1 second if is not closed manually
setTimeout(function() {
if(openTime > 0 && handsIn == 0) {
$('#menu_container').animate({"left": "-=140px"}, 100);
hide_menu();
openTime = 0;
}
}, 1000);
@ -81,10 +94,41 @@ $(document).ready( function() {
var openedTime = new Date().getTime() - openTime;
if(openedTime > 1000) {
$('#menu_container').animate({"left": "-=140px"}, 100);
hide_menu();
openTime = 0;
}
}
function show_menu () {
$('#menu_container').animate({"left": "+=140px"}, 200);
show_menu_pretty();
}
function show_menu_pretty() {
$('div.menu ul li').css('background-position', '');
$('ul.submenu li a, li.menu_icon a, li.links a').css('visibility', '');
$('.titop').css('color', 'white');
$('.bg3').css('color', 'white');
$('.bg4').css('color', 'white');
}
function hide_menu () {
$('#menu_container').animate({"left": "-=140px"}, 100);
hide_menu_pretty();
}
function hide_menu_pretty() {
$('div.menu li').css('background-position', '140px 3px');
$('ul.submenu li a, li.menu_icon a, li.links a').css('visibility', 'hidden');
$('.titop').css('color', $('.titop').css('background-color'));
$('.bg3').css('color', $('.bg3').css('background-color'));
$('.bg4').css('color', $('.bg4').css('background-color'));
}
if (autohidden_menu) {
$('#main').css('margin-left', '40px');
hide_menu_pretty();
}
});
/* ]]> */
</script>

View File

@ -302,6 +302,11 @@ $table->data[$row][1] = html_print_select($arraySelectIcon, "gis_default_icon",
$row++;
// For 5.1 Autohidden menu feature
$table->data['autohidden'][0] = __('Autohidden menu');
$table->data['autohidden'][1] = html_print_checkbox('autohidden_menu', 1, $config['autohidden_menu'], true);
// Juanma (07/05/2014) New feature: Table for custom front page for reports
$table->data[$row][0] = __('Custom report front page') . ui_print_help_tip(__('Custom report front page. It will be applied to all reports and templates by default.'), true);
@ -480,7 +485,6 @@ $(document).ready (function () {
// Juanma (06/05/2014) New feature: Custom front page for reports
var custom_report = $('#checkbox-custom_report_front').prop('checked');
console.log(custom_report);
display_custom_report_front(custom_report);
$("#checkbox-custom_report_front").click( function() {

View File

@ -424,7 +424,9 @@ function config_update_config () {
$error_update[] = __('GIS Labels');
if (!config_update_value ('gis_default_icon', get_parameter ('gis_default_icon')))
$error_update[] = __('Default icon in GIS');
if (!config_update_value ('autohidden_menu', get_parameter('autohidden_menu')))
$error_update[] = __('Autohidden menu');
$interval_values = get_parameter ('interval_values');
// Add new interval value if is provided
@ -1149,6 +1151,10 @@ function config_process_config () {
config_update_value ('custom_report_front_footer', '');
}
if (!isset($config['autohidden_menu'])) {
config_update_value ('autohidden_menu', 0);
}
/* Finally, check if any value was overwritten in a form */
config_update_config();
}

View File

@ -265,6 +265,12 @@ div#main_help div.databox p{
text-align: justify;
}
div#menu_container {
-moz-border-top-right-radius: 6px;
-webkit-border-top-right-radius: 6px;
border-top-right-radius: 6px;
}
div#menu {
width: 165px;
float: left;
@ -2095,10 +2101,7 @@ div#main {
padding-left: 0px;
padding-top: 0px;
padding-bottom: 20px;
/*CLASSIC STYLE*/
margin-left: 182px;
/*AUTOHIDDEN MENU*/
/*margin-left: 40px;*/
margin-right: 20px;
background: #ECECEC;
min-width: 720px;
@ -2892,6 +2895,7 @@ td.empty_field {
margin: 0px !important;
bottom: 0px;
left: 0px;
z-index: 1000;
}
#shortcut_bar {