Completed
Push — 3.2.x ( b3ea69...e83486 )
by Erwan
02:24
created
event/listener.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
 	protected $php_ext;
38 38
 
39 39
 	/**
40
-	* Constructor
41
-	*
42
-	* @param \phpbb\db\driver\driver_interface		$db				Database object
43
-	* @param \phpbb\controller\helper				$helper			Controller helper object
44
-	* @param \phpbb\language\language				$language		Language object
45
-	* @param \phpbb\template\template				$template		Template object
46
-	* @param string									$table_prefix 	prefix table
47
-	* @param string									$php_ext 		phpEx
48
-	* @access public
49
-	*/
40
+	 * Constructor
41
+	 *
42
+	 * @param \phpbb\db\driver\driver_interface		$db				Database object
43
+	 * @param \phpbb\controller\helper				$helper			Controller helper object
44
+	 * @param \phpbb\language\language				$language		Language object
45
+	 * @param \phpbb\template\template				$template		Template object
46
+	 * @param string									$table_prefix 	prefix table
47
+	 * @param string									$php_ext 		phpEx
48
+	 * @access public
49
+	 */
50 50
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, $table_prefix, $php_ext)
51 51
 	{
52 52
 		$this->db			= $db;
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 	}
59 59
 
60 60
 	/**
61
-	* Assign functions defined in this class to event listeners in the core
62
-	*
63
-	* @return	array
64
-	* @static
65
-	* @access	public
66
-	*/
61
+	 * Assign functions defined in this class to event listeners in the core
62
+	 *
63
+	 * @return	array
64
+	 * @static
65
+	 * @access	public
66
+	 */
67 67
 	static public function getSubscribedEvents()
68 68
 	{
69 69
 		return array(
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 	}
77 77
 
78 78
 	/**
79
-	* Display links to Directory
80
-	*
81
-	* @return null
82
-	*/
79
+	 * Display links to Directory
80
+	 *
81
+	 * @return null
82
+	 */
83 83
 	public function add_page_header_variables()
84 84
 	{
85 85
 		$ext_theme_path		= $this->get_ext_name() . '/styles/prosilver/theme/';
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	}
100 100
 
101 101
 	/**
102
-	* Show users as viewing Directory on Who Is Online page
103
-	*
104
-	* @param	object $event The event object
105
-	* @return	null
106
-	*/
102
+	 * Show users as viewing Directory on Who Is Online page
103
+	 *
104
+	 * @param	object $event The event object
105
+	 * @return	null
106
+	 */
107 107
 	public function add_page_viewonline($event)
108 108
 	{
109 109
 		if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0)
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
 	}
115 115
 
116 116
 	/**
117
-	* Load common language files during user setup
118
-	*
119
-	* @param	object $event The event object
120
-	* @return	null
121
-	*/
117
+	 * Load common language files during user setup
118
+	 *
119
+	 * @param	object $event The event object
120
+	 * @return	null
121
+	 */
122 122
 	public function load_language_on_setup($event)
123 123
 	{
124 124
 		$lang_set_ext = $event['lang_set_ext'];
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
 	}
131 131
 
132 132
 	/**
133
-	* Add administrative permissions to manage Directory
134
-	*
135
-	* @param	object $event The event object
136
-	* @return	null
137
-	*/
133
+	 * Add administrative permissions to manage Directory
134
+	 *
135
+	 * @param	object $event The event object
136
+	 * @return	null
137
+	 */
138 138
 	public function permissions_add_directory($event)
139 139
 	{
140 140
 		$event->update_subarray('categories', 'dir',	'ACL_CAT_DIRECTORY');
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
 	}
156 156
 
157 157
 	/**
158
-	* Update Directory tables if needed, after deleted an user
159
-	*
160
-	* @param	object $event The event object
161
-	* @return	null
162
-	*/
158
+	 * Update Directory tables if needed, after deleted an user
159
+	 *
160
+	 * @param	object $event The event object
161
+	 * @return	null
162
+	 */
163 163
 	public function update_links_with_anonymous($event)
164 164
 	{
165 165
 		$user_ids = $event['user_ids'];
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 	*/
50 50
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, $table_prefix, $php_ext)
51 51
 	{
52
-		$this->db			= $db;
53
-		$this->helper 		= $helper;
52
+		$this->db = $db;
53
+		$this->helper = $helper;
54 54
 		$this->language		= $language;
55 55
 		$this->template 	= $template;
56 56
 		$this->table_prefix = $table_prefix;
57
-		$this->php_ext		= $php_ext;
57
+		$this->php_ext = $php_ext;
58 58
 	}
59 59
 
60 60
 	/**
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
 	*/
83 83
 	public function add_page_header_variables()
