Skip to content

Commit be28a2c

Browse files
committed
Add new table and ACP settings page template
1 parent e1d2435 commit be28a2c

File tree

4 files changed

+140
-0
lines changed

4 files changed

+140
-0
lines changed

acp/pastebin_info.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* Pastebin extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2024 Crizzo <https://www.phpBB.de>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
namespace phpbbde\pastebin\acp;
12+
13+
class pastebin_info
14+
{
15+
function module()
16+
{
17+
return array(
18+
'filename' => '\phpbbde\pastebin\acp\pastebin_info',
19+
'title' => 'ACP_PASTEBIN_TITLE',
20+
'modes' => array(
21+
'pastebin_settings' => array(
22+
'title' => 'ACP_PASTEBIN_SETTINGS',
23+
'auth' => 'ext_phpbbde/pastebin && acl_a_board',
24+
'cat' => array('ACP_PASTEBIN_TITLE')
25+
),
26+
),
27+
);
28+
}
29+
}

acp/pastebin_module.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
*
4+
* Pastebin extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2024 Crizzo <https://www.phpBB.de>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
namespace phpbbde\pastebin\acp;
12+
13+
/**
14+
* @ignore
15+
*/
16+
17+
18+
/**
19+
* @package acp
20+
*/
21+
class pastebin_module
22+
{
23+
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
*
4+
* Pastebin extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2024 Crizzo <https://www.phpBB.de>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = array();
19+
}
20+
21+
$lang = array_merge($lang, array(
22+
'ACP_PASTEBIN_TITLE' => 'Pastebin',
23+
'ACP_PASTEBIN_SETTINGS' => 'Settings',
24+
));

migrations/v210.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
/**
3+
*
4+
* Pastebin extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2024 Crizzo <https://www.phpBB.de>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
namespace phpbbde\pastebin\migrations;
12+
13+
class v210 extends \phpbb\db\migration\migration
14+
{
15+
public static function depends_on()
16+
{
17+
return array(
18+
'\phpbbde\pastebin\migrations\v206',
19+
);
20+
}
21+
/**
22+
* Add the pastebin lang schema to the database:
23+
* pastebin_langs:
24+
* lang_id
25+
* file_extension
26+
* lang_name
27+
* lang_active
28+
*
29+
* @return array Array of table schema
30+
* @access public
31+
*/
32+
public function update_schema()
33+
{
34+
return array(
35+
'add_tables' => array(
36+
$this->table_prefix . 'pastebin_langs' => array(
37+
'COLUMNS' => array(
38+
'lang_id' => array('UINT', null, 'auto_increment'),
39+
'lang_file_ext' => array('VCHAR:100', ''),
40+
'lang_name' => array('VCHAR:100', ''),
41+
'lang_active' => array('BOOL', 0),
42+
),
43+
'PRIMARY_KEY' => 'lang_id',
44+
),
45+
),
46+
);
47+
}
48+
49+
/**
50+
* Drop the pastebin_langs table schema from the database
51+
*
52+
* @return array Array of table schema
53+
* @access public
54+
*/
55+
public function revert_schema()
56+
{
57+
return array(
58+
'drop_tables' => array(
59+
$this->table_prefix . 'pastebin_langs',
60+
),
61+
);
62+
}
63+
}

0 commit comments

Comments
 (0)