-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.php
60 lines (54 loc) · 1.22 KB
/
install.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
<?php
/**
* @package Jmb_Tree
* @author Dmitry Rekun <[email protected]>
* @copyright Copyright (C) 2012 - 2016 NorrNext. All rights reserved.
* @license GNU General Public License version 3 or later; see license.txt
*/
defined('_JEXEC') or die;
/**
* Install script class
*
* @since 1.0
*/
class Mod_Jmb_TreeInstallerScript
{
/**
* Method to set message after installation
*
* @param string $route The type of route: install, uninstall, discover_install, update
* @param JAdapterInstance $adapter The class who calls this method
*
* @return boolean
*
* @since 1.0
*/
public function postflight($route, JAdapterInstance $adapter)
{
if (strtolower($route) == 'install')
{
try
{
$db = $adapter->getParent()->getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__modules'))
->where(
$db->quoteName('module')
. ' = '
. $db->quote(
strtolower($adapter->get('name'))
)
);
$db->setQuery($query);
$id = $db->loadResult();
}
catch (RuntimeException $e)
{
return false;
}
echo JText::sprintf('MOD_JMB_TREE_INSTALL_TEXT', $id);
}
return true;
}
}