84 84
 	{
85
-		$ext_theme_path		= $this->get_ext_name() . '/styles/prosilver/theme/';
85
+		$ext_theme_path		= $this->get_ext_name().'/styles/prosilver/theme/';
86 86
 		$theme_lang_path	= $this->language->get_used_language();
87 87
 
88 88
 		// Prevent 'Twig_Error_Loader' if user's lang directory doesn't exist
89
-		if (!file_exists($ext_theme_path . $theme_lang_path . '/directory.css'))
89
+		if (!file_exists($ext_theme_path.$theme_lang_path.'/directory.css'))
90 90
 		{
91 91
 			// Fallback to English language.
92 92
 			$theme_lang_path = \phpbb\language\language::FALLBACK_LANGUAGE;
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 	*/
107 107
 	public function add_page_viewonline($event)
108 108
 	{
109
-		if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0)
109
+		if (strrpos($event['row']['session_page'], 'app.'.$this->php_ext.'/directory') === 0)
110 110
 		{
111
-			$event['location']		= $this->language->lang('DIRECTORY');
112
-			$event['location_url']	= $this->helper->route('ernadoo_phpbbdirectory_base_controller');
111
+			$event['location'] = $this->language->lang('DIRECTORY');
112
+			$event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller');
113 113
 		}
114 114
 	}
115 115
 
@@ -137,21 +137,21 @@  discard block
 block discarded – undo
137 137
 	*/
138 138
 	public function permissions_add_directory($event)
139 139
 	{
140
-		$event->update_subarray('categories', 'dir',	'ACL_CAT_DIRECTORY');
141
-
142
-		$event->update_subarray('permissions', 'm_delete_dir',			array('lang' => 'ACL_M_DELETE_DIR', 		'cat' => 'dir'));
143
-		$event->update_subarray('permissions', 'm_delete_comment_dir',	array('lang' => 'ACL_M_DELETE_COMMENT_DIR',	'cat' => 'dir'));
144
-		$event->update_subarray('permissions', 'm_edit_dir',			array('lang' => 'ACL_M_EDIT_DIR',			'cat' => 'dir'));
145
-		$event->update_subarray('permissions', 'm_edit_comment_dir',	array('lang' => 'ACL_M_EDIT_COMMENT_DIR',	'cat' => 'dir'));
146
-
147
-		$event->update_subarray('permissions', 'u_comment_dir',			array('lang' => 'ACL_U_COMMENT_DIR',		'cat' => 'dir'));
148
-		$event->update_subarray('permissions', 'u_delete_dir',			array('lang' => 'ACL_U_DELETE_DIR',			'cat' => 'dir'));
149
-		$event->update_subarray('permissions', 'u_delete_comment_dir',	array('lang' => 'ACL_U_DELETE_COMMENT_DIR',	'cat' => 'dir'));
150
-		$event->update_subarray('permissions', 'u_edit_dir',			array('lang' => 'ACL_U_EDIT_DIR',			'cat' => 'dir'));
151
-		$event->update_subarray('permissions', 'u_edit_comment_dir',	array('lang' => 'ACL_U_EDIT_COMMENT_DIR',	'cat' => 'dir'));
152
-		$event->update_subarray('permissions', 'u_search_dir',			array('lang' => 'ACL_U_SEARCH_DIR',			'cat' => 'dir'));
153
-		$event->update_subarray('permissions', 'u_submit_dir',			array('lang' => 'ACL_U_SUBMIT_DIR',			'cat' => 'dir'));
154
-		$event->update_subarray('permissions', 'u_vote_dir',			array('lang' => 'ACL_U_VOTE_DIR',			'cat' => 'dir'));
140
+		$event->update_subarray('categories', 'dir', 'ACL_CAT_DIRECTORY');
141
+
142
+		$event->update_subarray('permissions', 'm_delete_dir', array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'));
143
+		$event->update_subarray('permissions', 'm_delete_comment_dir', array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'));
144
+		$event->update_subarray('permissions', 'm_edit_dir', array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'));
145
+		$event->update_subarray('permissions', 'm_edit_comment_dir', array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'));
146
+
147
+		$event->update_subarray('permissions', 'u_comment_dir', array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'));
148
+		$event->update_subarray('permissions', 'u_delete_dir', array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'));
149
+		$event->update_subarray('permissions', 'u_delete_comment_dir', array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'));
150
+		$event->update_subarray('permissions', 'u_edit_dir', array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'));
151
+		$event->update_subarray('permissions', 'u_edit_comment_dir', array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'));
152
+		$event->update_subarray('permissions', 'u_search_dir', array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'));
153
+		$event->update_subarray('permissions', 'u_submit_dir', array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'));
154
+		$event->update_subarray('permissions', 'u_vote_dir', array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'));
155 155
 	}
156 156
 
157 157
 	/**
@@ -169,17 +169,17 @@  discard block
 block discarded – undo
169 169
 			$user_ids = array($user_ids);
170 170
 		}
171 171
 
172
-		$sql = 'UPDATE ' . $this->comments_table . '
173
-			SET comment_user_id = ' . ANONYMOUS . '
172
+		$sql = 'UPDATE '.$this->comments_table.'
173
+			SET comment_user_id = ' . ANONYMOUS.'
174 174
 			WHERE ' . $this->db->sql_in_set('comment_user_id', $user_ids);
175 175
 		$this->db->sql_query($sql);
176 176
 
177
-		$sql = 'UPDATE ' . $this->links_table . '
178
-			SET link_user_id = ' . ANONYMOUS . '
177
+		$sql = 'UPDATE '.$this->links_table.'
178
+			SET link_user_id = ' . ANONYMOUS.'
179 179
 			WHERE ' . $this->db->sql_in_set('link_user_id', $user_ids);
180 180
 		$this->db->sql_query($sql);
181 181
 
182
-		$sql = 'DELETE FROM ' . $this->watch_table . '
182
+		$sql = 'DELETE FROM '.$this->watch_table.'
183 183
 			WHERE ' . $this->db->sql_in_set('user_id', $user_ids);
184 184
 		$this->db->sql_query($sql);
185 185
 	}
Please login to merge, or discard this patch.