Pelzini

This is the code documentation for the Pelzini project

source of /viewer/head.php

The viewer header
  1. <?php
  2. /*
  3. Copyright 2008 Josh Heidenreich
  4.  
  5. This file is part of Pelzini.
  6.  
  7. Pelzini is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11.  
  12. Pelzini is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Pelzini. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20.  
  21. /**
  22.  * The viewer header
  23.  *
  24.  * @package Viewer
  25.  * @author Josh Heidenreich
  26.  * @since 0.1
  27.  * @tag i18n-done
  28.  **/
  29.  
  30. $browser_title = 'Documentation for ' . $project['name'];
  31. if (!empty($skin['page_name'])) {
  32. $browser_title = $skin['page_name'] . ' - ' . $browser_title;
  33. }
  34.  
  35. header('Content-type: text/html; charset=UTF-8');
  36. ?>
  37. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  38. <html>
  39. <head>
  40. <title><?php echo $browser_title; ?></title>
  41.  
  42. <base href="<?php echo htmlspecialchars($base_path); ?>">
  43.  
  44. <link rel="search" type="application/opensearchdescription+xml" href="opensearch" title="<?php echo htmlspecialchars($project['name']); ?>" />
  45.  
  46. <link href="../assets/style.css" rel="stylesheet" type="text/css">
  47. <script src="../assets/functions.js" type="text/javascript"></script>
  48. <link href="../assets/favicon.ico" rel="icon" type="image/vnd.microsoft.icon" >
  49. </head>
  50. <body>
  51.  
  52. <div class="header">
  53. <h1><?php echo str (STR_MAIN_TITLE, 'project', $project['name']); ?></h1>
  54. <p><?php echo str (STR_INTRO_PARAGRAPH, 'project', $project['name']); ?></p>
  55. </div>
  56.  
  57. <div class="navigation">
  58. <span style="float: right">
  59. <a href="more_info"><?php echo str(STR_MORE_INFO); ?></a>
  60.  
  61. <form action="select_project" method="post">
  62. <input type="hidden" name="redirect" value="<?php echo $_SERVER['REQUEST_URI']; ?>">
  63. <b><?php echo str(STR_PROJECT); ?>:</b>
  64. <select name="code" onchange="this.form.submit();">
  65. <?php
  66. $q = "SELECT id, code, name FROM projects WHERE name != '' AND code != '' ORDER BY name";
  67. $_res = db_query($q);
  68. while ($row = db_fetch_assoc($_res)) {
  69. if ($project['id'] == $row['id']) {
  70. echo "<option value=\"{$row['code']}\" selected>{$row['name']}</option>\n";
  71. } else {
  72. echo "<option value=\"{$row['code']}\">{$row['name']}</option>\n";
  73. }
  74. }
  75. ?>
  76. </select>
  77. </form>
  78. </span>
  79.  
  80. <a href="index"><?php echo str(STR_HOME); ?></a>
  81. &nbsp;
  82.  
  83. <?php
  84. $q = new SelectQuery();
  85. $q->addFields('id, name');
  86. $q->setFrom('namespaces');
  87. $q->addWhere('parentid = 0');
  88. $q->setOrderBy('name');
  89. $q->addProjectWhere();
  90.  
  91. $q = $q->buildQuery();
  92. $_res = db_query($q);
  93. while ($row = db_fetch_assoc($_res)) {
  94. echo '<a href="namespace?name=', urlencode($row['name']), '">', htmlspecialchars($row['name']), '</a> ';
  95. }
  96. ?>
  97. </div>
  98.  
  99. <table class="main">
  100. <tr>
  101. <td class="sidebar">
  102. <div class="box">
  103. <h2><?php echo str(STR_SEARCH_TITLE); ?></h2>
  104. <div div class="content">
  105. <form action="search" method="get">
  106. <input type="hidden" name="advanced" value="1">
  107.  
  108. <p>
  109. <b><?php echo str(STR_SEARCH_TERM); ?></b>
  110. <br><input type="text" name="q" style="width: 200px;" value="<?php echo htmlspecialchars(@$_GET['q']); ?>">
  111. </p>
  112.  
  113. <p>
  114. <b><?php echo str(STR_WHAT_SEARCH); ?></b>
  115. <br><label><input type="checkbox" name="classes" value="y" <?php if (!isset($_GET['advanced']) or @$_GET['classes'] == 'y') echo 'checked'; ?>> <?php echo str(STR_CLASSES); ?></label>
  116. <br><label><input type="checkbox" name="interfaces" value="y" <?php if (!isset($_GET['advanced']) or @$_GET['interfaces'] == 'y') echo 'checked'; ?>> <?php echo str(STR_INTERFACES); ?></label>
  117. <br><label><input type="checkbox" name="functions" value="y" <?php if (!isset($_GET['advanced']) or @$_GET['functions'] == 'y') echo 'checked'; ?>> <?php echo str(STR_FUNCTIONS); ?></label>
  118. <br><label><input type="checkbox" name="constants" value="y" <?php if (!isset($_GET['advanced']) or @$_GET['constants'] == 'y') echo 'checked'; ?>> <?php echo str(STR_CONSTANTS); ?></label>
  119. <br><label><input type="checkbox" name="documents" value="y" <?php if (!isset($_GET['advanced']) or @$_GET['documents'] == 'y') echo 'checked'; ?>> <?php echo str(STR_DOCUMENTS); ?></label>
  120. <br><label><input type="checkbox" name="source" value="y" <?php if (!isset($_GET['advanced']) or @$_GET['source'] == 'y') echo 'checked'; ?>> <?php echo str(STR_SOURCE_CODE); ?></label>
  121. </p>
  122.  
  123. <p>
  124. <b><?php echo str(STR_SEARCH_PATH); ?></b>
  125. <br><input type="text" name="path" style="width: 200px;" value="<?php echo htmlspecialchars(@$_GET['path']); ?>">
  126. </p>
  127.  
  128. <p style="text-align: right;">
  129. <input type="submit" value="<?php echo str (STR_SEARCH_GO_BTN); ?>">
  130. </p>
  131. </form>
  132. </div>
  133. </div>
  134. </td>
  135.  
  136. <td class="main">
  137.  
  138. <!-- Main content begins here -->
  139.