Changeset 25360 for trunk/include
- Timestamp:
- Nov 6, 2013, 6:57:53 PM (10 years ago)
- Location:
- trunk/include
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r25288 r25360 1027 1027 * @return string 1028 1028 */ 1029 function get_l10n_args($key, $args )1029 function get_l10n_args($key, $args='') 1030 1030 { 1031 1031 if (is_array($args)) -
trunk/include/functions_comment.inc.php
r25357 r25360 233 233 $comment_url = get_absolute_root_url().'comments.php?comment_id='.$comm['id']; 234 234 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),235 $keyargs_content = array( 236 get_l10n_args('Author: %s', stripslashes($comm['author']) ), 237 get_l10n_args('Email: %s', stripslashes($comm['email']) ), 238 get_l10n_args('Comment: %s', stripslashes($comm['content']) ), 239 get_l10n_args(''), 240 get_l10n_args('Manage this user comment: %s', $comment_url), 241 241 ); 242 242 243 243 if ('moderate' == $comment_action) 244 244 { 245 $ content[] = l10n('(!) This comment requires validation');245 $keyargs_content[] = get_l10n_args('(!) This comment requires validation'); 246 246 } 247 247 248 248 pwg_mail_notification_admins( 249 l10n('Comment by %s', stripslashes($comm['author']) ),250 implode("\n", $content)249 get_l10n_args('Comment by %s', stripslashes($comm['author']) ), 250 $keyargs_content 251 251 ); 252 252 } … … 374 374 $comment_url = get_absolute_root_url().'comments.php?comment_id='.$comment['comment_id']; 375 375 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'),376 $keyargs_content = array( 377 get_l10n_args('Author: %s', stripslashes($GLOBALS['user']['username']) ), 378 get_l10n_args('Comment: %s', stripslashes($comment['content']) ), 379 get_l10n_args(''), 380 get_l10n_args('Manage this user comment: %s', $comment_url), 381 get_l10n_args('(!) This comment requires validation'), 382 382 ); 383 383 384 384 pwg_mail_notification_admins( 385 l10n('Comment by %s', stripslashes($GLOBALS['user']['username']) ),386 implode("\n", $content)385 get_l10n_args('Comment by %s', stripslashes($GLOBALS['user']['username']) ), 386 $keyargs_content 387 387 ); 388 388 } … … 411 411 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 412 412 413 $ content = array(414 l10n('Author: %s', $comment['author']),413 $keyargs_content = array( 414 get_l10n_args('Author: %s', $comment['author']), 415 415 ); 416 416 417 417 if ($action=='delete') 418 418 { 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']);419 $keyargs_content[] = get_l10n_args('This author removed the comment with id %d', $comment['comment_id']); 420 } 421 else 422 { 423 $keyargs_content[] = get_l10n_args('This author modified following comment:'); 424 $keyargs_content[] = get_l10n_args('Comment: %s', $comment['content']); 425 425 } 426 426 427 427 pwg_mail_notification_admins( 428 l10n('Comment by %s', $comment['author']),429 implode("\n", $content) 430 428 get_l10n_args('Comment by %s', $comment['author']), 429 $keyargs_content 430 ); 431 431 } 432 432 -
trunk/include/functions_mail.inc.php
r25358 r25360 169 169 170 170 /** 171 * Return string email format (text/html or text/plain) 172 * @param bool is_html 173 * @return string 174 */ 175 function get_str_email_format($is_html) 176 { 177 return ($is_html ? 'text/html' : 'text/plain'); 178 } 179 180 /** 171 181 * Switch language to specified language 172 182 * All entries are push on language stack … … 256 266 * Send a notification email to all administrators 257 267 * current user (if admin) is not notified 258 * @param string $subject259 * @param string $content268 * @param string|array $subject 269 * @param string|array $content 260 270 * @param boolean $send_technical_details - send user IP and browser 261 271 * @return boolean … … 267 277 return false; 268 278 } 269 270 // for backward compatibility < 2.6271 if (is_array($subject))272 {273 $subject = l10n_args($subject);274 }275 if (is_array($content))276 {277 $content = l10n_args($content);278 }279 279 280 280 global $conf, $user; 281 281 282 if (is_array($subject) or is_array($content)) 283 { 284 switch_lang_to(get_default_language()); 285 286 if (is_array($subject)) 287 { 288 $subject = l10n_args($subject); 289 } 290 if (is_array($content)) 291 { 292 $content = l10n_args($content); 293 } 294 295 switch_lang_back(); 296 } 297 282 298 $tpl_vars = array(); 283 299 if ($send_technical_details) 284 300 { 285 $tpl_vars['TECHNICAL'] = 286 l10n('Connected user: %s', stripslashes($user['username'])) ."\n". 287 l10n('IP: %s', $_SERVER['REMOTE_ADDR']) . "\n" . 288 l10n('Browser: %s', $_SERVER['HTTP_USER_AGENT']); 301 $tpl_vars['TECHNICAL'] = array( 302 'username' => stripslashes($user['username']), 303 'ip' => $_SERVER['REMOTE_ADDR'], 304 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 305 ); 289 306 } 290 307 -
trunk/include/functions_user.inc.php
r25357 r25360 230 230 $admin_url = get_absolute_root_url().'admin.php?page=user_list&username='.$login; 231 231 232 $ content = array(233 l10n('User: %s', stripslashes($login) ),234 l10n('Email: %s', $_POST['mail_address']),235 '',236 l10n('Admin: %s', $admin_url),232 $keyargs_content = array( 233 get_l10n_args('User: %s', stripslashes($login) ), 234 get_l10n_args('Email: %s', $_POST['mail_address']), 235 get_l10n_args(''), 236 get_l10n_args('Admin: %s', $admin_url), 237 237 ); 238 238 239 239 pwg_mail_notification_admins( 240 l10n('Registration of %s', stripslashes($login) ),241 implode("\n", $content)240 get_l10n_args('Registration of %s', stripslashes($login) ), 241 $keyargs_content 242 242 ); 243 243 }
Note: See TracChangeset
for help on using the changeset viewer.