[ Index ] |
PHP Cross Reference of phpBB-3.1.12-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of the phpBB Forum Software package. 5 * 6 * @copyright (c) phpBB Limited <https://www.phpbb.com> 7 * @license GNU General Public License, version 2 (GPL-2.0) 8 * 9 * For full copyright and license information, please see 10 * the docs/CREDITS.txt file. 11 * 12 */ 13 14 namespace phpbb\notification\type; 15 16 /** 17 * Post disapproved notifications class 18 * This class handles notifications for posts when they are disapproved (for authors) 19 */ 20 21 class disapprove_post extends \phpbb\notification\type\approve_post 22 { 23 /** 24 * Get notification type name 25 * 26 * @return string 27 */ 28 public function get_type() 29 { 30 return 'notification.type.disapprove_post'; 31 } 32 33 /** 34 * Get the CSS style class of the notification 35 * 36 * @return string 37 */ 38 public function get_style_class() 39 { 40 return 'notification-disapproved'; 41 } 42 43 /** 44 * Language key used to output the text 45 * 46 * @var string 47 */ 48 protected $language_key = 'NOTIFICATION_POST_DISAPPROVED'; 49 50 /** 51 * Inherit notification read status from post. 52 * 53 * @var bool 54 */ 55 protected $inherit_read_status = false; 56 57 /** 58 * Notification option data (for outputting to the user) 59 * 60 * @var bool|array False if the service should use it's default data 61 * Array of data (including keys 'id', 'lang', and 'group') 62 */ 63 public static $notification_option = array( 64 'id' => 'moderation_queue', 65 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', 66 'group' => 'NOTIFICATION_GROUP_POSTING', 67 ); 68 69 /** 70 * Get the HTML formatted title of this notification 71 * 72 * @return string 73 */ 74 public function get_title() 75 { 76 return $this->user->lang($this->language_key); 77 } 78 79 /** 80 * Get the HTML formatted reference of the notification 81 * 82 * @return string 83 */ 84 public function get_reference() 85 { 86 return $this->user->lang( 87 'NOTIFICATION_REFERENCE', 88 censor_text($this->get_data('topic_title')) 89 ); 90 } 91 92 /** 93 * Get the reason for the disapproval notification 94 * 95 * @return string 96 */ 97 public function get_reason() 98 { 99 return $this->user->lang( 100 'NOTIFICATION_REASON', 101 $this->get_data('disapprove_reason') 102 ); 103 } 104 105 /** 106 * Get the url to this item 107 * 108 * @return string URL 109 */ 110 public function get_url() 111 { 112 return ''; 113 } 114 115 /** 116 * Get email template variables 117 * 118 * @return array 119 */ 120 public function get_email_template_variables() 121 { 122 return array_merge(parent::get_email_template_variables(), array( 123 'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason')), 124 )); 125 } 126 127 /** 128 * Function for preparing the data for insertion in an SQL query 129 * (The service handles insertion) 130 * 131 * @param array $post Data from submit_post 132 * @param array $pre_create_data Data from pre_create_insert_array() 133 * 134 * @return array Array of data ready to be inserted into the database 135 */ 136 public function create_insert_array($post, $pre_create_data = array()) 137 { 138 $this->set_data('disapprove_reason', $post['disapprove_reason']); 139 140 $data = parent::create_insert_array($post); 141 142 $this->notification_time = $data['notification_time'] = time(); 143 144 return $data; 145 } 146 147 /** 148 * Get email template 149 * 150 * @return string|bool 151 */ 152 public function get_email_template() 153 { 154 return 'post_disapproved'; 155 } 156 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Jan 11 00:25:41 2018 | Cross-referenced by PHPXref 0.7.1 |