Sfoglia il codice sorgente

Fix FIXME in functions/addressbook.php

stevetruckstuff 19 anni fa
parent
commit
e61e200439
2 ha cambiato i file con 2 aggiunte e 13 eliminazioni
  1. 0 5
      functions/addressbook.php
  2. 2 8
      src/addressbook.php

+ 0 - 5
functions/addressbook.php

@@ -1,5 +1,4 @@
 <?php
-
 /**
  * functions/addressbook.php - Functions and classes for the addressbook system
  *
@@ -12,10 +11,6 @@
  * @subpackage addressbook
  */
 
-/** required includes */
-// FIXME, NO display code in functions files
-include_once(SM_PATH . 'templates/util_global.php');
-
 /**
  * Create and initialize an addressbook object.
  * @param boolean $showerr display any address book init errors. html page header

+ 2 - 8
src/addressbook.php

@@ -21,6 +21,7 @@ include('../include/init.php');
 /* address book functions */
 require_once(SM_PATH . 'functions/addressbook.php');
 include_once(SM_PATH . 'templates/util_addressbook.php');
+include_once(SM_PATH . 'templates/util_global.php');
 
 /* form functions */
 require_once(SM_PATH . 'functions/forms.php');
@@ -188,14 +189,7 @@ if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'P
                     /* Handle error messages */
                     if (!$r) {
                         /* Display error */
-                        echo html_tag( 'table',
-                                html_tag( 'tr',
-                                    html_tag( 'td',
-                                        "\n". '<strong><font color="' . $color[2] .
-                                        '">' . _("ERROR") . ': ' . $abook->error . '</font></strong>' ."\n",
-                                        'center' )
-                                    ),
-                                'center', '', 'width="100%"' );
+                        plain_error_message( _("ERROR") .': '. $abook->error);
 
                         /* Display the "new address" form again */
                         abook_create_form($form_url,'editaddr',_("Update address"),_("Update address"),$newdata);