Ignore:
Timestamp:
Apr 6, 2011, 9:31:02 PM (13 years ago)
Author:
mistic100
Message:

merge r10097 & r10122 from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/picture.php

    r9073 r10123  
    190190// +-----------------------------------------------------------------------+
    191191
     192$infos = array();
     193
    192194// caching first_rank, last_rank, current_rank in the displayed
    193195// section. This should also help in readability.
     
    332334        if (!empty($_POST['content']))
    333335        {
    334           update_user_comment(
     336          $comment_action = update_user_comment(
    335337            array(
    336338              'comment_id' => $_GET['comment_to_edit'],
     
    341343            );
    342344
    343           redirect($url_self);
     345          switch ($comment_action)
     346          {
     347            case 'moderate':
     348              array_push($infos, l10n('An administrator must authorize your comment before it is visible.'));
     349            case 'validate':
     350              array_push($infos, l10n('Your comment has been registered'));
     351              break;
     352            case 'reject':
     353              set_status_header(403);
     354              array_push($infos, l10n('Your comment has NOT been registered because it did not pass the validation rules'));
     355              break;
     356            default:
     357              trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
     358          }
     359         
     360          $template->assign(
     361              ($comment_action=='reject') ? 'errors' : 'infos',
     362              $infos
     363            );
     364           
     365          unset($_POST['content']);
     366          break;
    344367        }
    345368        else
     
    835858}
    836859
    837 $infos = array();
    838 
    839860// author
    840861if (!empty($picture['current']['author']))
Note: See TracChangeset for help on using the changeset viewer.