function navigationBar($id, $title, $loc) { global $NEXT, $PREV, $tstamp, $CHARSET; $navClass = $NEXT[1] || $PREV[1] ? 'manual-navigation' : 'manual-navigation manual-navigation-no-nav'; echo "<!-- START MANUAL NAVIGATION -->\n"; echo "<div class=\"{$navClass}\" id=\"manual-navigation-{$loc}\">\n"; if ($PREV[1]) { $link = $PREV[1]; if (strlen($link) > 45) { $link = str_replace('::', '::<br />', $link); } // not using make_link because of embedded <span> $accesskey = $loc == 'top' ? ' accesskey="r"' : ''; echo " <a class=\"manual-previous\" href=\"{$PREV[0]}\"{$accesskey}>"; echo $link . "\n"; echo '<span class="title">(P<span class="accesskey">r</span>evious)</span>'; echo "</a>\n"; } echo "\n"; if ($NEXT[1]) { $link = $NEXT[1]; if (strlen($link) > 45) { $link = str_replace('::', '::<br />', $link); } // not using make_link because of embedded <span> $accesskey = $loc == 'top' ? ' accesskey="x"' : ''; echo " <a class=\"manual-next\" href=\"{$NEXT[0]}\"{$accesskey}>"; echo $link . "\n"; echo '<span class="title">(Ne<span class="accesskey">x</span>t)</span>'; echo "</a>\n"; } echo "\n"; echo " <div class=\"manual-clear\"></div>\n"; if ($loc == 'bottom') { // info and download links echo " <div class=\"manual-info\">"; echo "Last updated: {$tstamp}"; // UTF-8 em-dash echo " — " . make_link('/manual/', 'Download Documentation'); echo "</div>\n"; echo "\n"; // bug report links $package_name = getPackageNameForId($id); echo " <div class=\"manual-bug\">\n"; echo ' Do you think that something on this page is wrong?'; echo ' Please <a href="' . getBugReportLink($package_name) . '">file a bug report</a> '; echo ' or <a href="/notes/add-note-form.php?redirect=' . htmlentities($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8') . '&uri=' . htmlspecialchars(urlencode($id)) . '">add a note</a>. '; echo "\n"; echo " </div>\n"; echo "\n"; // language chooser global $LANGUAGES, $LANG; $langs = array(); foreach ($LANGUAGES as $code => $name) { if (file_exists("../{$code}/{$id}")) { $langs[] = array('code' => $code, 'title' => $name, 'link' => make_link("../{$code}/{$id}", $name)); } } $file = substr($id, 0, -4); if (file_exists("html/{$file}.html")) { $langs[] = array('code' => null, 'title' => 'Plain HTML', 'link' => make_link("html/{$file}.html", 'Plain HTML')); } if (count($langs)) { echo " <div class=\"manual-languages\">\n"; echo 'View this page in:'; echo " <ul class=\"manual-language-list\">\n"; $count = 0; foreach ($langs as $lang) { echo " <li class=\"manual-language\">"; if ($count > 0) { // UTF-8 bullet echo " • "; } if ($lang['code'] == $LANG) { echo '<strong>' . $lang['title'] . '</strong>'; } else { echo $lang['link']; } echo "</li>\n"; $count++; } echo " </ul>\n"; echo " </div>\n"; } echo "\n"; // user notes echo " <div class=\"manual-notes\" id=\"user-notes\">\n"; echo " <h3>User Notes:</h3>\n"; echo " " . getComments($id) . "\n"; echo " </div>\n"; } echo "</div>\n<!-- END MANUAL NAVIGATION -->\n\n"; }
<?php auth_require('pear.dev'); require_once 'notes/ManualNotes.class.php'; $manualNotes = new Manual_Notes(); $action = ''; if (isset($_REQUEST['action'])) { $action = strtolower($_REQUEST['action']); } switch ($action) { case 'makedocbug': if (isset($_GET['noteId'])) { $noteId = (int) $_GET['noteId']; $note = $manualNotes->getSingleCommentById($noteId); $registered = 1; $package = getPackageNameForId($note['page_url']); $package_name = is_null($package) ? 'Documentation' : $package; $bug_type = 'Documentation Problem'; $email = $auth_user->email; $handle = $auth_user->handle; $sdesc = 'User note that is a documentation problem'; $ldesc = 'Manual page: ' . $note['page_url'] . "\n" . 'Note submitter:' . "\n"; if (!empty($note['user_handle'])) { $ldesc .= user_link($note['user_handle'], true); } else { include_once 'bugs/pear-bugs-utils.php'; $ldesc .= PEAR_Bugs_Utils::spamProtect($note['user_name'], 'text'); } $ldesc .= "\n\n" . str_replace('<br />', '', $dbh->escapeSimple(html_entity_decode($note['note_text']))); $package_version = null; $php_version = 'Irrelevant';
?> <p> You can contribute your helpful information to the PEAR manual using this simple form. Please proof-read your note. </p> <p> There is no need to hide or otherwise obfuscate your email address (like joeSPAM @#@at Gronk dawt net), as this will be done automatically. </p> <p> Please, please ONLY add actual information. Questions, feature requests ("You guys should document this!@#"), or bug reports should not be posted as a note. We have a great bug tracker for bugs/feature requests at <a href="<?php echo getBugReportLink(getPackageNameForId($noteUrl)); ?> ">this location</a>. Questions can be answered through our <a href="http://pear.php.net/support">support channels</a>. </p> <form action="/notes/add-note.php" method="post"> <input type="hidden" name="noteUrl" value="<?php echo htmlspecialchars($noteUrl); ?> " /> <input type="hidden" name="redirect" value="<?php echo htmlspecialchars($redirect); ?> " /> <table>