-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhook.php
executable file
·46 lines (35 loc) · 1021 Bytes
/
hook.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
<?php
function display_resume()
{
$plugin = new Plugin();
$pluginSaldo = current($plugin->find("directory = 'gestaohoras' AND state = 1"));
if ($pluginSaldo) {
$saldoHoras = PluginGestaohorasBalance_Hour::getSaldos();
if ($saldoHoras) {
echo "<p><b>Saldo de horas: {$saldoHoras['total']}h</b></p>";
}
}
}
/**
* Install all necessary elements for the plugin
* @return boolean True if success
*/
function plugin_gestaohoras_install()
{
require_once(__DIR__ . '/install/install.php');
spl_autoload_register('plugin_gestaohoras_autoload');
$version = plugin_version_gestaohoras();
$migration = new Migration($version['version']);
$install = new PluginGestaohorasInstall();
$install->install($migration);
return true;
}
/**
* Uninstall previously installed elements of the plugin
*/
function plugin_gestaohoras_uninstall()
{
require_once(__DIR__ . '/install/install.php');
$install = new PluginGestaohorasInstall();
$install->uninstall();
}