Passed
Push — master ( c0a3a7...3b84a4 )
by Jeroen
58:51
created

mod/friends_collections/start.php (1 issue)

1
<?php
2
/**
3
 * Friend collections
4
 * Provides an interface for users to manage their friend collections
5
 */
6
7
use Elgg\Friends\Collections\CollectionMenuHandler;
8
use Elgg\Friends\Collections\DeleteRelationshipHandler;
9
use Elgg\Friends\Collections\EntityMenuHandler;
10
use Elgg\Friends\Collections\PageMenuHandler;
11
use Elgg\Friends\Collections\Router;
12
use Elgg\Friends\Collections\UrlHandler;
13
14
/**
15
 * Friend collection init
16
 *
17
 * @return void
18
 */
19
function friends_collections_init() {
20
21
	// Setup /collections controller and collection URLs
22 31
	elgg_register_page_handler('collections', [Router::class, 'collectionsPageHandler']);
0 ignored issues
show
Deprecated Code introduced by Ismayil Khayredinov
The function elgg_register_page_handler() has been deprecated: 3.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

22
	/** @scrutinizer ignore-deprecated */ elgg_register_page_handler('collections', [Router::class, 'collectionsPageHandler']);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
23 31
	elgg_register_plugin_hook_handler('access_collection:url', 'access_collection', UrlHandler::class);
24
25
	// Add Collections page menu item
26 31
	elgg_register_plugin_hook_handler('register', 'menu:page', PageMenuHandler::class);
27
28
	// Setup access collection menu
29 31
	elgg_register_plugin_hook_handler('register', 'menu:friends:collection', CollectionMenuHandler::class);
30
31 31
	elgg_register_plugin_hook_handler('register', 'menu:entity', EntityMenuHandler::class);
32
33
	// Remove users from access collections when friendship is revoked
34 31
	elgg_register_event_handler('delete', 'relationship', DeleteRelationshipHandler::class);
35
36
	// Add some styling
37 31
	elgg_extend_view('elgg.css', 'collections/collections.css');
38
39 31
}
40
41
return function() {
42 18
	elgg_register_event_handler('init', 'system', 'friends_collections_init');
43
};
44