/* ** Copyright (c) 2002 D. Richard Hipp ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public ** License as published by the Free Software Foundation; either ** version 2 of the License, or (at your option) any later version. ** ** 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. See the GNU ** General Public License for more details. ** ** You should have received a copy of the GNU General Public ** License along with this library; if not, write to the ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, ** Boston, MA 02111-1307, USA. ** ** Author contact information: ** drh@hwaci.com ** http://www.hwaci.com/drh/ ** ******************************************************************************* ** ** Code to generate the index page */ #include "config.h" #include "index.h" /* ** Return TRUE if the given string contains at least one non-space ** character */ static int not_blank(const char *z){ while( isspace(*z) ){ z++; } return *z!=0; } /* ** WEBPAGE: / ** WEBPAGE: /index ** WEBPAGE: /mainmenu */ void index_page(void){ int cnt = 0; login_check_credentials(); common_standard_menu("index", 0); common_add_help_item("CvstracDocumentation"); /* If the user has wiki read permission and a wiki page named HomePage ** exists and is not empty and is locked (meaning that only an ** administrator could have created it), then use that page as the ** main menu rather than the built-in main menu. ** ** The built-in main menu is always reachable using the /mainmenu URL ** instead of "/index" or "/". */ if( g.okRdWiki && g.zPath[0]!='m' ){ char *zBody = db_short_query( "SELECT text FROM wiki WHERE name='HomePage' AND locked"); if( zBody && not_blank(zBody) ){ common_add_nav_item("mainmenu", "Main Menu"); common_header("Home Page"); /* menu_sidebar(); */ output_wiki(zBody, "", "HomePage"); common_footer(); return; } } /* Render the built-in main-menu page. */ common_header("Main Index"); cgi_printf("
\n" "Home Page\n" " | \n" "\n" "View the Wiki-based homepage for this project.\n" " | \n" "
\n" "Ticket\n" " | \n" "\n" "Create a new Ticket with a defect report or enhancement request.\n" " | \n" "
\n" "Browse\n" " | \n" "\n" "Browse the %s repository tree.\n" " | \n" "
\n" "Reports\n" " | \n" "\n" "View summary reports of Tickets.\n" " | \n" "
\n" "Timeline\n" " | \n" "\n" "View a chronology of Check-Ins and Ticket changes.\n" " | \n" "
\n" "Wiki\n" " | \n" "\n" "View the Wiki documentation pages.\n" " | \n" "
\n" "Search\n" " | \n" "\n"); if( n==4 ){ cgi_printf("Search for keywords in %s, %s, %s, and/or %s\n",az[0],az[1],az[2],az[3]); }else if( n==3 ){ cgi_printf("Search for keywords in %s, %s, and/or %s\n",az[0],az[1],az[2]); }else if( n==2 ){ cgi_printf("Search for keywords in %s and/or %s\n",az[0],az[1]); }else{ cgi_printf("Search for keywords in %s\n",az[0]); } cgi_printf(" | \n" "
\n" "Milestones\n" " | \n" "\n" "Create new project milestones.\n" " | \n" "
\n" "User\n" " | \n" "\n" "Create, edit, and delete users.\n" " | \n" "
\n" "Setup\n" " | \n" "\n" "Setup global system parameters.\n" " | \n" "
\n" "Documentation\n" " | \n" "\n" "Read the online manual.\n" " | \n" "
\n" "Login\n" " | \n" "\n" "Log in.\n" " | \n" "
\n" "Logout\n" " | \n" "\n" "Log off or change password.\n" " | \n" "