-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
48 lines (45 loc) · 1.64 KB
/
index.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
<?php
/**
* FBDDemo plugin for Wolf CMS
*
* Welcome to Capt Zeanie's FBDDemo (Frontend, Backend, Dispatcher, Demo) plugin.
*
* @author Sean Arrowsmith
* @package Wolf
* @subpackage plugin.fbddemo
* @version 0.0.1
*/
// Check if the plugin's settings for version number else 0.0.0
if (Plugin::getSetting('version', 'fbddemo') == true) {
$Plugin_Version = Plugin::getSetting('version', 'fbddemo');
} else {
$Plugin_Version ="0.0.0";
}
// Check if the plugin's settings for frontend uri. ie how we want to call the plugin from the frontend and place this uri into the dispatcher route.
if (Plugin::getSetting('uri', 'fbddemo') == true) {
$Plugin_Frontend_Uri = Plugin::getSetting('uri', 'fbddemo');
} else {
$Plugin_Frontend_Uri = "test";
}
Plugin::setInfos(array(
'id' => 'fbddemo',
'title' => 'FBDDemo',
'description' => __('Adds a FBDDemo page to your site'),
'version' => $Plugin_Version,
'license' => 'GPL or other',
'author' => 'Sean Arrowsmith',
'website' => 'http://www.mydomain.com',
'update_url' => 'http://www.mydomain.com/plugins.xml',
'type' => 'both',
'require_wolf_version' => '0.8.2'
));
// Setup the controller.
Plugin::addController('fbddemo', 'FBDDemo', 'admin_view', true);
// Load classes.
AutoLoader::addFolder(CORE_ROOT.'/plugins/fbddemo/models/');
// Setup routes to the fbddemo plugin.
Dispatcher::addRoute(array(
'/' . $Plugin_Frontend_Uri => '/plugin/fbddemo/test_form',
'/' . $Plugin_Frontend_Uri.'/test' => '/plugin/fbddemo/test_form',
'/test_process' => '/plugin/fbddemo/test_form_process',
));