-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.inc.php
53 lines (44 loc) · 1.57 KB
/
main.inc.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
49
50
51
52
53
<?php
/*
Version: auto
Plugin Name: EditorPlus
Plugin URI: auto
Author: Piwigo team
Author URI: https://github.com/Piwigo
Description: WYSIWYG Editor for Piwigo.
Has Settings: true
*/
if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
// check root directory
if (basename(dirname(__FILE__)) != 'editorplus')
{
add_event_handler('init', 'ep_error');
function ep_error()
{
global $page;
$page['errors'][] = 'EditorPlus folder name is incorrect, uninstall the plugin and rename it to "editorplus"';
}
return;
}
// +-----------------------------------------------------------------------+
// | Define plugin constants |
// +-----------------------------------------------------------------------+
define('EP_ID', basename(dirname(__FILE__)));
define('EP_PATH', PHPWG_PLUGINS_PATH . EP_ID . '/');
define('EP_REALPATH', realpath(EP_PATH));
define('EP_ADMIN', get_root_url() . 'admin.php?page=plugin-' . EP_ID);
// +-----------------------------------------------------------------------+
// | Init EditorPlus |
// +-----------------------------------------------------------------------+
// Include once admin function
include_once(EP_PATH . 'include/admin.inc.php');
// init
add_event_handler('init', 'ep_init');
// add API function
$ws_file = EP_PATH . 'include/ws_functions.inc.php';
add_event_handler('ws_add_methods', 'ep_quill_add_methods', EVENT_HANDLER_PRIORITY_NEUTRAL, $ws_file);
if (defined('IN_ADMIN'))
{
// Include EditorPlus
include(EP_PATH . 'editorplus.php');
}