Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 2858671

Browse files
committed
Rename table column with dp prefix. Add unistall methode.
1 parent 506ca4c commit 2858671

12 files changed

Lines changed: 30 additions & 9 deletions

File tree

Listener/TwoClickListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class TwoClickListener
1010
{
1111
public static function userEntityStructure(Manager $em, Structure &$structure)
1212
{
13-
$structure->columns['load_embedded'] = ['type' => Entity::BOOL, 'default' => 0, 'nullable' => false];
13+
$structure->columns['dp_load_embedded'] = ['type' => Entity::BOOL, 'default' => 0, 'nullable' => false];
1414
}
1515
}

Pub/Controller/AccountController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class AccountController extends XFCP_AccountController
88
{
99
protected function savePrivacyProcess(User $visitor)
1010
{
11-
$input = $this->filter(['user' => ['load_embedded' => 'bool']]);
12-
$visitor->set('load_embedded', $input['user']['load_embedded']);
11+
$input = $this->filter(['user' => ['dp_load_embedded' => 'bool']]);
12+
$visitor->set('dp_load_embedded', $input['user']['dp_load_embedded']);
1313

1414
return parent::accountDetailsSaveProcess($visitor);
1515
}

Setup.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function install(array $stepParams = [])
1212
$this->schemaManager()->alterTable(
1313
'xf_user',
1414
function (Alter $user_table) {
15-
$user_table->addColumn('load_embedded', 'tinyint')->setDefault(0);
15+
$user_table->addColumn('dp_load_embedded', 'tinyint')->setDefault(0);
1616
}
1717
);
1818
}
@@ -24,6 +24,11 @@ public function upgrade(array $stepParams = [])
2424

2525
public function uninstall(array $stepParams = [])
2626
{
27-
// TODO: Implement uninstall() method.
27+
$this->schemaManager()->alterTable(
28+
'xf_user',
29+
function (Alter $user_table) {
30+
$user_table->dropColumns(['dp_load_embedded']);
31+
}
32+
);
2833
}
2934
}

_data/phrases.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
<phrase title="dp_media_two_click_text" version_id="1000031" version_string="1.0.0 Beta 1"><![CDATA[<p>Content from {mediaProvider} is integrated at this point. Please note that if you wish to view the content, your IP address and the URL of this page will be transmitted to the content provider. The content provider may also set cookies that can be used to track you.</p>
55
66
<p>The integration of the content takes place at your request.</p>]]></phrase>
7+
<phrase title="dp_two_click_user_privacy" version_id="1000031" version_string="1.0.0 Beta 1"><![CDATA[Embedded Media]]></phrase>
78
</phrases>

_data/template_modifications.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
]]></find>
1010
<replace><![CDATA[</xf:formrow>
1111
<xf:checkboxrow label="{{ phrase('dp_two_click_user_privacy') }}">
12-
<xf:option name="user[load_embedded]" checked="{$xf.visitor.load_embedded}"
12+
<xf:option name="user[dp_load_embedded]" checked="{$xf.visitor.dp_load_embedded}"
1313
label="{{ phrase('dp_two_click_load_embedded') }}"
1414
hint="{{ phrase('dp_two_click_load_embedded_desc') }}">
1515
</xf:option>

_output/phrases/_metadata.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,17 @@
1010
"version_id": 1000031,
1111
"version_string": "1.0.0 Beta 1",
1212
"hash": "589c4fc99caa07db774da9a342ee31a7"
13+
},
14+
"dp_media_two_click_title.txt": {
15+
"global_cache": false,
16+
"version_id": 1000031,
17+
"version_string": "1.0.0 Beta 1",
18+
"hash": "6d8b885d2f71a072495faaf6ed5728ef"
19+
},
20+
"dp_two_click_user_privacy.txt": {
21+
"global_cache": false,
22+
"version_id": 1000031,
23+
"version_string": "1.0.0 Beta 1",
24+
"hash": "c05342dd0248ec71df0e02965917f4b7"
1325
}
1426
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Embedded Media from {mediaProvider}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Embedded Media

_output/template_modifications/_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"hash": "43247d3a696a8f01d30eecdb0784c36e"
44
},
55
"public/dp_two_click.json": {
6-
"hash": "4f270c7986d61ea01ca70ebe720f1849"
6+
"hash": "ed00e69be9a1bfce654cb67a0540a554"
77
}
88
}

_output/template_modifications/public/dp_two_click.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"enabled": true,
66
"action": "str_replace",
77
"find": "</xf:formrow>\n\t\t</div>\n\t\t<xf:submitrow icon=\"save\" sticky=\"true\" />\n\t</div>\n</xf:form>\n",
8-
"replace": "</xf:formrow>\n<xf:checkboxrow label=\"{{ phrase('dp_two_click_user_privacy') }}\">\n\t<xf:option name=\"user[load_embedded]\" checked=\"{$xf.visitor.load_embedded}\"\n\t\tlabel=\"{{ phrase('dp_two_click_load_embedded') }}\"\n\t\thint=\"{{ phrase('dp_two_click_load_embedded_desc') }}\">\n\t</xf:option>\n</xf:checkboxrow>\n</div>\n\t\t<xf:submitrow icon=\"save\" sticky=\"true\" />\n\t</div>\n</xf:form>\n"
8+
"replace": "</xf:formrow>\n<xf:checkboxrow label=\"{{ phrase('dp_two_click_user_privacy') }}\">\n\t<xf:option name=\"user[dp_load_embedded]\" checked=\"{$xf.visitor.dp_load_embedded}\"\n\t\tlabel=\"{{ phrase('dp_two_click_load_embedded') }}\"\n\t\thint=\"{{ phrase('dp_two_click_load_embedded_desc') }}\">\n\t</xf:option>\n</xf:checkboxrow>\n</div>\n\t\t<xf:submitrow icon=\"save\" sticky=\"true\" />\n\t</div>\n</xf:form>\n"
99
}

0 commit comments

Comments
 (0)