-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.php
35 lines (22 loc) · 1.31 KB
/
Main.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
<?php
namespace IdnoPlugins\ApplyToJoin {
use Idno\Common\Plugin;
class Main extends Plugin {
function registerPages() {
// Hijack the registration page to create an "apply to register" page
\Idno\Core\site()->addPageHandler('account/join/?','IdnoPlugins\ApplyToJoin\Pages\Join', true);
// Application confirmation page
\Idno\Core\site()->addPageHandler('account/join/thanks/?','IdnoPlugins\ApplyToJoin\Pages\Thanks', true);
// Create an admin panel
\Idno\Core\site()->addPageHandler('admin/applytojoin/?','IdnoPlugins\ApplyToJoin\Pages\Admin');
// Now extend the toolbar when we're logged out, if we need to
if (!\Idno\Core\site()->session()->isLoggedIn() && empty(\Idno\Core\site()->config()->open_registration)) {
\Idno\Core\site()->template()->extendTemplate('shell/toolbar/logged-out/items','applytojoin/toolbar');
}
// Extend the admin menu
\Idno\Core\site()->template()->extendTemplate('admin/menu/items','applytojoin/menu');
// Extend the login page
\Idno\Core\site()->template()->extendTemplate('session/login','applytojoin/login');
}
}
}