Passed
Pull Request — master (#67)
by Victor
03:18
created

Application::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * CMS Pico - Integration of Pico within your files to create websites.
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Maxence Lange <[email protected]>
9
 * @copyright 2017
10
 * @license GNU AGPL version 3 or any later version
11
 *
12
 * This program is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU Affero General Public License as
14
 * published by the Free Software Foundation, either version 3 of the
15
 * License, or (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU Affero General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU Affero General Public License
23
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
 *
25
 */
26
27
namespace OCA\CMSPico\AppInfo;
28
29
use OCP\AppFramework\App;
30
use OCP\Util;
31
32
class Application extends App {
33
34
	const APP_NAME = 'cms_pico';
35
36
	/**
37
	 * @param array $params
38
	 */
39
	public function __construct(array $params = array()) {
40
		parent::__construct(self::APP_NAME, $params);
41
42
		$this->loadIcons();
43
		$this->registerHooks();
44
	}
45
46
47
	protected function loadIcons() {
48
		Util::addStyle(self::APP_NAME, 'icons');
49
	}
50
51
	/**
52
	 * Register Hooks
53
	 */
54
	public function registerHooks() {
55
		Util::connectHook(
56
			'OC_User', 'post_deleteUser', '\OCA\CMSPico\Hooks\UserHooks', 'onUserDeleted'
57
		);
58
	}
59
60
	public function registerSettingsPersonal() {
61
		$ver = Util::getVersion();
62
		if ($ver[0] < 13) {
63
			\OCP\App::registerPersonal(self::APP_NAME, 'lib/personal');
64
		}
65
	}
66
}
67
68