Commit:    1c04d30518e249088ae4e070bebbaaeb03de9355
Author:    Peter Kokot <peterko...@gmail.com>         Tue, 18 Dec 2018 01:47:55 
+0100
Parents:   9a8dbe29c491d31872421f91807667473fedf248
Branches:  master

Link:       
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=1c04d30518e249088ae4e070bebbaaeb03de9355

Log:
Remove display_bug_success() function

The display_bug_success() is a simple wrapper around the echo and has
HTML embedded in it.

Changed paths:
  M  include/functions.php
  M  www/bug-pwd-finder.php
  M  www/bug.php


Diff:
diff --git a/include/functions.php b/include/functions.php
index 767a929..5220f2e 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -697,18 +697,6 @@ function display_bug_error($in, $class = 'errors', $head = 
'ERROR:')
 }
 
 /**
- * Prints a message saying the action succeeded
- *
- * @param string $in   the string to be displayed
- *
- * @return void
- */
-function display_bug_success($in)
-{
-       echo "<div class='success'>{$in}</div>\n";
-}
-
-/**
  * Returns array of changes going to be made
  */
 function bug_diff($bug, $in)
diff --git a/www/bug-pwd-finder.php b/www/bug-pwd-finder.php
index b124b22..f0aa2ba 100644
--- a/www/bug-pwd-finder.php
+++ b/www/bug-pwd-finder.php
@@ -70,7 +70,7 @@ echo "<h1>Bug Report Password Finder</h1>\n";
 display_bug_error($errors);
 
 if ($success) {
-       display_bug_success($success);
+       echo '<div class="success">'.$success.'</div>';
 }
 
 $_SESSION['answer'] = $captcha->getAnswer();
diff --git a/www/bug.php b/www/bug.php
index 3d50389..0fae892 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -596,34 +596,34 @@ switch ($thanks)
 {
        case 1:
        case 2:
-               display_bug_success('The bug was updated successfully.');
+               echo '<div class="success">The bug was updated 
successfully.</div>';
                break;
        case 3:
-               display_bug_success('Your comment was added to the bug 
successfully.');
+               echo '<div class="success">Your comment was added to the bug 
successfully.</div>';
                break;
        case 4:
                $bug_url = 
"{$site_method}://{$site_url}{$basedir}/bug.php?id={$bug_id}";
-               display_bug_success("
+               echo '<div class="success">
                        Thank you for your help!
                        If the status of the bug report you submitted changes, 
you will be notified.
                        You may return here and check the status or update your 
report at any time.<br>
-                       The URL for your bug report is: <a 
href='{$bug_url}'>{$bug_url}</a>.
-               ");
+                       The URL for your bug report is: <a 
href="'.$bug_url.'">'.$bug_url.'</a>.
+                       </div>';
                break;
        case 6:
-               display_bug_success('Thanks for voting! Your vote should be 
reflected in the statistics below.');
+               echo '<div class="success">Thanks for voting! Your vote should 
be reflected in the statistics below.</div>';
                break;
        case 7:
-               display_bug_success('Your subscribe request has been 
processed.');
+               echo '<div class="success">Your subscribe request has been 
processed.</div>';
                break;
        case 8:
-               display_bug_success('Your unsubscribe request has been 
processed, please check your email.');
+               echo '<div class="success">Your unsubscribe request has been 
processed, please check your email.</div>';
                break;
        case 9:
-               display_bug_success('You have successfully unsubscribed.');
+               echo '<div class="success">You have successfully 
unsubscribed.</div>';
                break;
        case 10:
-               display_bug_success('Your vote has been updated.');
+               echo '<div class="success">Your vote has been updated.</div>';
        break;
 
        default:


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to