Version 15.50

This commit is contained in:
Antonio Cañas Vargas 2015-11-30 01:13:00 +01:00
parent 7ccd9ff5b0
commit 3fb649cfc2
7 changed files with 301 additions and 280 deletions

View File

@ -21,11 +21,8 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not,see <http://www.gnu.org/licenses/>. along with this program. If not,see <http://www.gnu.org/licenses/>.
*/ */
a:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:active {text-decoration:none;}
a:hover {text-decoration:underline;}
/********************************* Body **************************************/
body body
{ {
margin:0; margin:0;
@ -33,9 +30,19 @@ body
font-family:"Helvetica Neue",Helvetica,Arial,sans-serif; font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size:1em; font-size:1em;
} }
input {font-size:12pt; vertical-align:middle;} input
select {font-size:12pt;} {
textarea {font-size:12pt;} font-size:12pt;
vertical-align:middle;
}
select
{
font-size:12pt;
}
textarea
{
font-size:12pt;
}
table table
{ {
box-sizing:border-box; box-sizing:border-box;
@ -71,6 +78,13 @@ hr.GREY_SEPARA {height:0; border-top:0; border-bottom:#707070 dotted 1px;}
hr.BLUE_SEPARA {height:0; border-top:0; border-bottom:#4D88A1 dotted 1px;} hr.BLUE_SEPARA {height:0; border-top:0; border-bottom:#4D88A1 dotted 1px;}
hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
/*********************** Text decoration of links ****************************/
a:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:active {text-decoration:none;}
a:hover {text-decoration:underline;}
.MENU_LIST_ITEM a:hover {text-decoration:none;}
/****************** Layout (the whole page with a background) ****************/ /****************** Layout (the whole page with a background) ****************/
#whole_page_white #whole_page_white
{ {
@ -153,7 +167,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
text-align:left; text-align:left;
vertical-align:middle; vertical-align:middle;
} }
@media only screen and (max-width: 1279px) { /* For mobile phones and tablets */ @media only screen and (max-width: 1279px)
{ /* For mobile phones and tablets */
#head_search_text #head_search_text
{ {
display:none; display:none;
@ -200,7 +215,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
.GREY_CUR_TIME {color:#E0E0E0; font-size:14pt; font-weight:bold;} .GREY_CUR_TIME {color:#E0E0E0; font-size:14pt; font-weight:bold;}
.BLUE_CUR_TIME {color:#BAD2DA; font-size:14pt; font-weight:bold;} .BLUE_CUR_TIME {color:#BAD2DA; font-size:14pt; font-weight:bold;}
.YELLOW_CUR_TIME {color:#B3B0B3; font-size:14pt; font-weight:bold;} .YELLOW_CUR_TIME {color:#B3B0B3; font-size:14pt; font-weight:bold;}
@media only screen and (max-width: 1023px) { /* For mobile phones */ @media only screen and (max-width: 1023px)
{ /* For mobile phones */
#current_date #current_date
{ {
display:none; display:none;
@ -210,7 +226,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
display:none; display:none;
} }
} }
@media only screen and (min-width: 1024px) and (max-width: 1279px) { /* For tablets */ @media only screen and (min-width: 1024px) and (max-width: 1279px)
{ /* For tablets */
#current_date #current_date
{ {
display:none; display:none;
@ -239,7 +256,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
vertical-align:top; vertical-align:top;
padding-top:10px; padding-top:10px;
} }
@media only screen and (max-width: 1023px) { /* For mobile phones */ @media only screen and (max-width: 1023px)
{ /* For mobile phones */
#notif_all #notif_all
{ {
display:none; display:none;
@ -249,7 +267,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
display:none; display:none;
} }
} }
@media only screen and (min-width: 1024px) and (max-width: 1279px) { /* For tablets */ @media only screen and (min-width: 1024px) and (max-width: 1279px)
{ /* For tablets */
#notif_all #notif_all
{ {
display:none; display:none;
@ -399,7 +418,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
width:148px; width:148px;
} }
@media only screen and (max-width: 1279px) { /* For mobile phones and tablets */ @media only screen and (max-width: 1279px)
{ /* For mobile phones and tablets */
#main_zone_central_none, #main_zone_central_left, #main_zone_central_right, #main_zone_central_both #main_zone_central_none, #main_zone_central_left, #main_zone_central_right, #main_zone_central_both
{ {
display:table-cell; display:table-cell;
@ -415,7 +435,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
display:none; display:none;
} }
} }
@media only screen and (min-width: 1280px) { /* For desktop */ @media only screen and (min-width: 1280px)
{ /* For desktop */
#main_zone_central_none /* Hide left and right columns */ #main_zone_central_none /* Hide left and right columns */
{ {
display:table-cell; display:table-cell;
@ -462,6 +483,22 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
} }
} }
@media only screen and (max-width: 1023px)
{ /* For mobile-phones */
#main_zone_central_container
{
box-sizing:border-box;
margin:-8px 0 0 0;
padding:8px 0;
border-radius:6px;
box-shadow:inset -2px -2px 1px 0 rgba(50,50,50,0.2);
text-align:center;
vertical-align:top;
position:relative;
}
}
@media only screen and (min-width: 1024px)
{ /* For tablets and desktop */
#main_zone_central_container #main_zone_central_container
{ {
box-sizing:border-box; box-sizing:border-box;
@ -475,144 +512,179 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
vertical-align:top; vertical-align:top;
position:relative; position:relative;
} }
}
/***************************** Horizontal menu *******************************/ /************* Main central zone with horizontal menu and canvas *************/
#menu_horizontal #main_horizontal
{ {
box-sizing:border-box; box-sizing:border-box;
width:100%; width:100%;
} }
#menu_horizontal .MENU_BOX #main_horizontal .MENU_LIST
{ {
box-sizing:border-box;
width:100%; width:100%;
height:64px;
padding:8px 16px;
margin:0 auto;
} }
#menu_horizontal .MAIN_ZONE_CANVAS /* Where content for each action is written */ #main_horizontal ul
{
box-sizing:border-box;
width:100%;
padding:8px 16px;
text-align:left;
vertical-align:top;
}
#menu_horizontal .MENU_LIST
{ {
display:table; display:table;
list-style-type:none; box-sizing:border-box;
height:76px;
margin:0 auto; margin:0 auto;
padding:0; padding:8px 16px;
list-style-type:none;
} }
#menu_horizontal .MENU_LIST_ITEM #main_horizontal .MENU_LIST_ITEM
{ {
display:table-cell; display:table-cell;
box-sizing:border-box; width:120px;
width:138px; height:60px;
}
.MENU_LIST_ITEM a:hover
{
text-decoration:none;
}
#menu_horizontal .OPTION
{
box-sizing:border-box;
text-align:center;
margin:0 auto; margin:0 auto;
padding:32px 2px 2px 2px; text-align:center;
background-size:32px 32px; vertical-align:middle;
background-repeat:no-repeat;
background-position:center top;
overflow:hidden;
} }
#menu_horizontal .OPTION_NOT_SELECTED #main_horizontal .MENU_OPT_OFF
{ {
opacity:0.67; opacity:0.67;
} }
#menu_horizontal .OPTION_NOT_SELECTED:hover, #menu_horizontal .OPTION_SELECTED #main_horizontal .MENU_OPT_OFF:hover, #main_horizontal .MENU_OPT_ON
{ {
opacity:1; opacity:1;
transform:scale(1.2,1.2); transform:scale(1.2,1.2);
} }
#main_horizontal .MENU_ICON
{
box-sizing:border-box;
padding:32px 0 0 0;
background-size:32px 32px;
background-repeat:no-repeat;
background-position:center top;
}
#main_horizontal .MAIN_ZONE_CANVAS /* Where content for each action is written */
{
box-sizing:border-box;
width:100%;
padding:8px 16px;
margin:0 auto;
text-align:left;
vertical-align:top;
}
/******************************* Vertical menu *******************************/ /************** Main central zone with vertical menu and canvas **************/
#menu_vertical @media only screen and (max-width: 1023px)
{ /* For mobile phones */
/* Mobile phone will display menu always in horizontal
so the CSS must draw menu really in horizontal */
#main_vertical
{
box-sizing:border-box;
width:100%;
}
#main_vertical .MENU_LIST
{
width:100%;
}
#main_vertical ul
{
display:table;
box-sizing:border-box;
height:76px;
margin:0 auto;
padding:8px 16px;
list-style-type:none;
}
#main_vertical .MENU_LIST_ITEM
{
display:table-cell;
width:120px;
height:60px;
margin:0 auto;
text-align:center;
vertical-align:middle;
}
#main_vertical .MENU_OPT_OFF
{
opacity:0.67;
}
#main_vertical .MENU_OPT_OFF:hover, #main_vertical .MENU_OPT_ON
{
opacity:1;
transform:scale(1.2,1.2);
}
#main_vertical .MENU_ICON
{
box-sizing:border-box;
padding:32px 0 0 0;
background-size:32px 32px;
background-repeat:no-repeat;
background-position:center top;
}
#main_vertical .MAIN_ZONE_CANVAS /* Where content for each action is written */
{
box-sizing:border-box;
width:100%;
padding:8px 16px;
margin:0 auto;
text-align:left;
vertical-align:top;
}
#action_title /* Do not display action title */
{
display:none;
}
}
@media only screen and (min-width: 1024px)
{ /* For tablets and desktop */
#main_vertical
{ {
display:table; display:table;
box-sizing:border-box; box-sizing:border-box;
width:100%; width:100%;
margin:0 auto;
} }
a:hover #menu_vertical.MENU_LIST_ITEM #main_vertical .MENU_LIST
{
text-decoration:none;
}
#menu_vertical .MENU_BOX
{ {
display:table-cell; display:table-cell;
box-sizing:border-box; box-sizing:border-box;
width:180px; width:180px;
padding-left:8px;
text-align:left;
vertical-align:top;
overflow:hidden;
} }
#menu_vertical .MAIN_ZONE_CANVAS /* Where content for each action is written */ #main_vertical ul
{
display:table;
margin:0;
padding-left:8px;
list-style-type:none;
}
#main_vertical .MENU_LIST_ITEM
{
text-align:left;
}
#main_vertical .MENU_OPT_OFF
{
opacity:0.67;
}
#main_vertical .MENU_OPT_OFF:hover, #main_vertical .MENU_OPT_ON
{
opacity:1;
}
#main_vertical .MENU_ICON
{
display:table-cell;
height:42px;
vertical-align:middle;
padding:2px 2px 2px 50px;
background-size:40px 40px;
background-repeat:no-repeat;
background-position:2px 2px;
}
#main_vertical .MAIN_ZONE_CANVAS /* Where content for each action is written */
{ {
display:table-cell; display:table-cell;
box-sizing:border-box; box-sizing:border-box;
padding:8px 16px; padding:8px 16px;
margin:0 auto;
text-align:left; text-align:left;
vertical-align:top; vertical-align:top;
} }
#menu_vertical .MENU_LIST
{
display:table;
list-style-type:none;
margin:0;
padding:0;
}
#menu_vertical MENU_LIST_ITEM
{
display:block;
}
#menu_vertical .OPTION
{
display:table-cell;
vertical-align:middle;
height:40px;
clear:both;
margin:0 auto;
padding:2px 2px 2px 50px;
text-align:left;
vertical-align:middle;
background-size:40px 40px;
background-repeat:no-repeat;
background-position:2px 2px;
overflow:hidden;
}
#menu_vertical .OPTION_NOT_SELECTED
{
opacity:0.67;
}
#menu_vertical .OPTION_NOT_SELECTED:hover, #menu_vertical .OPTION_SELECTED
{
opacity:1;
}
/********************************* Menu fonts ********************************/
.WHITE_MENU_OFF {color:#4D88A1; font-size:12pt; font-weight:bold; line-height:110%;}
.GREY_MENU_OFF {color:#707070; font-size:12pt; font-weight:bold; line-height:110%;}
.BLUE_MENU_OFF {color:#4D88A1; font-size:12pt; font-weight:bold; line-height:110%;}
.YELLOW_MENU_OFF {color:#BD4815; font-size:12pt; font-weight:bold; line-height:110%;}
.WHITE_MENU_ON {color:#4D88A1; font-size:12pt; font-weight:bold; line-height:110%;}
.GREY_MENU_ON {color:#606060; font-size:12pt; font-weight:bold; line-height:110%;}
.BLUE_MENU_ON {color:#4D88A1; font-size:12pt; font-weight:bold; line-height:110%;}
.YELLOW_MENU_ON {color:#BD4815; font-size:12pt; font-weight:bold; line-height:110%;}
/****************** Title of current action in main block ********************/
#action_title #action_title
{ {
box-sizing:border-box; box-sizing:border-box;
@ -627,7 +699,37 @@ a:hover #menu_vertical.MENU_LIST_ITEM
padding:4px 12px 12px 70px; padding:4px 12px 12px 70px;
overflow:hidden; overflow:hidden;
} }
}
/********************************* Menu fonts ********************************/
@media only screen and (max-width: 799px)
{ /* For mobile-phones */
.MENU_TEXT
{
display:none;
}
}
@media only screen and (min-width: 800px)
{ /* For tablets and desktop */
.MENU_TEXT
{
font-size:12pt;
font-weight:bold;
line-height:110%;
}
}
.WHITE_MENU_OFF {color:#4D88A1;}
.GREY_MENU_OFF {color:#707070;}
.BLUE_MENU_OFF {color:#4D88A1;}
.YELLOW_MENU_OFF {color:#BD4815;}
.WHITE_MENU_ON {color:#4D88A1;}
.GREY_MENU_ON {color:#606060;}
.BLUE_MENU_ON {color:#4D88A1;}
.YELLOW_MENU_ON {color:#BD4815;}
/****************** Title of current action in main block ********************/
.WHITE_TITLE_ACTION {color:#606060; font-size:20pt;} .WHITE_TITLE_ACTION {color:#606060; font-size:20pt;}
.GREY_TITLE_ACTION {color:#606060; font-size:20pt;} .GREY_TITLE_ACTION {color:#606060; font-size:20pt;}
.BLUE_TITLE_ACTION {color:#4D88A1; font-size:20pt;} .BLUE_TITLE_ACTION {color:#4D88A1; font-size:20pt;}

View File

@ -117,11 +117,13 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.49.4 (2015/11/29)" #define Log_PLATFORM_VERSION "SWAD 15.50 (2015/11/30)"
// Number of lines (includes comments but not blank lines) has been got with the following command: // Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.50: Nov 30, 2015 Changes in layout of menus.
Responsive design in menu: when screen is small, horizontal menu is drawn. (186514 lines)
Version 15.49.4: Nov 29, 2015 Changes in layout of menus. (186481 lines) Version 15.49.4: Nov 29, 2015 Changes in layout of menus. (186481 lines)
Version 15.49.3: Nov 29, 2015 Changes in layout of menus. (186502 lines) Version 15.49.3: Nov 29, 2015 Changes in layout of menus. (186502 lines)
Version 15.49.2: Nov 29, 2015 Changes in layout of menus. (186501 lines) Version 15.49.2: Nov 29, 2015 Changes in layout of menus. (186501 lines)

View File

@ -111,6 +111,11 @@ void Lay_WriteStartOfPage (void)
"whole_page_blue", // The_THEME_BLUE "whole_page_blue", // The_THEME_BLUE
"whole_page_yellow", // The_THEME_YELLOW "whole_page_yellow", // The_THEME_YELLOW
}; };
const char *LayoutMainZone[Mnu_NUM_MENUS] =
{
"main_horizontal", // Mnu_MENU_HORIZONTAL
"main_vertical", // Mnu_MENU_VERTICAL
};
/***** If, when this function is called, the head is being written /***** If, when this function is called, the head is being written
or the head is already written ==> don't do anything *****/ or the head is already written ==> don't do anything *****/
@ -298,14 +303,14 @@ void Lay_WriteStartOfPage (void)
} }
fprintf (Gbl.F.Out,"<div id=\"main_zone_central_container\" class=\"%s\">", fprintf (Gbl.F.Out,"<div id=\"main_zone_central_container\" class=\"%s\">",
The_TabOnBgColors[Gbl.Prefs.Theme]); The_TabOnBgColors[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"<div id=\"%s\">",
Gbl.Prefs.Menu == Mnu_MENU_VERTICAL ? "menu_vertical" : /* Layout with horizontal or vertical menu */
"menu_horizontal"); fprintf (Gbl.F.Out,"<div id=\"%s\">",LayoutMainZone[Gbl.Prefs.Menu]);
/* Menu */ /* Menu */
Mnu_WriteMenuThisTab (); Mnu_WriteMenuThisTab ();
/* Start of main zone for actions output */ /* Start of canvas: main zone for actions output */
fprintf (Gbl.F.Out,"<div class=\"MAIN_ZONE_CANVAS\">"); fprintf (Gbl.F.Out,"<div class=\"MAIN_ZONE_CANVAS\">");
/* Write warning when degree type does not allow direct login */ /* Write warning when degree type does not allow direct login */
@ -349,8 +354,8 @@ static void Lay_WriteEndOfPage (void)
if (!Gbl.Layout.DivsEndWritten) if (!Gbl.Layout.DivsEndWritten)
{ {
/***** End of central part of main zone *****/ /***** End of central part of main zone *****/
fprintf (Gbl.F.Out,"</div>" // main_zone_canvas fprintf (Gbl.F.Out,"</div>" // Canvas (main zone to output content of the current action)
"</div>" // menu_horizontal or menu_vertical "</div>" // Layout with horizontal or vertical menu
"</div>"); // main_zone_central_container "</div>"); // main_zone_central_container
/***** Write page footer *****/ /***** Write page footer *****/

View File

@ -72,8 +72,8 @@ const char *Mnu_MenuIcons[Mnu_NUM_MENUS] =
void Mnu_WriteMenuThisTab (void) void Mnu_WriteMenuThisTab (void)
{ {
extern const char *The_ClassMenuOn[The_NUM_THEMES]; extern const char *The_ClassTxtMenuOn[The_NUM_THEMES];
extern const char *The_ClassMenuOff[The_NUM_THEMES]; extern const char *The_ClassTxtMenuOff[The_NUM_THEMES];
extern const struct Act_Menu Act_Menu[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; extern const struct Act_Menu Act_Menu[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
unsigned NumOptInMenu; unsigned NumOptInMenu;
@ -82,8 +82,8 @@ void Mnu_WriteMenuThisTab (void)
bool IsTheSelectedAction; bool IsTheSelectedAction;
/***** Menu start *****/ /***** Menu start *****/
fprintf (Gbl.F.Out,"<div class=\"MENU_BOX\">" fprintf (Gbl.F.Out,"<div class=\"MENU_LIST\">"
"<ul class=\"MENU_LIST\">"); "<ul>");
/***** Loop to write all options in menu. Each row holds an option *****/ /***** Loop to write all options in menu. Each row holds an option *****/
for (NumOptInMenu = 0; for (NumOptInMenu = 0;
@ -104,30 +104,30 @@ void Mnu_WriteMenuThisTab (void)
/***** Start of container used to highlight this option *****/ /***** Start of container used to highlight this option *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">", fprintf (Gbl.F.Out,"<div class=\"%s\">",
IsTheSelectedAction ? "OPTION_SELECTED" : IsTheSelectedAction ? "MENU_OPT_ON" :
"OPTION_NOT_SELECTED"); "MENU_OPT_OFF");
/***** Start of form and link *****/ /***** Start of form and link *****/
Act_FormStart (NumAct); Act_FormStart (NumAct);
Act_LinkFormSubmit (Title,NULL); Act_LinkFormSubmit (Title,NULL);
/***** Icon *****/ /***** Icon *****/
fprintf (Gbl.F.Out,"<div class=\"OPTION\"" fprintf (Gbl.F.Out,"<div class=\"MENU_ICON\""
" style=\"background-image:url('%s/%s/%s64x64.gif');\">", " style=\"background-image:url('%s/%s/%s64x64.gif');\">",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
Act_Actions[NumAct].Icon); Act_Actions[NumAct].Icon);
/***** Text *****/ /***** Text *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">%s", fprintf (Gbl.F.Out,"<div class=\"MENU_TEXT %s\">"
IsTheSelectedAction ? The_ClassMenuOn[Gbl.Prefs.Theme] : "%s"
The_ClassMenuOff[Gbl.Prefs.Theme], "</div>",
IsTheSelectedAction ? The_ClassTxtMenuOn[Gbl.Prefs.Theme] :
The_ClassTxtMenuOff[Gbl.Prefs.Theme],
Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu]); Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu]);
/***** End of link and form *****/ /***** End of link and form *****/
fprintf (Gbl.F.Out,"</div>" fprintf (Gbl.F.Out,"</div>"
"</div>"
"</a>"); "</a>");
Act_FormEnd (); Act_FormEnd ();
/***** End of container used to highlight this option *****/ /***** End of container used to highlight this option *****/
@ -143,93 +143,6 @@ void Mnu_WriteMenuThisTab (void)
"</div>"); "</div>");
} }
/*****************************************************************************/
/******************* Write vertical menu of current tab **********************/
/*****************************************************************************/
void Mnu_WriteVerticalMenuThisTab (void)
{
extern const char *The_ClassMenuOn[The_NUM_THEMES];
extern const char *The_ClassMenuOff[The_NUM_THEMES];
// extern const char *The_ClassSeparator[The_NUM_THEMES];
extern const struct Act_Menu Act_Menu[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
unsigned NumOptInMenu;
Act_Action_t NumAct;
const char *Title;
bool IsTheSelectedAction;
// bool SeparationBetweenPreviousAndCurrentOption = false;
// bool PreviousVisibleOptions = false;
/***** Loop to write all options in menu. Each row holds an option *****/
for (NumOptInMenu = 0;
NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB;
NumOptInMenu++)
{
NumAct = Act_Menu[Gbl.CurrentTab][NumOptInMenu].Action;
if (NumAct == 0) // At the end of each tab, actions are initialized to 0, so 0 marks the end of the menu
break;
if (Act_CheckIfIHavePermissionToExecuteAction (NumAct))
{
IsTheSelectedAction = (NumAct == Act_Actions[Gbl.CurrentAct].SuperAction);
Title = Act_GetSubtitleAction (NumAct);
/*
if (SeparationBetweenPreviousAndCurrentOption)
{
if (PreviousVisibleOptions)
fprintf (Gbl.F.Out,"<li>"
"<hr class=\"%s\" />"
"</li>",
The_ClassSeparator[Gbl.Prefs.Theme]);
SeparationBetweenPreviousAndCurrentOption = false;
}
*/
/***** Start of element *****/
fprintf (Gbl.F.Out,"<li>");
/***** Start of container used to highlight this option *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">",
IsTheSelectedAction ? "OPTION_SELECTED" :
"OPTION_NOT_SELECTED");
/***** Start of form and link *****/
Act_FormStart (NumAct);
Act_LinkFormSubmit (Title,NULL);
/***** Icon *****/
fprintf (Gbl.F.Out,"<div class=\"OPTION\""
" style=\"background-image:url('%s/%s/%s64x64.gif');\">",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
Act_Actions[NumAct].Icon);
/***** Text *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">%s",
IsTheSelectedAction ? The_ClassMenuOn[Gbl.Prefs.Theme] :
The_ClassMenuOff[Gbl.Prefs.Theme],
Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu]);
/***** End of link and form *****/
fprintf (Gbl.F.Out,"</div>"
"</div>"
"</a>");
Act_FormEnd ();
/***** End of container used to highlight this option *****/
fprintf (Gbl.F.Out,"</div>");
/***** End of element *****/
fprintf (Gbl.F.Out,"</li>");
// PreviousVisibleOptions = true;
}
// if (!SeparationBetweenPreviousAndCurrentOption)
// SeparationBetweenPreviousAndCurrentOption = Act_Menu[Gbl.CurrentTab][NumOptInMenu].SubsequentSeparation;
}
}
/*****************************************************************************/ /*****************************************************************************/
/************* Put icons to select menu (horizontal or vertical) *************/ /************* Put icons to select menu (horizontal or vertical) *************/
/*****************************************************************************/ /*****************************************************************************/
@ -302,5 +215,5 @@ Mnu_Menu_t Mnu_GetParamMenu (void)
if (UnsignedNum < Mnu_NUM_MENUS) if (UnsignedNum < Mnu_NUM_MENUS)
return (Mnu_Menu_t) UnsignedNum; return (Mnu_Menu_t) UnsignedNum;
return Mnu_MENU_UNKNOWN; return Mnu_MENU_DEFAULT;
} }

View File

@ -37,11 +37,11 @@
/******************************* Public types ********************************/ /******************************* Public types ********************************/
/*****************************************************************************/ /*****************************************************************************/
#define Mnu_NUM_MENUS 2
typedef enum typedef enum
{ {
Mnu_MENU_HORIZONTAL = 0, Mnu_MENU_HORIZONTAL = 0,
Mnu_MENU_VERTICAL = 1, Mnu_MENU_VERTICAL = 1,
Mnu_MENU_UNKNOWN = 2,
} Mnu_Menu_t; // Stored in database. Don't change numbers! } Mnu_Menu_t; // Stored in database. Don't change numbers!
#define Mnu_MENU_DEFAULT Mnu_MENU_HORIZONTAL #define Mnu_MENU_DEFAULT Mnu_MENU_HORIZONTAL
@ -50,7 +50,6 @@ typedef enum
/*****************************************************************************/ /*****************************************************************************/
void Mnu_WriteMenuThisTab (void); void Mnu_WriteMenuThisTab (void);
void Mnu_WriteVerticalMenuThisTab (void);
void Mnu_PutIconsToSelectMenu (void); void Mnu_PutIconsToSelectMenu (void);
void Mnu_ChangeMenu (void); void Mnu_ChangeMenu (void);

View File

@ -80,8 +80,8 @@ static void Tab_WriteBreadcrumbAction (void);
void Tab_DrawTabs (void) void Tab_DrawTabs (void)
{ {
extern const char *The_ClassTabOn[The_NUM_THEMES]; extern const char *The_ClassTxtTabOn[The_NUM_THEMES];
extern const char *The_ClassTabOff[The_NUM_THEMES]; extern const char *The_ClassTxtTabOff[The_NUM_THEMES];
extern const char *The_TabOnBgColors[The_NUM_THEMES]; extern const char *The_TabOnBgColors[The_NUM_THEMES];
extern const char *The_TabOffBgColors[The_NUM_THEMES]; extern const char *The_TabOffBgColors[The_NUM_THEMES];
extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS]; extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS];
@ -123,8 +123,8 @@ void Tab_DrawTabs (void)
Act_FormStart (ActMnu); Act_FormStart (ActMnu);
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) NumTab); Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) NumTab);
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[NumTab], Act_LinkFormSubmit (Txt_TABS_FULL_TXT[NumTab],
NumTab == Gbl.CurrentTab ? The_ClassTabOn[Gbl.Prefs.Theme] : NumTab == Gbl.CurrentTab ? The_ClassTxtTabOn[Gbl.Prefs.Theme] :
The_ClassTabOff[Gbl.Prefs.Theme]); The_ClassTxtTabOff[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s64x64.gif\"" fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s64x64.gif\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICON32x32\" style=\"margin:3px;\" />" " class=\"ICON32x32\" style=\"margin:3px;\" />"
@ -147,7 +147,7 @@ void Tab_DrawTabs (void)
Tab_TabIcons[NumTab], Tab_TabIcons[NumTab],
Txt_TABS_FULL_TXT[NumTab], Txt_TABS_FULL_TXT[NumTab],
Txt_TABS_FULL_TXT[NumTab], Txt_TABS_FULL_TXT[NumTab],
The_ClassTabOff[Gbl.Prefs.Theme], The_ClassTxtTabOff[Gbl.Prefs.Theme],
Txt_TABS_SHORT_TXT[NumTab]); Txt_TABS_SHORT_TXT[NumTab]);
fprintf (Gbl.F.Out,"</div>" fprintf (Gbl.F.Out,"</div>"
@ -198,7 +198,7 @@ static bool Tab_CheckIfICanViewTab (Act_Tab_t Tab)
void Tab_DrawBreadcrumb (void) void Tab_DrawBreadcrumb (void)
{ {
extern const char *The_TabOnBgColors[The_NUM_THEMES]; extern const char *The_TabOnBgColors[The_NUM_THEMES];
extern const char *The_ClassTabOn[The_NUM_THEMES]; extern const char *The_ClassTxtTabOn[The_NUM_THEMES];
fprintf (Gbl.F.Out,"<div id=\"breadcrumb_container\" class=\"%s\">", fprintf (Gbl.F.Out,"<div id=\"breadcrumb_container\" class=\"%s\">",
The_TabOnBgColors[Gbl.Prefs.Theme]); The_TabOnBgColors[Gbl.Prefs.Theme]);
@ -211,14 +211,14 @@ void Tab_DrawBreadcrumb (void)
{ {
/***** Tab *****/ /***** Tab *****/
fprintf (Gbl.F.Out,"<span class=\"%s\"> &gt; </span>", fprintf (Gbl.F.Out,"<span class=\"%s\"> &gt; </span>",
The_ClassTabOn[Gbl.Prefs.Theme]); The_ClassTxtTabOn[Gbl.Prefs.Theme]);
Tab_WriteBreadcrumbTab (); Tab_WriteBreadcrumbTab ();
if (Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0) if (Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0)
{ {
/***** Menu *****/ /***** Menu *****/
fprintf (Gbl.F.Out,"<span class=\"%s\"> &gt; </span>", fprintf (Gbl.F.Out,"<span class=\"%s\"> &gt; </span>",
The_ClassTabOn[Gbl.Prefs.Theme]); The_ClassTxtTabOn[Gbl.Prefs.Theme]);
Tab_WriteBreadcrumbAction (); Tab_WriteBreadcrumbAction ();
} }
} }
@ -232,11 +232,11 @@ void Tab_DrawBreadcrumb (void)
static void Tab_WriteBreadcrumbHome (void) static void Tab_WriteBreadcrumbHome (void)
{ {
extern const char *The_ClassTabOn[The_NUM_THEMES]; extern const char *The_ClassTxtTabOn[The_NUM_THEMES];
extern const char *Txt_Home_PAGE; extern const char *Txt_Home_PAGE;
Act_FormStart (ActHom); Act_FormStart (ActHom);
Act_LinkFormSubmit (Txt_Home_PAGE,The_ClassTabOn[Gbl.Prefs.Theme]); Act_LinkFormSubmit (Txt_Home_PAGE,The_ClassTxtTabOn[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s</a>", fprintf (Gbl.F.Out,"%s</a>",
Txt_Home_PAGE); Txt_Home_PAGE);
Act_FormEnd (); Act_FormEnd ();
@ -248,13 +248,13 @@ static void Tab_WriteBreadcrumbHome (void)
static void Tab_WriteBreadcrumbTab (void) static void Tab_WriteBreadcrumbTab (void)
{ {
extern const char *The_ClassTabOn[The_NUM_THEMES]; extern const char *The_ClassTxtTabOn[The_NUM_THEMES];
extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS]; extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS];
/***** Start form *****/ /***** Start form *****/
Act_FormStart (ActMnu); Act_FormStart (ActMnu);
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) Gbl.CurrentTab); Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) Gbl.CurrentTab);
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.CurrentTab],The_ClassTabOn[Gbl.Prefs.Theme]); Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.CurrentTab],The_ClassTxtTabOn[Gbl.Prefs.Theme]);
/***** Title and end of form *****/ /***** Title and end of form *****/
fprintf (Gbl.F.Out,"%s</a>", fprintf (Gbl.F.Out,"%s</a>",
@ -268,12 +268,12 @@ static void Tab_WriteBreadcrumbTab (void)
static void Tab_WriteBreadcrumbAction (void) static void Tab_WriteBreadcrumbAction (void)
{ {
extern const char *The_ClassTabOn[The_NUM_THEMES]; extern const char *The_ClassTxtTabOn[The_NUM_THEMES];
const char *Title = Act_GetTitleAction (Gbl.CurrentAct); const char *Title = Act_GetTitleAction (Gbl.CurrentAct);
/***** Start form *****/ /***** Start form *****/
Act_FormStart (Act_Actions[Gbl.CurrentAct].SuperAction); Act_FormStart (Act_Actions[Gbl.CurrentAct].SuperAction);
Act_LinkFormSubmit (Title,The_ClassTabOn[Gbl.Prefs.Theme]); Act_LinkFormSubmit (Title,The_ClassTxtTabOn[Gbl.Prefs.Theme]);
/***** Title and end of form *****/ /***** Title and end of form *****/
fprintf (Gbl.F.Out,"%s</a>", fprintf (Gbl.F.Out,"%s</a>",

View File

@ -143,7 +143,7 @@ const char *The_ClassConnected[The_NUM_THEMES] =
"YELLOW_CONNECTED", "YELLOW_CONNECTED",
}; };
const char *The_ClassMenuOff[The_NUM_THEMES] = const char *The_ClassTxtMenuOff[The_NUM_THEMES] =
{ {
"WHITE_MENU_OFF", "WHITE_MENU_OFF",
"GREY_MENU_OFF", "GREY_MENU_OFF",
@ -151,7 +151,7 @@ const char *The_ClassMenuOff[The_NUM_THEMES] =
"YELLOW_MENU_OFF", "YELLOW_MENU_OFF",
}; };
const char *The_ClassMenuOn[The_NUM_THEMES] = const char *The_ClassTxtMenuOn[The_NUM_THEMES] =
{ {
"WHITE_MENU_ON", "WHITE_MENU_ON",
"GREY_MENU_ON", "GREY_MENU_ON",
@ -159,7 +159,7 @@ const char *The_ClassMenuOn[The_NUM_THEMES] =
"YELLOW_MENU_ON", "YELLOW_MENU_ON",
}; };
const char *The_ClassTabOff[The_NUM_THEMES] = const char *The_ClassTxtTabOff[The_NUM_THEMES] =
{ {
"WHITE_TAB_OFF", "WHITE_TAB_OFF",
"GREY_TAB_OFF", "GREY_TAB_OFF",
@ -167,7 +167,7 @@ const char *The_ClassTabOff[The_NUM_THEMES] =
"YELLOW_TAB_OFF", "YELLOW_TAB_OFF",
}; };
const char *The_ClassTabOn[The_NUM_THEMES] = const char *The_ClassTxtTabOn[The_NUM_THEMES] =
{ {
"WHITE_TAB_ON", "WHITE_TAB_ON",
"GREY_TAB_ON", "GREY_TAB_ON",