@@ -16,34 +16,34 @@ |
||
16 | 16 | interface type_interface |
17 | 17 | { |
18 | 18 | /** |
19 | - * Returns the unique ID of the location. |
|
20 | - * |
|
21 | - * @return string ID of location. |
|
22 | - */ |
|
19 | + * Returns the unique ID of the location. |
|
20 | + * |
|
21 | + * @return string ID of location. |
|
22 | + */ |
|
23 | 23 | public function get_id(); |
24 | 24 | |
25 | 25 | /** |
26 | - * Returns the name of the location. |
|
27 | - * |
|
28 | - * @return string Name of location. |
|
29 | - */ |
|
26 | + * Returns the name of the location. |
|
27 | + * |
|
28 | + * @return string Name of location. |
|
29 | + */ |
|
30 | 30 | public function get_name(); |
31 | 31 | |
32 | 32 | /** |
33 | - * Returns the description of the location. |
|
34 | - * |
|
35 | - * @return string Description of location. |
|
36 | - */ |
|
33 | + * Returns the description of the location. |
|
34 | + * |
|
35 | + * @return string Description of location. |
|
36 | + */ |
|
37 | 37 | public function get_desc(); |
38 | 38 | |
39 | 39 | /** |
40 | - * Returns whether or not this location type will be displayed on a current page. |
|
41 | - * |
|
42 | - * Generally, you can always return true, but if you can narrow down the usage |
|
43 | - * without adding extra load to server, this will further enhance the extension's |
|
44 | - * performance. |
|
45 | - * |
|
46 | - * @return bool True when location type will be displayed on a current page and false if not. |
|
47 | - */ |
|
40 | + * Returns whether or not this location type will be displayed on a current page. |
|
41 | + * |
|
42 | + * Generally, you can always return true, but if you can narrow down the usage |
|
43 | + * without adding extra load to server, this will further enhance the extension's |
|
44 | + * performance. |
|
45 | + * |
|
46 | + * @return bool True when location type will be displayed on a current page and false if not. |
|
47 | + */ |
|
48 | 48 | public function will_display(); |
49 | 49 | } |
@@ -13,31 +13,31 @@ discard block |
||
13 | 13 | class m3_template_locations_schema extends \phpbb\db\migration\migration |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function effectively_installed() |
19 | 19 | { |
20 | 20 | return $this->db_tools->sql_table_exists($this->table_prefix . 'ad_locations'); |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | static public function depends_on() |
27 | 27 | { |
28 | 28 | return array('\phpbb\admanagement\migrations\v10x\m2_acp_module'); |
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
32 | - * Add the ad_locations table schema to the database: |
|
33 | - * ad_locations: |
|
34 | - * ad_location_id |
|
35 | - * ad_id |
|
36 | - * location_id |
|
37 | - * |
|
38 | - * @return array Array of table schema |
|
39 | - * @access public |
|
40 | - */ |
|
32 | + * Add the ad_locations table schema to the database: |
|
33 | + * ad_locations: |
|
34 | + * ad_location_id |
|
35 | + * ad_id |
|
36 | + * location_id |
|
37 | + * |
|
38 | + * @return array Array of table schema |
|
39 | + * @access public |
|
40 | + */ |
|
41 | 41 | public function update_schema() |
42 | 42 | { |
43 | 43 | return array( |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Drop the ad_locations table schema from the database |
|
58 | - * |
|
59 | - * @return array Array of table schema |
|
60 | - * @access public |
|
61 | - */ |
|
57 | + * Drop the ad_locations table schema from the database |
|
58 | + * |
|
59 | + * @return array Array of table schema |
|
60 | + * @access public |
|
61 | + */ |
|
62 | 62 | public function revert_schema() |
63 | 63 | { |
64 | 64 | return array( |
@@ -13,30 +13,30 @@ discard block |
||
13 | 13 | class manager |
14 | 14 | { |
15 | 15 | /** |
16 | - * Array that contains all available template location types which are passed |
|
17 | - * via the service container |
|
18 | - * @var array |
|
19 | - */ |
|
16 | + * Array that contains all available template location types which are passed |
|
17 | + * via the service container |
|
18 | + * @var array |
|
19 | + */ |
|
20 | 20 | protected $template_locations; |
21 | 21 | |
22 | 22 | /** |
23 | - * Construct an template locations manager object |
|
24 | - * |
|
25 | - * @param array $template_locations Template location types passed via the service container |
|
26 | - */ |
|
23 | + * Construct an template locations manager object |
|
24 | + * |
|
25 | + * @param array $template_locations Template location types passed via the service container |
|
26 | + */ |
|
27 | 27 | public function __construct($template_locations) |
28 | 28 | { |
29 | 29 | $this->register_template_locations($template_locations); |
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | - * Get a list of all template location types |
|
34 | - * |
|
35 | - * Returns an associated array where key is the location id |
|
36 | - * and value is array of location name and location description. |
|
37 | - * |
|
38 | - * @return array Array containing a list of all template locations |
|
39 | - */ |
|
33 | + * Get a list of all template location types |
|
34 | + * |
|
35 | + * Returns an associated array where key is the location id |
|
36 | + * and value is array of location name and location description. |
|
37 | + * |
|
38 | + * @return array Array containing a list of all template locations |
|
39 | + */ |
|
40 | 40 | public function get_all_locations() |
41 | 41 | { |
42 | 42 | $location_types = array(); |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | - * Get a list of all template location IDs for display |
|
57 | - * |
|
58 | - * @return array Array containing a list of all template location IDs |
|
59 | - */ |
|
56 | + * Get a list of all template location IDs for display |
|
57 | + * |
|
58 | + * @return array Array containing a list of all template location IDs |
|
59 | + */ |
|
60 | 60 | public function get_all_location_ids() |
61 | 61 | { |
62 | 62 | $template_locations = array(); |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * Register template locations |
|
77 | - * |
|
78 | - * @param array $template_locations Template location types passed via the service container |
|
79 | - */ |
|
76 | + * Register template locations |
|
77 | + * |
|
78 | + * @param array $template_locations Template location types passed via the service container |
|
79 | + */ |
|
80 | 80 | protected function register_template_locations($template_locations) |
81 | 81 | { |
82 | 82 | if (!empty($template_locations)) |
@@ -21,7 +21,6 @@ |
||
21 | 21 | /** |
22 | 22 | * Construct an after_profile template location object |
23 | 23 | * |
24 | - * @param \phpbb\user $config User object |
|
25 | 24 | */ |
26 | 25 | public function __construct(\phpbb\user $user) |
27 | 26 | { |
@@ -16,40 +16,40 @@ |
||
16 | 16 | abstract class base implements \phpbb\admanagement\location\type\type_interface |
17 | 17 | { |
18 | 18 | /** |
19 | - * User object |
|
20 | - * @var \phpbb\user |
|
21 | - */ |
|
19 | + * User object |
|
20 | + * @var \phpbb\user |
|
21 | + */ |
|
22 | 22 | protected $user; |
23 | 23 | |
24 | 24 | /** |
25 | - * Construct an after_profile template location object |
|
26 | - * |
|
27 | - * @param \phpbb\user $config User object |
|
28 | - */ |
|
25 | + * Construct an after_profile template location object |
|
26 | + * |
|
27 | + * @param \phpbb\user $config User object |
|
28 | + */ |
|
29 | 29 | public function __construct(\phpbb\user $user) |
30 | 30 | { |
31 | 31 | $this->user = $user; |
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | - * {@inheritDoc} |
|
36 | - */ |
|
35 | + * {@inheritDoc} |
|
36 | + */ |
|
37 | 37 | public function get_name() |
38 | 38 | { |
39 | 39 | return $this->user->lang('AD_' . strtoupper($this->get_id())); |
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * {@inheritDoc} |
|
44 | - */ |
|
43 | + * {@inheritDoc} |
|
44 | + */ |
|
45 | 45 | public function get_desc() |
46 | 46 | { |
47 | 47 | return $this->user->lang('AD_' . strtoupper($this->get_id()) . '_DESC'); |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * {@inheritDoc} |
|
52 | - */ |
|
51 | + * {@inheritDoc} |
|
52 | + */ |
|
53 | 53 | public function will_display() |
54 | 54 | { |
55 | 55 | return true; |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | protected $ad_locations_table; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor |
|
26 | - * |
|
27 | - * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
28 | - * @param string $ads_table Ads table |
|
29 | - * @param string $ad_locations_table Ad locations table |
|
30 | - */ |
|
25 | + * Constructor |
|
26 | + * |
|
27 | + * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
28 | + * @param string $ads_table Ads table |
|
29 | + * @param string $ad_locations_table Ad locations table |
|
30 | + */ |
|
31 | 31 | public function __construct(\phpbb\db\driver\driver_interface $db, $ads_table, $ad_locations_table) |
32 | 32 | { |
33 | 33 | $this->db = $db; |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * Get specific ad |
|
40 | - * |
|
41 | - * @param int $ad_id Advertisement ID |
|
42 | - * @return array Advertisement data |
|
43 | - */ |
|
39 | + * Get specific ad |
|
40 | + * |
|
41 | + * @param int $ad_id Advertisement ID |
|
42 | + * @return array Advertisement data |
|
43 | + */ |
|
44 | 44 | public function get_ad($ad_id) |
45 | 45 | { |
46 | 46 | $sql = 'SELECT * |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Get one ad per every location |
|
58 | - * |
|
59 | - * @param array $ad_locations List of ad locations to fetch ads for |
|
60 | - * @return array List of ad codes for each location |
|
61 | - */ |
|
57 | + * Get one ad per every location |
|
58 | + * |
|
59 | + * @param array $ad_locations List of ad locations to fetch ads for |
|
60 | + * @return array List of ad codes for each location |
|
61 | + */ |
|
62 | 62 | public function get_ads($ad_locations) |
63 | 63 | { |
64 | 64 | $sql = 'SELECT location_id, ad_code |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | - * Get all advertisements |
|
84 | - * |
|
85 | - * @return array List of all ads |
|
86 | - */ |
|
83 | + * Get all advertisements |
|
84 | + * |
|
85 | + * @return array List of all ads |
|
86 | + */ |
|
87 | 87 | public function get_all_ads() |
88 | 88 | { |
89 | 89 | $sql = 'SELECT ad_id, ad_name, ad_enabled |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * Insert new advertisement to the database |
|
100 | - * |
|
101 | - * @param array $data New ad data |
|
102 | - * @return int New advertisement ID |
|
103 | - */ |
|
99 | + * Insert new advertisement to the database |
|
100 | + * |
|
101 | + * @param array $data New ad data |
|
102 | + * @return int New advertisement ID |
|
103 | + */ |
|
104 | 104 | public function insert_ad($data) |
105 | 105 | { |
106 | 106 | $data = $this->intersect_ad_data($data); |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
115 | - * Update advertisement |
|
116 | - * |
|
117 | - * @param int $ad_id Advertisement ID |
|
118 | - * @param array $data List of data to update in the database |
|
119 | - * @return int Number of affected rows. Can be used to determine if any ad has been udated. |
|
120 | - */ |
|
115 | + * Update advertisement |
|
116 | + * |
|
117 | + * @param int $ad_id Advertisement ID |
|
118 | + * @param array $data List of data to update in the database |
|
119 | + * @return int Number of affected rows. Can be used to determine if any ad has been udated. |
|
120 | + */ |
|
121 | 121 | public function update_ad($ad_id, $data) |
122 | 122 | { |
123 | 123 | $data = $this->intersect_ad_data($data); |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
134 | - * Delete advertisement |
|
135 | - * |
|
136 | - * @param int $ad_id Advertisement ID |
|
137 | - * @return int Number of affected rows. Can be used to determine if any ad has been deleted. |
|
138 | - */ |
|
134 | + * Delete advertisement |
|
135 | + * |
|
136 | + * @param int $ad_id Advertisement ID |
|
137 | + * @return int Number of affected rows. Can be used to determine if any ad has been deleted. |
|
138 | + */ |
|
139 | 139 | public function delete_ad($ad_id) |
140 | 140 | { |
141 | 141 | $sql = 'DELETE FROM ' . $this->ads_table . ' |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
149 | - * Get all locations for specified advertisement |
|
150 | - * |
|
151 | - * @param int $ad_id Advertisement ID |
|
152 | - * @return array List of template locations for specified ad |
|
153 | - */ |
|
149 | + * Get all locations for specified advertisement |
|
150 | + * |
|
151 | + * @param int $ad_id Advertisement ID |
|
152 | + * @return array List of template locations for specified ad |
|
153 | + */ |
|
154 | 154 | public function get_ad_locations($ad_id) |
155 | 155 | { |
156 | 156 | $ad_locations = array(); |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
172 | - * Insert advertisement locations |
|
173 | - * |
|
174 | - * @param int $ad_id Advertisement ID |
|
175 | - * @param array $ad_locations List of template locations for this ad |
|
176 | - * @return void |
|
177 | - */ |
|
172 | + * Insert advertisement locations |
|
173 | + * |
|
174 | + * @param int $ad_id Advertisement ID |
|
175 | + * @param array $ad_locations List of template locations for this ad |
|
176 | + * @return void |
|
177 | + */ |
|
178 | 178 | public function insert_ad_locations($ad_id, $ad_locations) |
179 | 179 | { |
180 | 180 | $sql_ary = array(); |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
192 | - * Delete advertisement locations |
|
193 | - * |
|
194 | - * @param int $ad_id Advertisement ID |
|
195 | - * @return void |
|
196 | - */ |
|
192 | + * Delete advertisement locations |
|
193 | + * |
|
194 | + * @param int $ad_id Advertisement ID |
|
195 | + * @return void |
|
196 | + */ |
|
197 | 197 | public function delete_ad_locations($ad_id) |
198 | 198 | { |
199 | 199 | $sql = 'DELETE FROM ' . $this->ad_locations_table . ' |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
205 | - * Make sure only necessary data make their way to SQL query |
|
206 | - * |
|
207 | - * @param array $data List of data to query the database |
|
208 | - * @return array Cleaned data that contain only valid keys |
|
209 | - */ |
|
205 | + * Make sure only necessary data make their way to SQL query |
|
206 | + * |
|
207 | + * @param array $data List of data to query the database |
|
208 | + * @return array Cleaned data that contain only valid keys |
|
209 | + */ |
|
210 | 210 | protected function intersect_ad_data($data) |
211 | 211 | { |
212 | 212 | return array_intersect_key($data, array( |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | /** |
221 | - * Get the random statement for this database layer |
|
222 | - * |
|
223 | - * @return string Random statement for current database layer |
|
224 | - */ |
|
221 | + * Get the random statement for this database layer |
|
222 | + * |
|
223 | + * @return string Random statement for current database layer |
|
224 | + */ |
|
225 | 225 | protected function sql_random() |
226 | 226 | { |
227 | 227 | switch ($this->db->get_sql_layer()) |
@@ -13,8 +13,8 @@ |
||
13 | 13 | class above_footer extends base |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function get_id() |
19 | 19 | { |
20 | 20 | return 'above_footer'; |
@@ -13,16 +13,16 @@ |
||
13 | 13 | class before_posts extends base |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function get_id() |
19 | 19 | { |
20 | 20 | return 'before_posts'; |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | public function will_display() |
27 | 27 | { |
28 | 28 | return strpos($this->user->page['page_name'], 'viewtopic') !== false; |
@@ -13,8 +13,8 @@ |
||
13 | 13 | class above_header extends base |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function get_id() |
19 | 19 | { |
20 | 20 | return 'above_header'; |
@@ -13,16 +13,16 @@ |
||
13 | 13 | class after_posts extends base |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function get_id() |
19 | 19 | { |
20 | 20 | return 'after_posts'; |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | public function will_display() |
27 | 27 | { |
28 | 28 | return strpos($this->user->page['page_name'], 'viewtopic') !== false; |