/* ** Copyright (c) 2014 D. Richard Hipp ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the Simplified BSD License (also ** known as the "2-Clause License" or "FreeBSD License".) ** This program is distributed in the hope that it will be useful, ** but without any warranty; without even the implied warranty of ** merchantability or fitness for a particular purpose. ** ** Author contact information: ** drh@hwaci.com ** http://www.hwaci.com/drh/ ** ******************************************************************************* ** ** This file contains code to implement the sitemap webpage. */ #include "config.h" #include "sitemap.h" #include /* ** WEBPAGE: sitemap ** ** List some of the web pages offered by the Fossil web engine. This ** page is intended as a supplement to the menu bar on the main screen. ** That is, this page is designed to hold links that are omitted from ** the main menu due to lack of space. ** ** Additional entries defined by the "sitemap-extra" setting are included ** in the sitemap. "sitemap-extra" should be a TCL script with three ** values per entry: ** ** * The displayed text ** ** * The URL ** ** * A "capexpr" expression that determines whether or not to include ** the entry based on user capabilities. "*" means always include ** the entry and "{}" means never. ** ** If the "e=1" query parameter is present, then the standard content ** is omitted and only the sitemap-extra content is shown. If "e=2" is ** present, then only the standard content is shown and sitemap-extra ** content is omitted. ** ** If the "popup" query parameter is present and this is a POST request ** from the same origin, then the normal HTML header and footer information ** is omitted and the HTML text returned is just a raw "". */ void sitemap_page(void){ int srchFlags; int inSublist = 0; int i; int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */ int e = atoi(PD("e","0")); const char *zExtra; #if 0 /* Removed 2021-01-26 */ const struct { const char *zTitle; const char *zProperty; } aExtra[] = { { "Documentation", "sitemap-docidx" }, { "Download", "sitemap-download" }, { "License", "sitemap-license" }, { "Contact", "sitemap-contact" }, }; #endif login_check_credentials(); if( P("popup")!=0 ){ /* The "popup" query parameter ** then disable anti-robot defenses */ isPopup = 1; g.perm.Hyperlink = 1; g.jsHref = 0; } srchFlags = search_restrict(SRCH_ALL); if( !isPopup ){ style_header("Site Map"); style_adunit_config(ADUNIT_RIGHT_OK); } @