616
617
618
619
620
621
622
623
624
625
626
627
628
629
|
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
** Return the default menu
*/
const char *style_default_mainmenu(void){
return zDfltMainMenu;
}
/*
** Main menu setting value overridden by the server/ui/cgi --mainmenu
** CLI flag or the "mainmenu:" CGI wrapper script config option.
*/
static const char * zOverrideMainMenu = 0;
/*
** Sets the contents of the given filename (of type ExtFILE) to
** override the "mainmenu" site config setting. Returns 0 on success,
** non-0 if the file cannot be stat'd.
*/
int style_default_mainmenu_override(const char *zFilename){
if(file_size(zFilename, ExtFILE)<0){
return 1;
}else{
Blob content = empty_blob;
blob_read_from_file(&content, zFilename, ExtFILE);
zOverrideMainMenu = blob_str(&content);
return 0;
}
}
/*
** Given a URL path, extract the first element as a "feature" name,
** used as the <body class="FEATURE"> value by default, though
** later-running code may override this, typically to group multiple
** Fossil UI URLs into a single "feature" so you can have per-feature
** CSS rules.
|
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
|
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
|
+
+
-
+
|
if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath);
Th_Store("current_page", local_zCurrentPage);
Th_Store("csrf_token", g.zCsrfToken);
Th_Store("release_version", RELEASE_VERSION);
Th_Store("manifest_version", MANIFEST_VERSION);
Th_Store("manifest_date", MANIFEST_DATE);
Th_Store("compiler_name", COMPILER_NAME);
Th_Store("mainmenu", zOverrideMainMenu
? zOverrideMainMenu
Th_Store("mainmenu", db_get("mainmenu", style_default_mainmenu()));
: db_get("mainmenu", style_default_mainmenu()));
url_var("stylesheet", "css", "style.css");
image_url_var("logo");
image_url_var("background");
if( !login_is_nobody() ){
Th_Store("login", g.zLogin);
}
Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) );
|