Ignore:
Timestamp:
Nov 6, 2013, 4:43:41 PM (10 years ago)
Author:
mistic100
Message:

feature 2995: New email template
rewrite pwg_mail_group() and pwg_mail_notification_admins()
new function pwg_mail_admins()
add complete template management in pwg_mail()
TODO : font-size problem in Thunderbird

File:
1 edited

Legend:

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

    r25018 r25357  
    233233      $comment_url = get_absolute_root_url().'comments.php?comment_id='.$comm['id'];
    234234
    235       $keyargs_content = array
    236       (
    237         get_l10n_args('Author: %s', stripslashes($comm['author']) ),
    238         get_l10n_args('Email: %s', stripslashes($comm['email']) ),
    239         get_l10n_args('Comment: %s', stripslashes($comm['content']) ),
    240         get_l10n_args('', ''),
    241         get_l10n_args('Manage this user comment: %s', $comment_url)
     235      $content = array(
     236        l10n('Author: %s', stripslashes($comm['author']) ),
     237        l10n('Email: %s', stripslashes($comm['email']) ),
     238        l10n('Comment: %s', stripslashes($comm['content']) ),
     239        '',
     240        l10n('Manage this user comment: %s', $comment_url),
    242241      );
    243242
    244243      if ('moderate' == $comment_action)
    245244      {
    246         $keyargs_content[] = get_l10n_args('', '');
    247         $keyargs_content[] = get_l10n_args('(!) This comment requires validation', '');
     245        $content[] = l10n('(!) This comment requires validation');
    248246      }
    249247
    250       pwg_mail_notification_admins
    251       (
    252         get_l10n_args('Comment by %s', stripslashes($comm['author']) ),
    253         $keyargs_content
     248      pwg_mail_notification_admins(
     249        l10n('Comment by %s', stripslashes($comm['author']) ),
     250        implode("\n", $content)
    254251      );
    255252    }
     
    377374      $comment_url = get_absolute_root_url().'comments.php?comment_id='.$comment['comment_id'];
    378375
    379       $keyargs_content = array
    380       (
    381         get_l10n_args('Author: %s', stripslashes($GLOBALS['user']['username']) ),
    382         get_l10n_args('Comment: %s', stripslashes($comment['content']) ),
    383         get_l10n_args('', ''),
    384         get_l10n_args('Manage this user comment: %s', $comment_url),
    385         get_l10n_args('', ''),
    386         get_l10n_args('(!) This comment requires validation', ''),
     376      $content = array(
     377        l10n('Author: %s', stripslashes($GLOBALS['user']['username']) ),
     378        l10n('Comment: %s', stripslashes($comment['content']) ),
     379        '',
     380        l10n('Manage this user comment: %s', $comment_url),
     381        l10n('(!) This comment requires validation'),
    387382      );
    388383
    389       pwg_mail_notification_admins
    390       (
    391         get_l10n_args('Comment by %s', stripslashes($GLOBALS['user']['username']) ),
    392         $keyargs_content
     384      pwg_mail_notification_admins(
     385        l10n('Comment by %s', stripslashes($GLOBALS['user']['username']) ),
     386        implode("\n", $content)
    393387      );
    394388    }
     
    417411  include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
    418412
    419   $keyargs_content = array();
    420   $keyargs_content[] = get_l10n_args('Author: %s', $comment['author']);
     413  $content = array(
     414    l10n('Author: %s', $comment['author']),
     415    );
     416
    421417  if ($action=='delete')
    422418  {
    423     $keyargs_content[] = get_l10n_args('This author removed the comment with id %d',
    424                                        $comment['comment_id']
    425                                        );
    426   }
    427   else
    428   {
    429     $keyargs_content[] = get_l10n_args('This author modified following comment:', '');
    430     $keyargs_content[] = get_l10n_args('Comment: %s', $comment['content']);
    431   }
    432 
    433   pwg_mail_notification_admins(get_l10n_args('Comment by %s',
    434                                              $comment['author']),
    435                                $keyargs_content
    436                                );
     419    $content[] = l10n('This author removed the comment with id %d', $comment['comment_id']);
     420  }
     421  else
     422  {
     423    $content[] = l10n('This author modified following comment:');
     424    $content[] = l10n('Comment: %s', $comment['content']);
     425  }
     426
     427  pwg_mail_notification_admins(
     428    l10n('Comment by %s', $comment['author']),
     429                implode("\n", $content)
     430                );
    437431}
    438432
Note: See TracChangeset for help on using the changeset viewer.