-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.php
86 lines (80 loc) · 2.55 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
78
79
80
81
82
83
84
85
86
<?php
/**
* @package Hello World Module for Joomla!
* @author Jon Brown https://quantumwarp.com/
* @copyright Copyright (C) 2019 Jon Brown, All rights reserved.
* @license GNU/GPLv3 or later; https://www.gnu.org/licenses/gpl.html
*/
// No direct access to this file
defined('_JEXEC') or die;
/**
* class name of: mod_helloWorldInstallerScript (original), mod_HelloWorldInstallerScript, Mod_HelloWorldInstallerScript, ModHelloWorldInstallerScript = All work
*/
class ModHelloWorldInstallerScript
{
/**
* This method is called after a module is installed.
*
* @param \stdClass $parent - Parent object calling this method.
*
* @return void
*/
function install($parent)
{
echo '<p>' . JText::_('MOD_HELLOWORLD_INSTALL_TEXT') . '</p>';
//$parent->getParent()->setRedirectURL('index.php?option=mod_helloworld');
}
/**
* This method is called after a module is uninstalled.
*
* @param \stdClass $parent - Parent object calling this method.
*
* @return void
*/
function uninstall($parent)
{
echo '<p>' . JText::_('MOD_HELLOWORLD_UNINSTALL_TEXT') . '</p>';
}
/**
* This method is called after a module is updated.
*
* @param \stdClass $parent - Parent object calling object.
*
* @return void
*/
function update($parent)
{
echo '<p>' . JText::sprintf('MOD_HELLOWORLD_UPDATE_TEXT', $parent->get('manifest')->version) . '</p>';
}
/**
* Runs just before any installation action is performed on the module. (install/update/uninstall method)
* Verifications and pre-requisites should run in this function.
*
* @param string $type - Type of PreFlight action. Possible values are:
* - * install
* - * update
* - * discover_install
* @param \stdClass $parent - Parent object calling object.
*
* @return void
*/
function preflight($type, $parent)
{
echo '<p>' . JText::_('MOD_HELLOWORLD_PREFLIGHT_' . $type . '_TEXT') . '</p>';
}
/**
* Runs right after any installation action is performed on the module. (install/update/uninstall method)
*
* @param string $type - Type of PostFlight action. Possible values are:
* - * install
* - * update
* - * discover_install
* @param \stdClass $parent - Parent object calling object.
*
* @return void
*/
function postflight($type, $parent)
{
echo '<p>' . JText::_('MOD_HELLOWORLD_POSTFLIGHT_' . $type . '_TEXT') . '</p>';
}
}