Completed
Push — 3.3.x ( d2eb4d...21c685 )
by Erwan
02:30
created
core/helper.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -37,37 +37,37 @@  discard block
 block discarded – undo
37 37
 	private $ext_name = 'ernadoo/phpbbdirectory';
38 38
 
39 39
 	/**
40
-	* Set the extension manager
41
-	*
42
-	* @param \phpbb\extension\manager	$phpbb_extension_manager
43
-	* @return null
44
-	*/
40
+	 * Set the extension manager
41
+	 *
42
+	 * @param \phpbb\extension\manager	$phpbb_extension_manager
43
+	 * @return null
44
+	 */
45 45
 	public function set_extension_manager(\phpbb\extension\manager $phpbb_extension_manager)
46 46
 	{
47 47
 		$this->extension_manager	= $phpbb_extension_manager;
48 48
 	}
49 49
 
50 50
 	/**
51
-	* Set the path helper
52
-	*
53
-	* @param \phpbb\path_helper	$path_helper
54
-	* @return null
55
-	*/
51
+	 * Set the path helper
52
+	 *
53
+	 * @param \phpbb\path_helper	$path_helper
54
+	 * @return null
55
+	 */
56 56
 	public function set_path_helper(\phpbb\path_helper $path_helper)
57 57
 	{
58 58
 		$this->path_helper = $path_helper;
59 59
 	}
60 60
 
61 61
 	/**
62
-	* Set the tables names
63
-	*
64
-	* @param string	$categories_table
65
-	* @param string	$comments_table
66
-	* @param string	$links_table
67
-	* @param string	$votes_table
68
-	* @param string	$watch_table
69
-	* @return null
70
-	*/
62
+	 * Set the tables names
63
+	 *
64
+	 * @param string	$categories_table
65
+	 * @param string	$comments_table
66
+	 * @param string	$links_table
67
+	 * @param string	$votes_table
68
+	 * @param string	$watch_table
69
+	 * @return null
70
+	 */
71 71
 	public function set_tables($categories_table, $comments_table, $links_table, $votes_table, $watch_table)
72 72
 	{
73 73
 		$this->comments_table		= $comments_table;
@@ -77,48 +77,48 @@  discard block
 block discarded – undo
77 77
 		$this->categories_table		= $categories_table;
78 78
 	}
79 79
 	/**
80
-	* Return ext name
81
-	*
82
-	* @param	bool	$web_root_path Whether the path should be relative to web root
83
-	* @return	string					Path to an extension
84
-	*/
80
+	 * Return ext name
81
+	 *
82
+	 * @param	bool	$web_root_path Whether the path should be relative to web root
83
+	 * @return	string					Path to an extension
84
+	 */
85 85
 	public function get_ext_name($web_root_path = false)
86 86
 	{
87 87
 		return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name);
88 88
 	}
89 89
 
90 90
 	/**
91
-	* Return path to resource image
92
-	*
93
-	* @param	string $type	is ressource type (flags|icons)
94
-	* @param	string $image	is the resource to display
95
-	* @return	string			The relative path to ressource
96
-	*/
91
+	 * Return path to resource image
92
+	 *
93
+	 * @param	string $type	is ressource type (flags|icons)
94
+	 * @param	string $image	is the resource to display
95
+	 * @return	string			The relative path to ressource
96
+	 */
97 97
 	public function get_img_path($type, $image = '')
98 98
 	{
99 99
 		return $this->get_ext_name(true) . 'images/' . $type . '/' . $image;
100 100
 	}
101 101
 
102 102
 	/**
103
-	* Return path to banner
104
-	*
105
-	* @param	string	$banner	is the physical name
106
-	* @return	string			The relative path to banner
107
-	*/
103
+	 * Return path to banner
104
+	 *
105
+	 * @param	string	$banner	is the physical name
106
+	 * @return	string			The relative path to banner
107
+	 */
108 108
 	public function get_banner_path($banner = '')
109 109
 	{
110 110
 		return 'files/' . $this->get_ext_name() . 'banners/' . $banner;
111 111
 	}
112 112
 
113 113
 	/**
114
-	* Return array entries that match the pattern
115
-	*
116
-	* @link http://php.net/manual/fr/function.preg-grep.php#95787
117
-	*
118
-	* @param 	string	$pattern	The pattern to search for
119
-	* @param	array	$input		The input array
120
-	* @return	array	$vals		Returns an array indexed using the keys from the input array
121
-	*/
114
+	 * Return array entries that match the pattern
115
+	 *
116
+	 * @link http://php.net/manual/fr/function.preg-grep.php#95787
117
+	 *
118
+	 * @param 	string	$pattern	The pattern to search for
119
+	 * @param	array	$input		The input array
120
+	 * @return	array	$vals		Returns an array indexed using the keys from the input array
121
+	 */
122 122
 	public function preg_grep_keys($pattern, $input)
123 123
 	{
124 124
 		$keys = preg_grep($pattern, array_keys($input));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	*/
45 45
 	public function set_extension_manager(\phpbb\extension\manager $phpbb_extension_manager)
46 46
 	{
47
-		$this->extension_manager	= $phpbb_extension_manager;
47
+		$this->extension_manager = $phpbb_extension_manager;
48 48
 	}
49 49
 
50 50
 	/**
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 	*/
71 71
 	public function set_tables($categories_table, $comments_table, $links_table, $votes_table, $watch_table)
72 72
 	{
73
-		$this->comments_table		= $comments_table;
73
+		$this->comments_table = $comments_table;
74 74
 		$this->links_table			= $links_table;
75 75
 		$this->votes_table			= $votes_table;
76 76
 		$this->watch_table			= $watch_table;
77
-		$this->categories_table		= $categories_table;
77
+		$this->categories_table = $categories_table;
78 78
 	}
79 79
 	/**
80 80
 	* Return ext name
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	*/
85 85
 	public function get_ext_name($web_root_path = false)
86 86
 	{
87
-		return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name);
87
+		return (($web_root_path) ? $this->path_helper->get_web_root_path() : '').$this->extension_manager->get_extension_path($this->ext_name);
88 88
 	}
89 89
 
90 90
 	/**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	*/
97 97
 	public function get_img_path($type, $image = '')
98 98
 	{
99
-		return $this->get_ext_name(true) . 'images/' . $type . '/' . $image;
99
+		return $this->get_ext_name(true).'images/'.$type.'/'.$image;
100 100
 	}
101 101
 
102 102
 	/**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	*/
108 108
 	public function get_banner_path($banner = '')
109 109
 	{
110
-		return 'files/' . $this->get_ext_name() . 'banners/' . $banner;
110
+		return 'files/'.$this->get_ext_name().'banners/'.$banner;
111 111
 	}
112 112
 
113 113
 	/**
Please login to merge, or discard this patch.
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.