DevHeads.net

com web/bugs: bug.php - thanks messages: include/functions.php www/bug.php

Link: <a href="http://git.php.net/?p=web/bugs.git;a=commitdiff;h=79d0754201fb88e50048d60923bdcb249cc6ed58" title="http://git.php.net/?p=web/bugs.git;a=commitdiff;h=79d0754201fb88e50048d60923bdcb249cc6ed58">http://git.php.net/?p=web/bugs.git;a=commitdiff;h=79d0754201fb88e50048d6...</a>

Log:
bug.php - thanks messages

Changed paths:
M include/functions.php
M www/bug.php

Diff:
diff --git a/include/functions.php b/include/functions.php
index c1fc408..0e01ede 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1697,7 +1697,7 @@ function bugs_mail($to, $subject, $message, $headers = '', $params = '')
* @param string $title a string to go into the header's <title>
* @return void
*/
-function response_header($title, $extraHeaders = '')
+function response_header($title, $extraHeaders = '', $preContent = '')
{
global $_header_done, $self, $auth_user, $logged_in, $siteBig, $site_method, $site_url, $basedir;

@@ -1755,6 +1755,8 @@ function response_header($title, $extraHeaders = '')
</div>
</nav>

+<?= $preContent ?>
+
<div id="layout" class="clearfix">
<section id="layout-content">

@@ -1941,6 +1943,10 @@ function esc($string) {
return htmlspecialchars($string, ENT_COMPAT, 'UTF-8');
}

+function flash_message($text, $type = 'success') {
+ return "<div class='headsup {$type}'>{$text}</div>";
+}
+
if (!function_exists('apc_fetch')) {
function apc_fetch($key, &$success = false) {
return apcu_fetch($key, $success);
diff --git a/www/bug.php b/www/bug.php
index 060b043..a6400d2 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -567,54 +567,51 @@ switch (txfield('bug_type', $bug, isset($_POST['in']) ? $_POST['in'] : null))
break;
}

-response_header(
- $show_bug_info ? "{$bug_type} #{$bug_id} :: " . htmlspecialchars($bug['sdesc']) : "You must be logged in",
- ($bug_id != 'PREVIEW') ? "
- <link rel='alternate' type='application/rss+xml' title='{$bug['package_name']} Bug #{$bug['id']} - RDF' href='rss/bug.php?id={$bug_id}'>
- <link rel='alternate' type='application/rss+xml' title='{$bug['package_name']} Bug #{$bug['id']} - RSS 2.0' href='rss/bug.php?id={$bug_id}&format=rss2'>
- " : ''
-);
default:
break;
}

+$flash = isset($flash) ? flash_message($flash) : '';
+
+response_header(
+ $show_bug_info ? "{$bug_type} #{$bug_id} :: " . htmlspecialchars($bug['sdesc']) : "You must be logged in",
+ ($bug_id != 'PREVIEW') ? "
+ <link rel='alternate' type='application/rss+xml' title='{$bug['package_name']} Bug #{$bug['id']} - RDF' href='rss/bug.php?id={$bug_id}'>
+ <link rel='alternate' type='application/rss+xml' title='{$bug['package_name']} Bug #{$bug['id']} - RSS 2.0' href='rss/bug.php?id={$bug_id}&format=rss2'>
+ " : '',
+ $flash
+);
+
display_bug_error($errors);

if ($show_bug_info) {