@@ -13,16 +13,16 @@ |
||
| 13 | 13 | class after_not_first_post extends base |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function get_id() |
| 19 | 19 | { |
| 20 | 20 | return 'after_not_first_post'; |
| 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 below_footer extends base |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function get_id() |
| 19 | 19 | { |
| 20 | 20 | return 'below_footer'; |
@@ -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 mixed Array with advertisement data, false if ad doesn't exist |
|
| 43 | - */ |
|
| 39 | + * Get specific ad |
|
| 40 | + * |
|
| 41 | + * @param int $ad_id Advertisement ID |
|
| 42 | + * @return mixed Array with advertisement data, false if ad doesn't exist |
|
| 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 |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | - * Get all advertisements |
|
| 86 | - * |
|
| 87 | - * @return array List of all ads |
|
| 88 | - */ |
|
| 85 | + * Get all advertisements |
|
| 86 | + * |
|
| 87 | + * @return array List of all ads |
|
| 88 | + */ |
|
| 89 | 89 | public function get_all_ads() |
| 90 | 90 | { |
| 91 | 91 | $sql = 'SELECT ad_id, ad_name, ad_enabled, ad_end_date |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | - * Insert new advertisement to the database |
|
| 102 | - * |
|
| 103 | - * @param array $data New ad data |
|
| 104 | - * @return int New advertisement ID |
|
| 105 | - */ |
|
| 101 | + * Insert new advertisement to the database |
|
| 102 | + * |
|
| 103 | + * @param array $data New ad data |
|
| 104 | + * @return int New advertisement ID |
|
| 105 | + */ |
|
| 106 | 106 | public function insert_ad($data) |
| 107 | 107 | { |
| 108 | 108 | $data = $this->intersect_ad_data($data); |
@@ -114,12 +114,12 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | - * Update advertisement |
|
| 118 | - * |
|
| 119 | - * @param int $ad_id Advertisement ID |
|
| 120 | - * @param array $data List of data to update in the database |
|
| 121 | - * @return int Number of affected rows. Can be used to determine if any ad has been updated. |
|
| 122 | - */ |
|
| 117 | + * Update advertisement |
|
| 118 | + * |
|
| 119 | + * @param int $ad_id Advertisement ID |
|
| 120 | + * @param array $data List of data to update in the database |
|
| 121 | + * @return int Number of affected rows. Can be used to determine if any ad has been updated. |
|
| 122 | + */ |
|
| 123 | 123 | public function update_ad($ad_id, $data) |
| 124 | 124 | { |
| 125 | 125 | $data = $this->intersect_ad_data($data); |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | - * Delete advertisement |
|
| 137 | - * |
|
| 138 | - * @param int $ad_id Advertisement ID |
|
| 139 | - * @return int Number of affected rows. Can be used to determine if any ad has been deleted. |
|
| 140 | - */ |
|
| 136 | + * Delete advertisement |
|
| 137 | + * |
|
| 138 | + * @param int $ad_id Advertisement ID |
|
| 139 | + * @return int Number of affected rows. Can be used to determine if any ad has been deleted. |
|
| 140 | + */ |
|
| 141 | 141 | public function delete_ad($ad_id) |
| 142 | 142 | { |
| 143 | 143 | $sql = 'DELETE FROM ' . $this->ads_table . ' |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | - * Get all locations for specified advertisement |
|
| 152 | - * |
|
| 153 | - * @param int $ad_id Advertisement ID |
|
| 154 | - * @return array List of template locations for specified ad |
|
| 155 | - */ |
|
| 151 | + * Get all locations for specified advertisement |
|
| 152 | + * |
|
| 153 | + * @param int $ad_id Advertisement ID |
|
| 154 | + * @return array List of template locations for specified ad |
|
| 155 | + */ |
|
| 156 | 156 | public function get_ad_locations($ad_id) |
| 157 | 157 | { |
| 158 | 158 | $ad_locations = array(); |
@@ -171,12 +171,12 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * Insert advertisement locations |
|
| 175 | - * |
|
| 176 | - * @param int $ad_id Advertisement ID |
|
| 177 | - * @param array $ad_locations List of template locations for this ad |
|
| 178 | - * @return void |
|
| 179 | - */ |
|
| 174 | + * Insert advertisement locations |
|
| 175 | + * |
|
| 176 | + * @param int $ad_id Advertisement ID |
|
| 177 | + * @param array $ad_locations List of template locations for this ad |
|
| 178 | + * @return void |
|
| 179 | + */ |
|
| 180 | 180 | public function insert_ad_locations($ad_id, $ad_locations) |
| 181 | 181 | { |
| 182 | 182 | $sql_ary = array(); |
@@ -191,11 +191,11 @@ discard block |
||
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | - * Delete advertisement locations |
|
| 195 | - * |
|
| 196 | - * @param int $ad_id Advertisement ID |
|
| 197 | - * @return void |
|
| 198 | - */ |
|
| 194 | + * Delete advertisement locations |
|
| 195 | + * |
|
| 196 | + * @param int $ad_id Advertisement ID |
|
| 197 | + * @return void |
|
| 198 | + */ |
|
| 199 | 199 | public function delete_ad_locations($ad_id) |
| 200 | 200 | { |
| 201 | 201 | $sql = 'DELETE FROM ' . $this->ad_locations_table . ' |
@@ -204,11 +204,11 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
| 207 | - * Load memberships of the user |
|
| 208 | - * |
|
| 209 | - * @param int $user_id User ID to load memberships |
|
| 210 | - * @return array List of group IDs user is member of |
|
| 211 | - */ |
|
| 207 | + * Load memberships of the user |
|
| 208 | + * |
|
| 209 | + * @param int $user_id User ID to load memberships |
|
| 210 | + * @return array List of group IDs user is member of |
|
| 211 | + */ |
|
| 212 | 212 | public function load_memberships($user_id) |
| 213 | 213 | { |
| 214 | 214 | $memberships = array(); |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | - * Load all board groups |
|
| 230 | - * |
|
| 231 | - * @return array List of groups |
|
| 232 | - */ |
|
| 229 | + * Load all board groups |
|
| 230 | + * |
|
| 231 | + * @return array List of groups |
|
| 232 | + */ |
|
| 233 | 233 | public function load_groups() |
| 234 | 234 | { |
| 235 | 235 | $sql = 'SELECT group_id, group_name, group_type |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | - * Make sure only necessary data make their way to SQL query |
|
| 247 | - * |
|
| 248 | - * @param array $data List of data to query the database |
|
| 249 | - * @return array Cleaned data that contain only valid keys |
|
| 250 | - */ |
|
| 246 | + * Make sure only necessary data make their way to SQL query |
|
| 247 | + * |
|
| 248 | + * @param array $data List of data to query the database |
|
| 249 | + * @return array Cleaned data that contain only valid keys |
|
| 250 | + */ |
|
| 251 | 251 | protected function intersect_ad_data($data) |
| 252 | 252 | { |
| 253 | 253 | return array_intersect_key($data, array( |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
| 263 | - * Get the random statement for this database layer |
|
| 264 | - * |
|
| 265 | - * @return string Random statement for current database layer |
|
| 266 | - */ |
|
| 263 | + * Get the random statement for this database layer |
|
| 264 | + * |
|
| 265 | + * @return string Random statement for current database layer |
|
| 266 | + */ |
|
| 267 | 267 | protected function sql_random() |
| 268 | 268 | { |
| 269 | 269 | switch ($this->db->get_sql_layer()) |
@@ -16,33 +16,33 @@ discard block |
||
| 16 | 16 | class m1_initial_schema extends \phpbb\db\migration\migration |
| 17 | 17 | { |
| 18 | 18 | /** |
| 19 | - * {@inheritDoc} |
|
| 20 | - */ |
|
| 19 | + * {@inheritDoc} |
|
| 20 | + */ |
|
| 21 | 21 | public function effectively_installed() |
| 22 | 22 | { |
| 23 | 23 | return $this->db_tools->sql_table_exists($this->table_prefix . 'ads'); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * {@inheritDoc} |
|
| 28 | - */ |
|
| 27 | + * {@inheritDoc} |
|
| 28 | + */ |
|
| 29 | 29 | static public function depends_on() |
| 30 | 30 | { |
| 31 | 31 | return array('\phpbb\db\migration\data\v31x\v316'); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Add the ads table schema to the database: |
|
| 36 | - * ads: |
|
| 37 | - * ad_id |
|
| 38 | - * ad_name |
|
| 39 | - * ad_note |
|
| 40 | - * ad_code |
|
| 41 | - * ad_enabled |
|
| 42 | - * |
|
| 43 | - * @return array Array of table schema |
|
| 44 | - * @access public |
|
| 45 | - */ |
|
| 35 | + * Add the ads table schema to the database: |
|
| 36 | + * ads: |
|
| 37 | + * ad_id |
|
| 38 | + * ad_name |
|
| 39 | + * ad_note |
|
| 40 | + * ad_code |
|
| 41 | + * ad_enabled |
|
| 42 | + * |
|
| 43 | + * @return array Array of table schema |
|
| 44 | + * @access public |
|
| 45 | + */ |
|
| 46 | 46 | public function update_schema() |
| 47 | 47 | { |
| 48 | 48 | return array( |
@@ -62,11 +62,11 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * Drop the ads table schema from the database |
|
| 66 | - * |
|
| 67 | - * @return array Array of table schema |
|
| 68 | - * @access public |
|
| 69 | - */ |
|
| 65 | + * Drop the ads table schema from the database |
|
| 66 | + * |
|
| 67 | + * @return array Array of table schema |
|
| 68 | + * @access public |
|
| 69 | + */ |
|
| 70 | 70 | public function revert_schema() |
| 71 | 71 | { |
| 72 | 72 | return array( |
@@ -13,16 +13,16 @@ discard block |
||
| 13 | 13 | class m4_indexes 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_index_exists($this->table_prefix . 'ads', 'ad_enabled'); |
| 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( |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Add the indexes |
|
| 36 | - * |
|
| 37 | - * @return array Array of altered table schema |
|
| 38 | - * @access public |
|
| 39 | - */ |
|
| 35 | + * Add the indexes |
|
| 36 | + * |
|
| 37 | + * @return array Array of altered table schema |
|
| 38 | + * @access public |
|
| 39 | + */ |
|
| 40 | 40 | public function update_schema() |
| 41 | 41 | { |
| 42 | 42 | return array( |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Drop the indexes |
|
| 56 | - * |
|
| 57 | - * @return array Array of altered table schema |
|
| 58 | - * @access public |
|
| 59 | - */ |
|
| 55 | + * Drop the indexes |
|
| 56 | + * |
|
| 57 | + * @return array Array of altered table schema |
|
| 58 | + * @access public |
|
| 59 | + */ |
|
| 60 | 60 | public function revert_schema() |
| 61 | 61 | { |
| 62 | 62 | return array( |
@@ -16,40 +16,40 @@ |
||
| 16 | 16 | abstract class base implements \phpbb\ads\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 $user User object |
|
| 28 | - */ |
|
| 25 | + * Construct an after_profile template location object |
|
| 26 | + * |
|
| 27 | + * @param \phpbb\user $user 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; |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | class m2_acp_module 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 | $sql = 'SELECT module_id |
@@ -29,18 +29,18 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * {@inheritDoc} |
|
| 33 | - */ |
|
| 32 | + * {@inheritDoc} |
|
| 33 | + */ |
|
| 34 | 34 | static public function depends_on() |
| 35 | 35 | { |
| 36 | 36 | return array('\phpbb\ads\migrations\v10x\m1_initial_schema'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * Add the ACP module |
|
| 41 | - * |
|
| 42 | - * @return array Array of data update instructions |
|
| 43 | - */ |
|
| 40 | + * Add the ACP module |
|
| 41 | + * |
|
| 42 | + * @return array Array of data update instructions |
|
| 43 | + */ |
|
| 44 | 44 | public function update_data() |
| 45 | 45 | { |
| 46 | 46 | return array( |
@@ -52,18 +52,18 @@ discard block |
||
| 52 | 52 | protected $errors = array(); |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Constructor |
|
| 56 | - * |
|
| 57 | - * @param \phpbb\template\template $template Template object |
|
| 58 | - * @param \phpbb\user $user User object |
|
| 59 | - * @param \phpbb\request\request $request Request object |
|
| 60 | - * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
| 61 | - * @param \phpbb\ads\location\manager $location_manager Template location manager object |
|
| 62 | - * @param \phpbb\log\log $log The phpBB log system |
|
| 63 | - * @param \phpbb\config\db_text $config_text Config text object |
|
| 64 | - * @param string $php_ext PHP extension |
|
| 65 | - * @param string $ext_path Path to this extension |
|
| 66 | - */ |
|
| 55 | + * Constructor |
|
| 56 | + * |
|
| 57 | + * @param \phpbb\template\template $template Template object |
|
| 58 | + * @param \phpbb\user $user User object |
|
| 59 | + * @param \phpbb\request\request $request Request object |
|
| 60 | + * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
| 61 | + * @param \phpbb\ads\location\manager $location_manager Template location manager object |
|
| 62 | + * @param \phpbb\log\log $log The phpBB log system |
|
| 63 | + * @param \phpbb\config\db_text $config_text Config text object |
|
| 64 | + * @param string $php_ext PHP extension |
|
| 65 | + * @param string $ext_path Path to this extension |
|
| 66 | + */ |
|
| 67 | 67 | public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, \phpbb\ads\ad\manager $manager, \phpbb\ads\location\manager $location_manager, \phpbb\log\log $log, \phpbb\config\db_text $config_text, $php_ext, $ext_path) |
| 68 | 68 | { |
| 69 | 69 | $this->template = $template; |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | - * Process user request for manage mode |
|
| 82 | - * |
|
| 83 | - * @return void |
|
| 84 | - */ |
|
| 81 | + * Process user request for manage mode |
|
| 82 | + * |
|
| 83 | + * @return void |
|
| 84 | + */ |
|
| 85 | 85 | public function mode_manage() |
| 86 | 86 | { |
| 87 | 87 | $this->setup(); |
@@ -98,10 +98,10 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | - * Process user request for settings mode |
|
| 102 | - * |
|
| 103 | - * @return void |
|
| 104 | - */ |
|
| 101 | + * Process user request for settings mode |
|
| 102 | + * |
|
| 103 | + * @return void |
|
| 104 | + */ |
|
| 105 | 105 | public function mode_settings() |
| 106 | 106 | { |
| 107 | 107 | $this->setup(); |
@@ -143,31 +143,31 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | - * Set page url |
|
| 147 | - * |
|
| 148 | - * @param string $u_action Custom form action |
|
| 149 | - * @return void |
|
| 150 | - */ |
|
| 146 | + * Set page url |
|
| 147 | + * |
|
| 148 | + * @param string $u_action Custom form action |
|
| 149 | + * @return void |
|
| 150 | + */ |
|
| 151 | 151 | public function set_page_url($u_action) |
| 152 | 152 | { |
| 153 | 153 | $this->u_action = $u_action; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | - * Get ACP page title for Ads module |
|
| 158 | - * |
|
| 159 | - * @return string Language string for Ads ACP module |
|
| 160 | - */ |
|
| 157 | + * Get ACP page title for Ads module |
|
| 158 | + * |
|
| 159 | + * @return string Language string for Ads ACP module |
|
| 160 | + */ |
|
| 161 | 161 | public function get_page_title() |
| 162 | 162 | { |
| 163 | 163 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
| 167 | - * Add an advertisement |
|
| 168 | - * |
|
| 169 | - * @return void |
|
| 170 | - */ |
|
| 167 | + * Add an advertisement |
|
| 168 | + * |
|
| 169 | + * @return void |
|
| 170 | + */ |
|
| 171 | 171 | public function action_add() |
| 172 | 172 | { |
| 173 | 173 | $preview = $this->request->is_set_post('preview'); |
@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | - * Edit an advertisement |
|
| 213 | - * |
|
| 214 | - * @return void |
|
| 215 | - */ |
|
| 212 | + * Edit an advertisement |
|
| 213 | + * |
|
| 214 | + * @return void |
|
| 215 | + */ |
|
| 216 | 216 | public function action_edit() |
| 217 | 217 | { |
| 218 | 218 | $ad_id = $this->request->variable('id', 0); |
@@ -270,30 +270,30 @@ discard block |
||
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | /** |
| 273 | - * Enable an advertisement |
|
| 274 | - * |
|
| 275 | - * @return void |
|
| 276 | - */ |
|
| 273 | + * Enable an advertisement |
|
| 274 | + * |
|
| 275 | + * @return void |
|
| 276 | + */ |
|
| 277 | 277 | public function action_enable() |
| 278 | 278 | { |
| 279 | 279 | $this->ad_enable(true); |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | /** |
| 283 | - * Disable an advertisement |
|
| 284 | - * |
|
| 285 | - * @return void |
|
| 286 | - */ |
|
| 283 | + * Disable an advertisement |
|
| 284 | + * |
|
| 285 | + * @return void |
|
| 286 | + */ |
|
| 287 | 287 | public function action_disable() |
| 288 | 288 | { |
| 289 | 289 | $this->ad_enable(false); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /** |
| 293 | - * Delete an advertisement |
|
| 294 | - * |
|
| 295 | - * @return void |
|
| 296 | - */ |
|
| 293 | + * Delete an advertisement |
|
| 294 | + * |
|
| 295 | + * @return void |
|
| 296 | + */ |
|
| 297 | 297 | public function action_delete() |
| 298 | 298 | { |
| 299 | 299 | $ad_id = $this->request->variable('id', 0); |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /** |
| 339 | - * Display the ads |
|
| 340 | - * |
|
| 341 | - * @return void |
|
| 342 | - */ |
|
| 339 | + * Display the ads |
|
| 340 | + * |
|
| 341 | + * @return void |
|
| 342 | + */ |
|
| 343 | 343 | public function list_ads() |
| 344 | 344 | { |
| 345 | 345 | foreach ($this->manager->get_all_ads() as $row) |
@@ -369,10 +369,10 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | /** |
| 372 | - * Perform general tasks |
|
| 373 | - * |
|
| 374 | - * @return void |
|
| 375 | - */ |
|
| 372 | + * Perform general tasks |
|
| 373 | + * |
|
| 374 | + * @return void |
|
| 375 | + */ |
|
| 376 | 376 | protected function setup() |
| 377 | 377 | { |
| 378 | 378 | $this->user->add_lang_ext('phpbb/ads', 'acp'); |
@@ -381,11 +381,11 @@ discard block |
||
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | /** |
| 384 | - * Enable/disable an advertisement |
|
| 385 | - * |
|
| 386 | - * @param bool $enable Enable or disable the advertisement? |
|
| 387 | - * @return void |
|
| 388 | - */ |
|
| 384 | + * Enable/disable an advertisement |
|
| 385 | + * |
|
| 386 | + * @param bool $enable Enable or disable the advertisement? |
|
| 387 | + * @return void |
|
| 388 | + */ |
|
| 389 | 389 | protected function ad_enable($enable) |
| 390 | 390 | { |
| 391 | 391 | $ad_id = $this->request->variable('id', 0); |
@@ -416,11 +416,11 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /** |
| 419 | - * Get admin form data. |
|
| 420 | - * |
|
| 421 | - * @param string $form_name The form name. |
|
| 422 | - * @return array Form data |
|
| 423 | - */ |
|
| 419 | + * Get admin form data. |
|
| 420 | + * |
|
| 421 | + * @param string $form_name The form name. |
|
| 422 | + * @return array Form data |
|
| 423 | + */ |
|
| 424 | 424 | protected function get_form_data($form_name) |
| 425 | 425 | { |
| 426 | 426 | $data = array( |
@@ -471,11 +471,11 @@ discard block |
||
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | /** |
| 474 | - * Assign form data to the template. |
|
| 475 | - * |
|
| 476 | - * @param array $data The form data. |
|
| 477 | - * @return void |
|
| 478 | - */ |
|
| 474 | + * Assign form data to the template. |
|
| 475 | + * |
|
| 476 | + * @param array $data The form data. |
|
| 477 | + * @return void |
|
| 478 | + */ |
|
| 479 | 479 | protected function assign_form_data($data) |
| 480 | 480 | { |
| 481 | 481 | $this->template->assign_vars(array( |
@@ -490,11 +490,11 @@ discard block |
||
| 490 | 490 | )); |
| 491 | 491 | } |
| 492 | 492 | /** |
| 493 | - * Prepare end date for display |
|
| 494 | - * |
|
| 495 | - * @param mixed $end_date End date. |
|
| 496 | - * @return string End date prepared for display. |
|
| 497 | - */ |
|
| 493 | + * Prepare end date for display |
|
| 494 | + * |
|
| 495 | + * @param mixed $end_date End date. |
|
| 496 | + * @return string End date prepared for display. |
|
| 497 | + */ |
|
| 498 | 498 | protected function prepare_end_date($end_date) |
| 499 | 499 | { |
| 500 | 500 | if (empty($end_date)) |
@@ -511,11 +511,11 @@ discard block |
||
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | /** |
| 514 | - * Assign template locations data to the template. |
|
| 515 | - * |
|
| 516 | - * @param mixed $data The form data or nothing. |
|
| 517 | - * @return void |
|
| 518 | - */ |
|
| 514 | + * Assign template locations data to the template. |
|
| 515 | + * |
|
| 516 | + * @param mixed $data The form data or nothing. |
|
| 517 | + * @return void |
|
| 518 | + */ |
|
| 519 | 519 | protected function assign_locations($data = false) |
| 520 | 520 | { |
| 521 | 521 | foreach ($this->location_manager->get_all_locations() as $location_id => $location_data) |
@@ -530,43 +530,43 @@ discard block |
||
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | /** |
| 533 | - * Prepare advertisement preview |
|
| 534 | - * |
|
| 535 | - * @param string $code Ad code to preview |
|
| 536 | - * @return void |
|
| 537 | - */ |
|
| 533 | + * Prepare advertisement preview |
|
| 534 | + * |
|
| 535 | + * @param string $code Ad code to preview |
|
| 536 | + * @return void |
|
| 537 | + */ |
|
| 538 | 538 | protected function ad_preview($code) |
| 539 | 539 | { |
| 540 | 540 | $this->template->assign_var('PREVIEW', htmlspecialchars_decode($code)); |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | /** |
| 544 | - * Print success message. |
|
| 545 | - * |
|
| 546 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 547 | - */ |
|
| 544 | + * Print success message. |
|
| 545 | + * |
|
| 546 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 547 | + */ |
|
| 548 | 548 | protected function success() |
| 549 | 549 | { |
| 550 | 550 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | /** |
| 554 | - * Print error message. |
|
| 555 | - * |
|
| 556 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 557 | - */ |
|
| 554 | + * Print error message. |
|
| 555 | + * |
|
| 556 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 557 | + */ |
|
| 558 | 558 | protected function error() |
| 559 | 559 | { |
| 560 | 560 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | /** |
| 564 | - * Log action |
|
| 565 | - * |
|
| 566 | - * @param string $action Performed action in uppercase |
|
| 567 | - * @param string $ad_name Advertisement name |
|
| 568 | - * @return void |
|
| 569 | - */ |
|
| 564 | + * Log action |
|
| 565 | + * |
|
| 566 | + * @param string $action Performed action in uppercase |
|
| 567 | + * @param string $ad_name Advertisement name |
|
| 568 | + * @return void |
|
| 569 | + */ |
|
| 570 | 570 | protected function log($action, $ad_name) |
| 571 | 571 | { |
| 572 | 572 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_ADMANAGEMENT_' . $action . '_LOG', time(), array($ad_name)); |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | protected $location_manager; |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | - * {@inheritdoc} |
|
| 40 | - */ |
|
| 39 | + * {@inheritdoc} |
|
| 40 | + */ |
|
| 41 | 41 | static public function getSubscribedEvents() |
| 42 | 42 | { |
| 43 | 43 | return array( |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * Constructor |
|
| 50 | - * |
|
| 51 | - * @param \phpbb\template\template $template Template object |
|
| 52 | - * @param \phpbb\user $user User object |
|
| 53 | - * @param \phpbb\config\db_text $config_text Config text object |
|
| 54 | - * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
| 55 | - * @param \phpbb\ads\location\manager $location_manager Template location manager object |
|
| 56 | - */ |
|
| 49 | + * Constructor |
|
| 50 | + * |
|
| 51 | + * @param \phpbb\template\template $template Template object |
|
| 52 | + * @param \phpbb\user $user User object |
|
| 53 | + * @param \phpbb\config\db_text $config_text Config text object |
|
| 54 | + * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
| 55 | + * @param \phpbb\ads\location\manager $location_manager Template location manager object |
|
| 56 | + */ |
|
| 57 | 57 | public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\db_text $config_text, \phpbb\ads\ad\manager $manager, \phpbb\ads\location\manager $location_manager) |
| 58 | 58 | { |
| 59 | 59 | $this->template = $template; |