phpBB

Code Changes

File: phpbb/notification/type/report_pm.php

  Unmodified   Added   Modified   Removed
Line 60Line 60
	* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/

	* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/

	static public $notification_option = array(
'id' => 'notification.type.report',
'lang' => 'NOTIFICATION_TYPE_REPORT',

	static public $notification_option = [
'id' => 'notification.type.report_pm',
'lang' => 'NOTIFICATION_TYPE_REPORT_PM',

		'group'	=> 'NOTIFICATION_GROUP_MODERATION',

		'group'	=> 'NOTIFICATION_GROUP_MODERATION',

	);

	];


/**
* Get the id of the parent


/**
* Get the id of the parent

Line 84Line 84
	*/
public function is_available()
{

	*/
public function is_available()
{

		$m_approve = $this->auth->acl_getf($this->permission, true);

return (!empty($m_approve));

		return $this->config['allow_pm_report'] &&
!empty($this->auth->acl_get($this->permission));


	}

	}



 

/**
* Find the users who want to receive notifications


/**
* Find the users who want to receive notifications

Line 99Line 97
	*
* @return array
*/

	*
* @return array
*/

	public function find_users_for_notification($post, $options = array())

	public function find_users_for_notification($post, $options = [])

	{

	{

		$options = array_merge(array(
'ignore_users' => array(),
), $options);

		$options = array_merge([
'ignore_users' => [],
], $options);


// Global
$post['forum_id'] = 0;


// Global
$post['forum_id'] = 0;

Line 112Line 110

if (empty($auth_approve))
{


if (empty($auth_approve))
{

			return array();

			return [];

		}

if (($key = array_search($this->user->data['user_id'], $auth_approve[$post['forum_id']][$this->permission])))

		}

if (($key = array_search($this->user->data['user_id'], $auth_approve[$post['forum_id']][$this->permission])))

Line 120Line 118
			unset($auth_approve[$post['forum_id']][$this->permission][$key]);
}


			unset($auth_approve[$post['forum_id']][$this->permission][$key]);
}


		return $this->check_user_notification_options($auth_approve[$post['forum_id']][$this->permission], array_merge($options, array(

		return $this->check_user_notification_options($auth_approve[$post['forum_id']][$this->permission], array_merge($options, [

			'item_type'		=> static::$notification_option['id'],

			'item_type'		=> static::$notification_option['id'],

		)));

		]));

	}

/**

	}

/**

Line 144Line 142
	{
$user_data = $this->user_loader->get_user($this->get_data('from_user_id'));


	{
$user_data = $this->user_loader->get_user($this->get_data('from_user_id'));


		return array(

		return [

			'AUTHOR_NAME'	=> htmlspecialchars_decode($user_data['username']),
'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),


			'AUTHOR_NAME'	=> htmlspecialchars_decode($user_data['username']),
'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),


Line 152Line 150
			'TOPIC_TITLE'	=> htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),

'U_VIEW_REPORT' => generate_board_url() . "/mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details",

			'TOPIC_TITLE'	=> htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),

'U_VIEW_REPORT' => generate_board_url() . "/mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details",

		);

		];

	}

/**

	}

/**

Line 239Line 237
	*/
public function users_to_query()
{

	*/
public function users_to_query()
{

		return array(

		return [

			$this->get_data('from_user_id'),
$this->get_data('reporter_id'),

			$this->get_data('from_user_id'),
$this->get_data('reporter_id'),

		);	}


		];
}


/**
* {@inheritdoc}
*/


/**
* {@inheritdoc}
*/

	public function create_insert_array($post, $pre_create_data = array())

	public function create_insert_array($post, $pre_create_data = [])

	{
$this->set_data('reporter_id', $this->user->data['user_id']);
$this->set_data('reason_title', strtoupper($post['reason_title']));

	{
$this->set_data('reporter_id', $this->user->data['user_id']);
$this->set_data('reason_title', strtoupper($post['reason_title']));