Newer
Older
Digital_Repository / Repositories / statistics / includes / inc.html.navbar_eprint.es.php
  1. <?php
  2. $current_year = date("Y");
  3. $last_year = date("Y")-1;
  4. // NJS 2006-06-14: Added archive name to all URLs.
  5. /*
  6. Lists of possible links for a navigation bar, listed in order of
  7. appearance. If "match" is TRUE, then this entry corresponds to
  8. the current page, and we only output "text" (i.e., no link). If
  9. "match" is FALSE, then this entry does not correspond to the
  10. current page, so we need to output "href" as well (i.e.,
  11. generate a link).
  12.  
  13. Specify the match conditions in descending order of
  14. discrimination as much as possible, as PHP will drop out of the
  15. expression at the first failed test. Outputting links happens
  16. more often than not, so we want the decision to be made as
  17. quickly as possible.
  18. */
  19. $eprint_links = array(
  20. "4w" => array(
  21. "match" => (isset($_REQUEST["action"]) &&
  22. ($_REQUEST["action"] == "show_detail_eprint") &&
  23. isset($_REQUEST["range"]) &&
  24. ($_REQUEST["range"] == "4w")),
  25. "text" => "Past four weeks",
  26. "href" => $_SERVER['PHP_SELF']
  27. . "?action=show_detail_eprint;id="
  28. . $_REQUEST["id"]
  29. . ";range=4w;archive="
  30. . $GLOBALS["config_vars"]["archivename"],
  31. ),
  32. "current_year" => array(
  33. "match" => (isset($_REQUEST["action"]) &&
  34. ($_REQUEST["action"] == "show_detail_eprint") &&
  35. isset($_REQUEST["year"]) &&
  36. ($_REQUEST["year"] == $current_year) &&
  37. isset($_REQUEST["month"]) &&
  38. ($_REQUEST["month"] == 0)),
  39. "text" => "This year",
  40. "href" => $_SERVER['PHP_SELF']
  41. . "?action=show_detail_eprint;id="
  42. . $_REQUEST["id"]
  43. . ";year="
  44. . $current_year
  45. . ";archive="
  46. . $GLOBALS["config_vars"]["archivename"],
  47. ),
  48. "last_year" => array(
  49. "match" => (isset($_REQUEST["action"]) &&
  50. ($_REQUEST["action"] == "show_detail_eprint") &&
  51. isset($_REQUEST["year"]) &&
  52. ($_REQUEST["year"] == $last_year) &&
  53. isset($_REQUEST["month"]) &&
  54. ($_REQUEST["month"] == 0)),
  55. "text" => "Last year",
  56. "href" => $_SERVER['PHP_SELF']
  57. . "?action=show_detail_eprint;id="
  58. . $_REQUEST["id"]
  59. . ";year="
  60. . $last_year
  61. . ";archive="
  62. . $GLOBALS["config_vars"]["archivename"],
  63. ),
  64. "all_years" => array(
  65. "match" => (isset($_REQUEST["action"]) &&
  66. ($_REQUEST["action"] == "show_detail_eprint") &&
  67. isset($_REQUEST["year"]) &&
  68. ($_REQUEST["year"] == 0) &&
  69. isset($_REQUEST["month"]) &&
  70. ($_REQUEST["month"] == 0) &&
  71. isset($_REQUEST["range"]) &&
  72. ($_REQUEST["range"] == "")),
  73. "text" => "All years",
  74. "href" => $_SERVER['PHP_SELF']
  75. . "?action=show_detail_eprint;id="
  76. . $_REQUEST["id"]
  77. . ";archive="
  78. . $GLOBALS["config_vars"]["archivename"],
  79. ),
  80. );
  81. print "<p>For this eprint: ";
  82. outputNavBar($eprint_links);
  83. print "</p>";
  84. ?>