diff --git a/swad_changelog.h b/swad_changelog.h index d7c9aac59..90fc3f0d9 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -238,13 +238,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.252.2 (2017-09-10)" +#define Log_PLATFORM_VERSION "SWAD 16.252.3 (2017-09-11)" #define CSS_FILE "swad16.252.2.css" #define JS_FILE "swad16.206.3.js" // 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 16.252.3: Sep 11, 2017 HTML optimization in icons. (226822 lines) Version 16.252.2: Sep 10, 2017 Code refactoring in edition of syllabus. (226819 lines) Version 16.252.1: Sep 09, 2017 Icons to move up and down questions in a game. (226864 lines) Version 16.252: Sep 08, 2017 Icons to move up and down questions in a game. (226852 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index f8ddbdd1d..b2e3f67d1 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -5509,11 +5509,9 @@ static void Brw_PutIconRemoveFile (const char PathInTree[PATH_MAX + 1], PathInTree,FileName, Gbl.FileBrowser.FileType,-1L); sprintf (Gbl.Title,Txt_Remove_FILE_OR_LINK_X,FileNameToShow); - fprintf (Gbl.F.Out,"
" - "" - "
", + " class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO20x20\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); @@ -5544,11 +5542,9 @@ static void Brw_PutIconRemoveDir (const char PathInTree[PATH_MAX + 1], PathInTree,FileName, Brw_IS_FOLDER,-1L); sprintf (Gbl.Title,Txt_Remove_folder_X,FileNameToShow); - fprintf (Gbl.F.Out,"
" - "" - "
", + " class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO20x20\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); diff --git a/swad_game.c b/swad_game.c index 6a6da11ca..00f686210 100644 --- a/swad_game.c +++ b/swad_game.c @@ -2805,7 +2805,7 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Game *Game, NULL); } else - Ico_PutIconWithText ("up_off16x16.gif",Txt_Movement_not_allowed,NULL); + Ico_PutIcon ("up_off16x16.gif",Txt_Movement_not_allowed); /* Write icon to move down the question */ if (NumQst + 1 < NumQsts) @@ -2817,7 +2817,7 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Game *Game, NULL); } else - Ico_PutIconWithText ("down_off16x16.gif",Txt_Movement_not_allowed,NULL); + Ico_PutIcon ("down_off16x16.gif",Txt_Movement_not_allowed); /* Write icon to edit the question */ Gbl.Test.QstCod = QstCod; diff --git a/swad_icon.c b/swad_icon.c index 4be68625e..ed8d75890 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -250,10 +250,24 @@ void Ico_PutIconLink (const char *Icon,const char *Title,const char *Text, const char *LinkStyle,const char *OnSubmit) { Act_LinkFormSubmit (Title,LinkStyle,OnSubmit); - Ico_PutIconWithText (Icon,Title,Text); + if (Text) + Ico_PutIconWithText (Icon,Title,Text); + else + Ico_PutIcon (Icon,Title); fprintf (Gbl.F.Out,""); } +/*****************************************************************************/ +/********************** Put a icon to submit a form **************************/ +/*****************************************************************************/ + +void Ico_PutIcon (const char *Icon,const char *Alt) + { + fprintf (Gbl.F.Out,"\"%s\"", + Gbl.Prefs.IconsURL,Icon,Alt,Alt); + } + /*****************************************************************************/ /**************** Put a icon with a text to submit a form ********************/ /*****************************************************************************/ @@ -264,8 +278,8 @@ void Ico_PutIconWithText (const char *Icon,const char *Alt,const char *Text) fprintf (Gbl.F.Out,"
" "\"%s\"", - Gbl.Prefs.IconsURL,Icon, - Alt,Text ? Text : Alt); + Gbl.Prefs.IconsURL,Icon,Alt,Text ? Text : + Alt); if (Text) if (Text[0]) fprintf (Gbl.F.Out," %s",Text); @@ -323,7 +337,7 @@ void Ico_PutIconRemovalNotAllowed (void) { extern const char *Txt_Removal_not_allowed; - Ico_PutIconWithText ("remove-off64x64.png",Txt_Removal_not_allowed,NULL); + Ico_PutIcon ("remove-off64x64.png",Txt_Removal_not_allowed); } /*****************************************************************************/ diff --git a/swad_icon.h b/swad_icon.h index c11d013c3..96a65be77 100644 --- a/swad_icon.h +++ b/swad_icon.h @@ -62,6 +62,7 @@ void Ico_PutContextualIconToPrint (Act_Action_t NextAction,void (*FuncParams) () void Ico_PutIconLink (const char *Icon,const char *Title,const char *Text, const char *LinkStyle,const char *OnSubmit); +void Ico_PutIcon (const char *Icon,const char *Alt); void Ico_PutIconWithText (const char *Icon,const char *Alt,const char *Text); void Ico_PutCalculateIcon (const char *Alt); diff --git a/swad_message.c b/swad_message.c index 0a61413f1..8dcea61ef 100644 --- a/swad_message.c +++ b/swad_message.c @@ -3264,17 +3264,12 @@ static void Msg_WriteFormToReply (long MsgCod,long CrsCod, Par_PutHiddenParamChar ("ShowOnlyOneRecipient",'Y'); /****** Link and form end *****/ - Act_LinkFormSubmit (FromThisCrs ? (Replied ? Txt_Reply_again : - Txt_Reply) : - (Replied ? Txt_Go_to_course_and_reply_again : - Txt_Go_to_course_and_reply), - The_ClassFormBold[Gbl.Prefs.Theme],NULL); - Ico_PutIconWithText ("reply16x16.gif", - Replied ? Txt_Reply_again : - Txt_Reply, - NULL); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); + Ico_PutIconLink ("reply16x16.gif", + FromThisCrs ? (Replied ? Txt_Reply_again : + Txt_Reply) : + (Replied ? Txt_Go_to_course_and_reply_again : + Txt_Go_to_course_and_reply), + NULL,NULL,NULL); } /*****************************************************************************/ diff --git a/swad_syllabus.c b/swad_syllabus.c index cd3535c57..be323acd3 100644 --- a/swad_syllabus.c +++ b/swad_syllabus.c @@ -634,7 +634,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem, NULL); } else - Ico_PutIconWithText ("up_off16x16.gif",Txt_Movement_not_allowed,NULL); + Ico_PutIcon ("up_off16x16.gif",Txt_Movement_not_allowed); fprintf (Gbl.F.Out,""); /***** Icon to get down item *****/ @@ -654,7 +654,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem, NULL); } else - Ico_PutIconWithText ("down_off16x16.gif",Txt_Movement_not_allowed,NULL); + Ico_PutIcon ("down_off16x16.gif",Txt_Movement_not_allowed); fprintf (Gbl.F.Out,""); /***** Icon to increase the level of an item *****/ @@ -670,7 +670,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem, NULL); } else - Ico_PutIconWithText ("left_off16x16.gif",Txt_Movement_not_allowed,NULL); + Ico_PutIcon ("left_off16x16.gif",Txt_Movement_not_allowed); fprintf (Gbl.F.Out,""); /***** Icon to decrease level item *****/ @@ -687,7 +687,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem, NULL); } else - Ico_PutIconWithText ("right_off16x16.gif",Txt_Movement_not_allowed,NULL); + Ico_PutIcon ("right_off16x16.gif",Txt_Movement_not_allowed); fprintf (Gbl.F.Out,""); LastLevel = Level; diff --git a/swad_test_import.c b/swad_test_import.c index d272d968a..0aaa95626 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -265,9 +265,7 @@ void TsI_CreateXML (unsigned long NumRows,MYSQL_RES *mysql_res) Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP, Gbl.FileBrowser.TmpPubDir, The_ClassFormBold[Gbl.Prefs.Theme]); - Ico_PutIconWithText ("file64x64.gif", - Txt_XML_file, - Txt_XML_file); + Ico_PutIconWithText ("file64x64.gif",Txt_XML_file,Txt_XML_file); fprintf (Gbl.F.Out,""); }