-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.php
77 lines (74 loc) · 1.95 KB
/
script.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* @package Example_Postinstall_Messages
* @author b2z <[email protected]>
* @copyright Copyright (C) 2013 Dmitry Rekun. All rights reserved.
* @license GNU General Public License version 3 or later; see license.txt
*/
defined('_JEXEC') or die;
/**
* Plugin installer script
*
* @package Example_Postinstall_Messages
* @since 1.0
*/
class plgSystemExample_Postinstall_MessagesInstallerScript
{
/**
* Method to run on the plugin install.
*
* @param object $parent Parent object.
*
* @return void
*/
public function install($parent)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->insert($db->quoteName('#__postinstall_messages'))
->columns('`extension_id`,
`title_key`,
`description_key`,
`action_key`,
`language_extension`,
`language_client_id`,
`type`,
`action_file`,
`action`,
`condition_file`,
`condition_method`,
`version_introduced`,
`enabled`')
->values('700,
"PLG_SYSTEM_EXAMPLE_POSTINSTALL_MESSAGES_POSTINSTALL_TITLE",
"PLG_SYSTEM_EXAMPLE_POSTINSTALL_MESSAGES_POSTINSTALL_BODY",
"PLG_SYSTEM_EXAMPLE_POSTINSTALL_MESSAGES_POSTINSTALL_ACTION",
"plg_system_example_postinstall_messages",
1,
"action",
"site://plugins/system/example_postinstall_messages/postinstall/actions.php",
"example_postinstall_action",
"site://plugins/system/example_postinstall_messages/postinstall/actions.php",
"example_postinstall_condition",
"3.2.0",
1');
$db->setQuery($query);
$db->execute();
}
/**
* Method to run on the plugin uninstall.
*
* @param object $parent Parent object.
*
* @return void
*/
public function uninstall($parent)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->delete($db->quoteName('#__postinstall_messages'))
->where($db->quoteName('language_extension') . ' = ' . $db->quote('plg_system_example_postinstall_messages'));
$db->setQuery($query);
$db->execute();
}
}