#include #include #include "tlmpdoc.h" #include "internal.h" static W_INT prjstate ("prjstate"); static W_INT nodoc ("nodoc"); class _F_project_private{ public: const char *title; }; void _F_project::setdoclink (int no, const char *title) { char parms[30]; sprintf (parms,"prjstate=1&nodoc=%d",no-1); url_self (parms,"%s",title); } void _F_project::docindex (const char *title) { setdoclink (1,"Main document"); } void _F_project::logo(const char *title) { htmlprintf ("



\n"); htmlprintf ("
%s

\n","A TLMPDOC project"); htmlprintf ("



\n"); } void _F_project::document1 (int no, const char *title) { if (tlmpdoc_buildkey == 0) htmlprintf ("No document %d available\n",no); } void _F_project::document2 (int no, const char *title) { if (tlmpdoc_buildkey == 0) htmlprintf ("No document %d available\n",no); } void _F_project::document3 (int no, const char *title) { if (tlmpdoc_buildkey == 0) htmlprintf ("No document %d available\n",no); } void _F_project::document4 (int no, const char *title) { if (tlmpdoc_buildkey == 0) htmlprintf ("No document %d available\n",no); } void _F_project::documents (int no, const char *title) { switch (no){ case 0: document1 (no+1,title); break; case 1: document2 (no+1,title); break; case 2: document3 (no+1,title); break; case 3: document4 (no+1,title); break; default: htmlprintf ("No document %d available\n",no+1); } } void _F_project::calldocument (int no) { documents (no-1,priv->title); } void _F_project::news(const char *title) { htmlprintf ("No news is good news :-)\n"); } void _F_project::logs(const char *title) { htmlprintf ("No change log for this project, yet!\n"); } void _F_project::refs(const char *title) { htmlprintf ("No references, yet!\n"); } bool _F_project::has_news(const char *) { return false; } bool _F_project::has_logs(const char *) { return false; } /* Present the main page of the project */ void _F_project::layout(const char *title) { htmlprintf ("

%s

\n",title); htmlprintf ("

\n"); htmlprintf ("\n"); htmlprintf ("\n"); htmlprintf ("
\n"); docindex(title); // url_self ("prjstate=4","References"); htmlprintf ("\n"); htmlprintf ("
\n"); htmlprintf ("
\n"); logo(title); htmlprintf ("
\n"); if (has_news(title)){ news(title); } if (has_logs(title)){ logs(title); } } void project (_F_project &c, const char *title) { tlmpweb_title (title); c.priv = new _F_project_private; c.priv->title = title; if (tlmpdoc_buildkey != 0){ for (int i=0; i= 0 || nodoc < MAX_PROJECT_DOC){ char tmp[20]; sprintf (tmp,"document%d",nodoc.getval()); docsession_push (tmp); FORM_HIDDEN s(prjstate); FORM_HIDDEN d(nodoc); c.documents (nodoc,title); docsession_pop (); } }else if (prjstate == 2){ c.news(title); }else if (prjstate == 3){ c.logs(title); }else if (prjstate == 4){ c.refs(title); } }