Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
report_handler.php
001 <?php
002 /**
003 *
004 * This file is part of the phpBB Forum Software package.
005 *
006 * @copyright (c) phpBB Limited <https://www.phpbb.com>
007 * @license GNU General Public License, version 2 (GPL-2.0)
008 *
009 * For full copyright and license information, please see
010 * the docs/CREDITS.txt file.
011 *
012 */
013
014 namespace phpbb\report;
015
016 abstract class report_handler implements report_handler_interface
017 {
018 /**
019 * @var \phpbb\db\driver\driver_interface
020 */
021 protected $db;
022
023 /**
024 * @var \phpbb\event\dispatcher_interface
025 */
026 protected $dispatcher;
027
028 /**
029 * @var \phpbb\config\config
030 */
031 protected $config;
032
033 /**
034 * @var \phpbb\auth\auth
035 */
036 protected $auth;
037
038 /**
039 * @var \phpbb\user
040 */
041 protected $user;
042
043 /**
044 * @var \phpbb\notification\manager
045 */
046 protected $notifications;
047
048 /**
049 * @var array
050 */
051 protected $report_data;
052
053 /**
054 * Construtor
055 *
056 * @param \phpbb\db\driver\driver_interface $db
057 * @param \phpbb\event\dispatcher_interface $dispatcher
058 * @param \phpbb\config\db $config
059 * @param \phpbb\auth\auth $auth
060 * @param \phpbb\user $user
061 * @param \phpbb\notification\manager $notification
062 */
063 public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user, \phpbb\notification\manager $notification)
064 {
065 $this->db = $db;
066 $this->dispatcher = $dispatcher;
067 $this->config = $config;
068 $this->auth = $auth;
069 $this->user = $user;
070 $this->notifications = $notification;
071 $this->report_data = array();
072 }
073
074 /**
075 * Creates a report entity in the database
076 *
077 * @param array $report_data
078 * @return int the ID of the created entity
079 */
080 protected function create_report(array $report_data)
081 {
082 $sql_ary = array(
083 'reason_id' => (int) $report_data['reason_id'],
084 'post_id' => $report_data['post_id'],
085 'pm_id' => $report_data['pm_id'],
086 'user_id' => (int) $this->user->data['user_id'],
087 'user_notify' => (int) $report_data['user_notify'],
088 'report_closed' => 0,
089 'report_time' => (int) time(),
090 'report_text' => (string) $report_data['report_text'],
091 'reported_post_text' => $report_data['reported_post_text'],
092 'reported_post_uid' => $report_data['reported_post_uid'],
093 'reported_post_bitfield' => $report_data['reported_post_bitfield'],
094 'reported_post_enable_bbcode' => $report_data['reported_post_enable_bbcode'],
095 'reported_post_enable_smilies' => $report_data['reported_post_enable_smilies'],
096 'reported_post_enable_magic_url' => $report_data['reported_post_enable_magic_url'],
097 );
098
099 $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
100 $this->db->sql_query($sql);
101
102 return $this->db->sql_nextid();
103 }
104 }
105