diff --git a/swad_changelog.h b/swad_changelog.h index 4c0b2226f..339d44230 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -111,12 +111,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.45 (2015/11/24)" +#define Log_PLATFORM_VERSION "SWAD 15.45 (2015/11/25)" // 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 /* - Version 15.45: Nov 24, 2015 Changes in layout of top of page. (187894 lines) + Version 15.45: Nov 25, 2015 Changes in layout of page (some tables used with layout purposes are replaced by CSS). (187877 lines) Version 15.44.8: Nov 24, 2015 Code refactoring in layout. (187895 lines) Version 15.44.7: Nov 24, 2015 Code refactoring in layout. (187901 lines) Version 15.44.6: Nov 24, 2015 Code refactoring in layout. (187893 lines) diff --git a/swad_layout.c b/swad_layout.c index fc6e2ab8b..b5d3402a5 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -118,7 +118,6 @@ void Lay_WriteStartOfPage (void) "BLUE_BACKGROUND", // The_THEME_BLUE "YELLOW_BACKGROUND", // The_THEME_YELLOW }; - unsigned ColspanCentralPart = 3; // Initialized to avoid warnning /***** If, when this function is called, the head is being written or the head is already written ==> don't do anything *****/ @@ -268,36 +267,43 @@ void Lay_WriteStartOfPage (void) "", Gbl.Prefs.IconsURL); - /***** Header of layout *****/ - fprintf (Gbl.F.Out,"", + /***** Start of box that contains the whole page except the foot *****/ + fprintf (Gbl.F.Out,"
", ClassBackground[Gbl.Prefs.Theme]); + + /***** Header of layout *****/ switch (Gbl.Prefs.Layout) { case Lay_LAYOUT_DESKTOP: Lay_WritePageTopHeadingDesktop (); - if (Gbl.Prefs.SideCols == Lay_SHOW_BOTH_COLUMNS) - ColspanCentralPart = 1; // 11: both side columns visible, left and right - else if (Gbl.Prefs.SideCols == Lay_HIDE_BOTH_COLUMNS) - ColspanCentralPart = 3; // 00: both side columns hidden - else - ColspanCentralPart = 2; // 10 or 01: only one side column visible, left or right break; case Lay_LAYOUT_MOBILE: Lay_WritePageTopHeadingMobile (); - ColspanCentralPart = 3; break; default: break; } - fprintf (Gbl.F.Out,"
" - "" - "
" + /***** Main zone *****/ + fprintf (Gbl.F.Out,"
"); + + /* Left column */ + if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) + if (Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) // Left column visible + { + fprintf (Gbl.F.Out,"
"); + Lay_ShowLeftColumn (); + fprintf (Gbl.F.Out,"
"); + } + + /* Central (main) part */ + fprintf (Gbl.F.Out,"
" "
" "" "", - ColspanCentralPart, The_TabOnBgColors[Gbl.Prefs.Theme]); - - /***** Central (main) part *****/ switch (Gbl.Prefs.Layout) { case Lay_LAYOUT_DESKTOP: @@ -330,7 +336,6 @@ void Lay_WriteStartOfPage (void) break; } - /***** Main zone *****/ /* Start of main zone for actions output */ fprintf (Gbl.F.Out,"" "
"); @@ -393,9 +398,20 @@ static void Lay_WriteEndOfPage (void) fprintf (Gbl.F.Out,"
" "
" - "
\n"); + ""); + + /* Right column */ + if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) + if (Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN) // Right column visible + { + fprintf (Gbl.F.Out,"
"); + Lay_ShowRightColumn (); + fprintf (Gbl.F.Out,"
"); + } + + /***** End of box that contains the whole page except the foot *****/ + fprintf (Gbl.F.Out,"\n"); } } @@ -709,11 +725,14 @@ static void Lay_WritePageTopHeadingDesktop (void) }; /***** 1st. row *****/ + /* Start of 1st. row */ + fprintf (Gbl.F.Out,"
", + ClassHeadRow1[Gbl.Prefs.Theme]); + /* 1st. row, 2nd. column: logo */ - fprintf (Gbl.F.Out,"" - "" - "
" - "
" + fprintf (Gbl.F.Out,"
" "" "\"%s\"" "" "
", - ClassHeadRow1[Gbl.Prefs.Theme], The_ClassHead[Gbl.Prefs.Theme], Cfg_PLATFORM_LOGO_DESKTOP_WIDTH, Cfg_HTTPS_URL_SWAD_CGI, @@ -731,7 +749,8 @@ static void Lay_WritePageTopHeadingDesktop (void) Cfg_PLATFORM_LOGO_DESKTOP_HEIGHT); /* 1st. row, 1st. column: search */ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); Act_FormStart ( Gbl.CurrentCrs.Crs.CrsCod > 0 ? ActCrsSch : (Gbl.CurrentDeg.Deg.DegCod > 0 ? ActDegSch : (Gbl.CurrentCtr.Ctr.CtrCod > 0 ? ActCtrSch : @@ -744,7 +763,8 @@ static void Lay_WritePageTopHeadingDesktop (void) fprintf (Gbl.F.Out,"
"); /* 1st. row, 3rd. column: logged user or language selection */ - fprintf (Gbl.F.Out,"
", + fprintf (Gbl.F.Out,"
", The_ClassHead[Gbl.Prefs.Theme]); if (Gbl.Usrs.Me.Logged) Usr_WriteLoggedUsrHead (); @@ -753,39 +773,44 @@ static void Lay_WritePageTopHeadingDesktop (void) fprintf (Gbl.F.Out,"
"); /* 1st. row, 4th. column: link to open/close session */ - fprintf (Gbl.F.Out,"
", + fprintf (Gbl.F.Out,"
", The_ClassHead[Gbl.Prefs.Theme]); if (Gbl.Usrs.Me.Logged) Usr_PutFormLogOut (); else Usr_PutFormLogIn (); - fprintf (Gbl.F.Out,"
" - "
" - "" - ""); + fprintf (Gbl.F.Out,"
"); + + /* Start of 1st. row */ + fprintf (Gbl.F.Out,"
"); /***** 2nd. row *****/ + /* Start of second row */ + fprintf (Gbl.F.Out,"
"); + /* 2nd. row, 1st. column Clock with hour:minute (server hour is shown) */ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"
"); Dat_ShowClientLocalTime (); - fprintf (Gbl.F.Out,""); // End of first column + fprintf (Gbl.F.Out,"
"); // End of first column /* 2nd. row, 2nd. column: degree and course */ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"
" "
"); Deg_WriteCtyInsCtrDeg (); Crs_WriteSelectorMyCourses (); Deg_WriteBigNameCtyInsCtrDegCrs (); fprintf (Gbl.F.Out,"
" - ""); + "
"); /* 2nd. row, 3rd. column */ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"
"); if (Gbl.Usrs.Me.Logged) { /* Number of new messages (not seen) */ @@ -794,42 +819,15 @@ static void Lay_WritePageTopHeadingDesktop (void) Ntf_WriteNumberOfNewNtfs (); fprintf (Gbl.F.Out,"
"); // Used for AJAX based refresh } - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"
"); + + /* End of 2nd. row */ + fprintf (Gbl.F.Out,"
"); /***** 3rd. row *****/ - fprintf (Gbl.F.Out,""); - - /* 3rd. row, 1st. column */ - if (Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) // Left column visible - fprintf (Gbl.F.Out,"" - ""); - - /* 3rd. row, 2nd. column */ + fprintf (Gbl.F.Out,"
"); Tab_DrawTabs (); - - /* 3rd. row, 3rd. column */ - if (Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN) // Right column visible - { - fprintf (Gbl.F.Out,""); - Lay_ShowRightColumn (); - fprintf (Gbl.F.Out,""); - } - - fprintf (Gbl.F.Out,""); - - /***** 4th. row *****/ - fprintf (Gbl.F.Out,""); - - /* 4th. row, 1st. column */ - if (Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) // Left column visible - { - fprintf (Gbl.F.Out,""); - Lay_ShowLeftColumn (); - fprintf (Gbl.F.Out,""); - } + fprintf (Gbl.F.Out,"
"); } static void Lay_WritePageTopHeadingMobile (void) @@ -843,17 +841,21 @@ static void Lay_WritePageTopHeadingMobile (void) "YELLOW_HEAD_ROW_1", // The_THEME_YELLOW }; - /***** 1st. row, 1st. column: logo *****/ - fprintf (Gbl.F.Out,"" - "" + /***** 1st. row *****/ + /* Start of 1st. row */ + fprintf (Gbl.F.Out,"
", + ClassHeadRow1[Gbl.Prefs.Theme]); + + /* 1st. row, 1st. column: logo */ + fprintf (Gbl.F.Out,"
" "" "\"%s\"" "" - "", - ClassHeadRow1[Gbl.Prefs.Theme], + "
", Cfg_PLATFORM_LOGO_MOBILE_WIDTH, Cfg_HTTPS_URL_SWAD_CGI, Gbl.Prefs.IconsURL,Cfg_PLATFORM_LOGO_MOBILE_FILE, @@ -861,46 +863,41 @@ static void Lay_WritePageTopHeadingMobile (void) Cfg_PLATFORM_LOGO_MOBILE_WIDTH, Cfg_PLATFORM_LOGO_MOBILE_HEIGHT); - /***** 1st. row, 2nd. column: - logged user / language selection *****/ - fprintf (Gbl.F.Out,"" - "" - "" - "" - "" - "
", + /* 1st. row, 2nd. column: + logged user / language selection */ + fprintf (Gbl.F.Out,"
", The_ClassHead[Gbl.Prefs.Theme]); if (Gbl.Usrs.Me.Logged) Usr_WriteLoggedUsrHead (); else Pre_PutSelectorToSelectLanguage (); - fprintf (Gbl.F.Out,"
" - ""); + fprintf (Gbl.F.Out,"
"); - /***** 1st. row, 3rd. column: link to open/close session *****/ - fprintf (Gbl.F.Out,"", + /* 1st. row, 3rd. column: link to open/close session */ + fprintf (Gbl.F.Out,"
", The_ClassHead[Gbl.Prefs.Theme]); if (Gbl.Usrs.Me.Logged) Usr_PutFormLogOut (); else Usr_PutFormLogIn (); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"
"); + + /* End of 1st. row */ + fprintf (Gbl.F.Out,"
"); /***** 2nd. row *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"
"); Deg_WriteCtyInsCtrDeg (); Crs_WriteSelectorMyCourses (); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"
"); /***** 3rd. row *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"
"); Tab_DrawTabs (); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -1002,8 +999,7 @@ static void Lay_ShowRightColumn (void) fprintf (Gbl.F.Out,"" "" "
" - ""); + "
"); /***** Banners *****/ Ban_WriteMenuWithBanners (); diff --git a/swad_tab.c b/swad_tab.c index 950a1fe6d..cb5762bd4 100644 --- a/swad_tab.c +++ b/swad_tab.c @@ -81,19 +81,9 @@ static void Tab_WriteBreadcrumbAction (void); void Tab_DrawTabs (void) { - unsigned ColspanCentralPart = 3; - - if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) - { - if (Gbl.Prefs.SideCols == Lay_SHOW_BOTH_COLUMNS) // 11: both side columns visible, left and right - ColspanCentralPart = 1; - else if (Gbl.Prefs.SideCols != Lay_HIDE_BOTH_COLUMNS) // 10 or 01: only one side column visible, left or right - ColspanCentralPart = 2; - } - fprintf (Gbl.F.Out,""); + ""); } /*****************************************************************************/
" - "
", - ColspanCentralPart); + fprintf (Gbl.F.Out,"
" + "
"); switch (Gbl.Prefs.Layout) { case Lay_LAYOUT_DESKTOP: @@ -106,7 +96,7 @@ void Tab_DrawTabs (void) break; } fprintf (Gbl.F.Out,"
" - "