Mercurial > hg > fapweb
comparison msitegen.inc.php @ 177:45eaa6571e72
Simplify cmPrintPageHeader() by removing some CSS-related magic and cruft.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 07 Nov 2013 07:00:17 +0200 |
parents | 8f0d81f9c648 |
children | 0c2bdc46b93c |
comparison
equal
deleted
inserted
replaced
176:8f0d81f9c648 | 177:45eaa6571e72 |
---|---|
436 | 436 |
437 function cmPrintPageHeader($pageTitle, $pageExtra = "", $useContents = TRUE) | 437 function cmPrintPageHeader($pageTitle, $pageExtra = "", $useContents = TRUE) |
438 { | 438 { |
439 global $pageCSS, $pageCharset, $pageAuthor, $pageCSSData, $pageUrchin; | 439 global $pageCSS, $pageCharset, $pageAuthor, $pageCSSData, $pageUrchin; |
440 | 440 |
441 if (!isset($pageCSS)) | |
442 { | |
443 if (!isset($pageCSSData)) | |
444 { | |
445 $pageCSSData = array( | |
446 "cookie" => "docscss", | |
447 "prefix" => "http://tnsp.org/docs", | |
448 ); | |
449 } | |
450 | |
451 if (isset($_GET["css"])) | |
452 { | |
453 $index = intval($_GET["css"]); | |
454 setcookie($pageCSSData["cookie"], $index, time() + 365*24*60*60, "/"); // expire in a year | |
455 } | |
456 else | |
457 { | |
458 $index = isset($_COOKIE[$pageCSSData["cookie"]]) ? intval($_COOKIE[$pageCSSData["cookie"]]) : 1; | |
459 } | |
460 $pageCSS = $pageCSSData["prefix"].$index.".css"; | |
461 } | |
462 | |
463 echo | 441 echo |
464 "<?xml version=\"1.0\" encoding=\"".$pageCharset."\"?>\n". | 442 "<?xml version=\"1.0\" encoding=\"".$pageCharset."\"?>\n". |
465 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n". | 443 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n". |
466 "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n". | 444 "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n". |
467 "<head>\n". | 445 "<head>\n". |
485 if (isset($pageUrchin)) | 463 if (isset($pageUrchin)) |
486 require_once $pageUrchin; | 464 require_once $pageUrchin; |
487 else | 465 else |
488 require_once "urchin.inc.php"; | 466 require_once "urchin.inc.php"; |
489 | 467 |
490 /* | |
491 echo | |
492 "<script type=\"text/javascript\" src=\"http://tnsp.org/copyright-campaign.js\" charset=\"UTF-8\"></script>\n". | |
493 "<script>\n", | |
494 "copyrightCampaign();\n", | |
495 "</script>\n"; | |
496 */ | |
497 | |
498 if ($useContents) | 468 if ($useContents) |
499 echo "<div id=\"contents\">\n"; | 469 echo "<div id=\"contents\">\n"; |
500 } | 470 } |
501 | 471 |
502 | 472 |