Ignore:
Timestamp:
Dec 18, 2011, 10:46:24 PM (12 years ago)
Author:
mistic100
Message:

feature:2538 Make a unified messages management
use only $pageinfos and $pageerrors vars and and necessary template to all main pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/picture_comment.inc.php

    r11839 r12764  
    5454  include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php');
    5555
    56   $comment_action = insert_user_comment($comm, @$_POST['key'], $infos );
     56  $comment_action = insert_user_comment($comm, @$_POST['key'], $page['infos']);
    5757
    5858  switch ($comment_action)
    5959  {
    6060    case 'moderate':
    61       array_push( $infos, l10n('An administrator must authorize your comment before it is visible.') );
     61      array_push($page['infos'], l10n('An administrator must authorize your comment before it is visible.') );
    6262    case 'validate':
    63       array_push( $infos, l10n('Your comment has been registered'));
     63      array_push($page['infos'], l10n('Your comment has been registered'));
    6464      break;
    6565    case 'reject':
    6666      set_status_header(403);
    67       array_push($infos, l10n('Your comment has NOT been registered because it did not pass the validation rules') );
     67      array_push($page['errors'], l10n('Your comment has NOT been registered because it did not pass the validation rules') );
    6868      break;
    6969    default:
    7070      trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
    7171  }
    72 
    73   $template->assign(
    74       ($comment_action=='reject') ? 'errors' : 'infos',
    75       $infos
    76     );
    7772
    7873  // allow plugins to notify what's going on
Note: See TracChangeset for help on using the changeset viewer.