@@ -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( |
@@ -235,6 +235,7 @@ |
||
| 235 | 235 | /** |
| 236 | 236 | * Enable/disable ad |
| 237 | 237 | * |
| 238 | + * @param boolean $enable |
|
| 238 | 239 | * @return void |
| 239 | 240 | */ |
| 240 | 241 | public function ad_enable($enable) |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | protected $u_action; |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * Constructor |
|
| 38 | - * |
|
| 39 | - * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
| 40 | - * @param \phpbb\template\template $template Template object |
|
| 41 | - * @param \phpbb\user $user User object |
|
| 42 | - * @param \phpbb\request\request $request Request object |
|
| 43 | - * @param string $ads_table Ads table |
|
| 44 | - */ |
|
| 37 | + * Constructor |
|
| 38 | + * |
|
| 39 | + * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
| 40 | + * @param \phpbb\template\template $template Template object |
|
| 41 | + * @param \phpbb\user $user User object |
|
| 42 | + * @param \phpbb\request\request $request Request object |
|
| 43 | + * @param string $ads_table Ads table |
|
| 44 | + */ |
|
| 45 | 45 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, $ads_table) |
| 46 | 46 | { |
| 47 | 47 | $this->db = $db; |
@@ -52,51 +52,51 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Set page url |
|
| 56 | - * |
|
| 57 | - * @param string $u_action Custom form action |
|
| 58 | - * @return void |
|
| 59 | - */ |
|
| 55 | + * Set page url |
|
| 56 | + * |
|
| 57 | + * @param string $u_action Custom form action |
|
| 58 | + * @return void |
|
| 59 | + */ |
|
| 60 | 60 | public function set_page_url($u_action) |
| 61 | 61 | { |
| 62 | 62 | $this->u_action = $u_action; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * Load module-specific language |
|
| 67 | - * |
|
| 68 | - * @return void |
|
| 69 | - */ |
|
| 66 | + * Load module-specific language |
|
| 67 | + * |
|
| 68 | + * @return void |
|
| 69 | + */ |
|
| 70 | 70 | public function load_lang() |
| 71 | 71 | { |
| 72 | 72 | $this->user->add_lang_ext('phpbb/admanagement', 'acp'); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * Get ACP page title for Ads module |
|
| 77 | - * |
|
| 78 | - * @return string Language string for Ads ACP module |
|
| 79 | - */ |
|
| 76 | + * Get ACP page title for Ads module |
|
| 77 | + * |
|
| 78 | + * @return string Language string for Ads ACP module |
|
| 79 | + */ |
|
| 80 | 80 | public function get_page_title() |
| 81 | 81 | { |
| 82 | 82 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * Get action |
|
| 87 | - * |
|
| 88 | - * @return string Ads module action |
|
| 89 | - */ |
|
| 86 | + * Get action |
|
| 87 | + * |
|
| 88 | + * @return string Ads module action |
|
| 89 | + */ |
|
| 90 | 90 | public function get_action() |
| 91 | 91 | { |
| 92 | 92 | return $this->request->variable('action', ''); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * Process 'add' action |
|
| 97 | - * |
|
| 98 | - * @return void |
|
| 99 | - */ |
|
| 96 | + * Process 'add' action |
|
| 97 | + * |
|
| 98 | + * @return void |
|
| 99 | + */ |
|
| 100 | 100 | public function action_add() |
| 101 | 101 | { |
| 102 | 102 | $errors = array(); |
@@ -156,10 +156,10 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | - * Process 'edit' action |
|
| 160 | - * |
|
| 161 | - * @return void |
|
| 162 | - */ |
|
| 159 | + * Process 'edit' action |
|
| 160 | + * |
|
| 161 | + * @return void |
|
| 162 | + */ |
|
| 163 | 163 | public function action_edit() |
| 164 | 164 | { |
| 165 | 165 | $ad_id = $this->request->variable('id', 0); |
@@ -233,10 +233,10 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | - * Enable/disable ad |
|
| 237 | - * |
|
| 238 | - * @return void |
|
| 239 | - */ |
|
| 236 | + * Enable/disable ad |
|
| 237 | + * |
|
| 238 | + * @return void |
|
| 239 | + */ |
|
| 240 | 240 | public function ad_enable($enable) |
| 241 | 241 | { |
| 242 | 242 | $sql = 'UPDATE ' . $this->ads_table . ' |
@@ -267,10 +267,10 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /** |
| 270 | - * Process 'delete' action |
|
| 271 | - * |
|
| 272 | - * @return void |
|
| 273 | - */ |
|
| 270 | + * Process 'delete' action |
|
| 271 | + * |
|
| 272 | + * @return void |
|
| 273 | + */ |
|
| 274 | 274 | public function action_delete() |
| 275 | 275 | { |
| 276 | 276 | $sql = 'DELETE FROM ' . $this->ads_table . ' |
@@ -289,10 +289,10 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | |
| 291 | 291 | /** |
| 292 | - * Display the ads |
|
| 293 | - * |
|
| 294 | - * @return void |
|
| 295 | - */ |
|
| 292 | + * Display the ads |
|
| 293 | + * |
|
| 294 | + * @return void |
|
| 295 | + */ |
|
| 296 | 296 | public function list_ads() |
| 297 | 297 | { |
| 298 | 298 | $sql = 'SELECT ad_id, ad_name, ad_enabled |