@@ -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\v310\gold'); |
| 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,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\admanagement\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( |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | protected $ads_table; |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * {@inheritdoc} |
|
| 37 | - */ |
|
| 36 | + * {@inheritdoc} |
|
| 37 | + */ |
|
| 38 | 38 | static public function getSubscribedEvents() |
| 39 | 39 | { |
| 40 | 40 | return array( |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | - * Constructor |
|
| 47 | - * |
|
| 48 | - * @param \phpbb\request\request $request Request object |
|
| 49 | - * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
| 50 | - * @param \phpbb\template\template $template Template object |
|
| 51 | - * @param string $ads_table Ads table |
|
| 52 | - */ |
|
| 46 | + * Constructor |
|
| 47 | + * |
|
| 48 | + * @param \phpbb\request\request $request Request object |
|
| 49 | + * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
| 50 | + * @param \phpbb\template\template $template Template object |
|
| 51 | + * @param string $ads_table Ads table |
|
| 52 | + */ |
|
| 53 | 53 | public function __construct(\phpbb\request\request $request, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, $ads_table) |
| 54 | 54 | { |
| 55 | 55 | $this->request = $request; |
@@ -42,16 +42,16 @@ discard block |
||
| 42 | 42 | protected $u_action; |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Constructor |
|
| 46 | - * |
|
| 47 | - * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
| 48 | - * @param \phpbb\template\template $template Template object |
|
| 49 | - * @param \phpbb\user $user User object |
|
| 50 | - * @param \phpbb\request\request $request Request object |
|
| 51 | - * @param string $ads_table Ads table |
|
| 52 | - * @param string $php_ext PHP extension |
|
| 53 | - * @param string $phpbb_admin_path Path to admin |
|
| 54 | - */ |
|
| 45 | + * Constructor |
|
| 46 | + * |
|
| 47 | + * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
| 48 | + * @param \phpbb\template\template $template Template object |
|
| 49 | + * @param \phpbb\user $user User object |
|
| 50 | + * @param \phpbb\request\request $request Request object |
|
| 51 | + * @param string $ads_table Ads table |
|
| 52 | + * @param string $php_ext PHP extension |
|
| 53 | + * @param string $phpbb_admin_path Path to admin |
|
| 54 | + */ |
|
| 55 | 55 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, $ads_table, $php_ext, $phpbb_admin_path) |
| 56 | 56 | { |
| 57 | 57 | $this->db = $db; |
@@ -64,51 +64,51 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | - * Set page url |
|
| 68 | - * |
|
| 69 | - * @param string $u_action Custom form action |
|
| 70 | - * @return void |
|
| 71 | - */ |
|
| 67 | + * Set page url |
|
| 68 | + * |
|
| 69 | + * @param string $u_action Custom form action |
|
| 70 | + * @return void |
|
| 71 | + */ |
|
| 72 | 72 | public function set_page_url($u_action) |
| 73 | 73 | { |
| 74 | 74 | $this->u_action = $u_action; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * Load module-specific language |
|
| 79 | - * |
|
| 80 | - * @return void |
|
| 81 | - */ |
|
| 78 | + * Load module-specific language |
|
| 79 | + * |
|
| 80 | + * @return void |
|
| 81 | + */ |
|
| 82 | 82 | public function load_lang() |
| 83 | 83 | { |
| 84 | 84 | $this->user->add_lang_ext('phpbb/admanagement', 'acp'); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * Get ACP page title for Ads module |
|
| 89 | - * |
|
| 90 | - * @return string Language string for Ads ACP module |
|
| 91 | - */ |
|
| 88 | + * Get ACP page title for Ads module |
|
| 89 | + * |
|
| 90 | + * @return string Language string for Ads ACP module |
|
| 91 | + */ |
|
| 92 | 92 | public function get_page_title() |
| 93 | 93 | { |
| 94 | 94 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * Get action |
|
| 99 | - * |
|
| 100 | - * @return string Ads module action |
|
| 101 | - */ |
|
| 98 | + * Get action |
|
| 99 | + * |
|
| 100 | + * @return string Ads module action |
|
| 101 | + */ |
|
| 102 | 102 | public function get_action() |
| 103 | 103 | { |
| 104 | 104 | return $this->request->variable('action', ''); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | - * Add an advertisement |
|
| 109 | - * |
|
| 110 | - * @return void |
|
| 111 | - */ |
|
| 108 | + * Add an advertisement |
|
| 109 | + * |
|
| 110 | + * @return void |
|
| 111 | + */ |
|
| 112 | 112 | public function action_add() |
| 113 | 113 | { |
| 114 | 114 | $errors = array(); |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | - * Edit an advertisement |
|
| 172 | - * |
|
| 173 | - * @return void |
|
| 174 | - */ |
|
| 171 | + * Edit an advertisement |
|
| 172 | + * |
|
| 173 | + * @return void |
|
| 174 | + */ |
|
| 175 | 175 | public function action_edit() |
| 176 | 176 | { |
| 177 | 177 | $ad_id = $this->request->variable('id', 0); |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
| 252 | - * Enable/disable an advertisement |
|
| 253 | - * |
|
| 254 | - * @param bool $enable Enable or disable the advertisement? |
|
| 255 | - * @return void |
|
| 256 | - */ |
|
| 252 | + * Enable/disable an advertisement |
|
| 253 | + * |
|
| 254 | + * @param bool $enable Enable or disable the advertisement? |
|
| 255 | + * @return void |
|
| 256 | + */ |
|
| 257 | 257 | public function ad_enable($enable) |
| 258 | 258 | { |
| 259 | 259 | $sql = 'UPDATE ' . $this->ads_table . ' |
@@ -284,10 +284,10 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
| 287 | - * Delete an advertisement |
|
| 288 | - * |
|
| 289 | - * @return void |
|
| 290 | - */ |
|
| 287 | + * Delete an advertisement |
|
| 288 | + * |
|
| 289 | + * @return void |
|
| 290 | + */ |
|
| 291 | 291 | public function action_delete() |
| 292 | 292 | { |
| 293 | 293 | $ad_id = $this->request->variable('id', 0); |
@@ -319,10 +319,10 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | |
| 321 | 321 | /** |
| 322 | - * Display the ads |
|
| 323 | - * |
|
| 324 | - * @return void |
|
| 325 | - */ |
|
| 322 | + * Display the ads |
|
| 323 | + * |
|
| 324 | + * @return void |
|
| 325 | + */ |
|
| 326 | 326 | public function list_ads() |
| 327 | 327 | { |
| 328 | 328 | $sql = 'SELECT ad_id, ad_name, ad_enabled |
@@ -351,16 +351,16 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /** |
| 354 | - * @param mixed ...$lang Input to $user->lang() |
|
| 355 | - */ |
|
| 354 | + * @param mixed ...$lang Input to $user->lang() |
|
| 355 | + */ |
|
| 356 | 356 | protected function success() |
| 357 | 357 | { |
| 358 | 358 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | /** |
| 362 | - * @param mixed ...$lang Input to $user->lang() |
|
| 363 | - */ |
|
| 362 | + * @param mixed ...$lang Input to $user->lang() |
|
| 363 | + */ |
|
| 364 | 364 | protected function error() |
| 365 | 365 | { |
| 366 | 366 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |