Subversion Repositories wimsdev

Rev

Rev 15509 | Rev 15519 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15509 Rev 15518
Line 787... Line 787...
787
}
787
}
788
 
788
 
789
/* define the variable $wims_html_header */
789
/* define the variable $wims_html_header */
790
void define_html_header(void)
790
void define_html_header(void)
791
{
791
{
792
  char *sp, *cp, *ladirection, *mp, *s2;
792
  char *sp, *cp, *ladirection, *mp, *s2, *wversion;
793
  char buf[MAX_LINELEN+1];
793
  char buf[MAX_LINELEN+1];
794
  int buf_length = 0;
794
  int buf_length = 0;
795
  int noc;
795
  int noc;
796
  noc=0;
796
  noc=0;
797
  cp=getvar("wims_expire"); if(cp!=NULL) goto css;
797
  cp=getvar("wims_expire"); if(cp!=NULL) goto css;
Line 818... Line 818...
818
  if (strcmp(ladirection,"ltr")==0) ladirection="";
818
  if (strcmp(ladirection,"ltr")==0) ladirection="";
819
 
819
 
820
  if(!robot_access && cp!=NULL && *cp!=0 && strstr(cp,"---")==NULL) {
820
  if(!robot_access && cp!=NULL && *cp!=0 && strstr(cp,"---")==NULL) {
821
    char *nbuf;
821
    char *nbuf;
822
    cp=find_word_start(cp);
822
    cp=find_word_start(cp);
-
 
823
 
823
    if(strchr(cp,'/')==NULL) {
824
    if(strchr(cp,'/')==NULL) {
824
      char *pc, *th, *ti; int class_style=0;
825
      char *pc, *th, *ti; int class_style=0;
825
      pc=getvar("wims_class");
826
      pc=getvar("wims_class");
-
 
827
      wversion=getvar("wims_version");
-
 
828
      if(wversion==NULL || *wversion==0) wversion="0.0";
826
 
829
 
827
      /* When a class choose its own css instead of theme css */
830
      /* When a class choose its own css instead of theme css */
828
      if(pc!=NULL && *pc!=0 && strcmp(cp,"class")==0) {
831
      if(pc!=NULL && *pc!=0 && strcmp(cp,"class")==0) {
829
        nbuf=mkfname(NULL,"%s/%s/css",class_base,pc);
832
        nbuf=mkfname(NULL,"%s/%s/css",class_base,pc);
830
        th=getvar("class_theme");ti=getvar("class_theme_icon") ;
833
        th=getvar("class_theme");ti=getvar("class_theme_icon") ;
Line 847... Line 850...
847
          if(th==NULL || *th==0) th="standard";
850
          if(th==NULL || *th==0) th="standard";
848
          nbuf=mkfname(NULL,"html/themes/%s/css.css",th);
851
          nbuf=mkfname(NULL,"html/themes/%s/css.css",th);
849
 
852
 
850
          // Check if theme css file exists (use access from unistd.h)
853
          // Check if theme css file exists (use access from unistd.h)
851
          if( access( nbuf, F_OK ) != -1 ) {
854
          if( access( nbuf, F_OK ) != -1 ) {
852
            buf_length = snprintf(buf,sizeof(buf),"<link href=\"%s\" rel=\"stylesheet\" />",nbuf);
855
            buf_length = snprintf(buf,sizeof(buf),"<link href=\"%s?ver=%s\" rel=\"stylesheet\" />", nbuf, wversion);
853
          }
856
          }
854
        }
857
        }
855
      }
858
      }
856
      /* icon theme */
859
      /* icon theme */
857
      ti=getvar("wims_theme_icon");
860
      ti=getvar("wims_theme_icon");
858
      if(ti==NULL || *ti==0) ti="default";
861
      if(ti==NULL || *ti==0) ti="default";
859
      snprintf(buf+buf_length,sizeof(buf)-buf_length,"<link href=\"gifs/themes/%s/icon-min.css\" rel=\"stylesheet\" />",ti);
862
      snprintf(buf+buf_length,sizeof(buf)-buf_length,"<link href=\"gifs/themes/%s/icon-min.css?ver=%s\" rel=\"stylesheet\" />", ti, wversion);
860
 
863
 
861
      setvar("wims_CSS",buf);
864
      setvar("wims_CSS",buf);
862
 
865
 
863
      /* case of theme */
866
      /* case of theme */
864
      if (th) {
867
      if (th) {