forked from ParsonsTKO/Folger_iiif_uv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
folger_iiif_uv.php
117 lines (89 loc) · 2.73 KB
/
folger_iiif_uv.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
/*
Plugin Name: Folger IIIF UV WP Plugin
Plugin URI: https://parsonstko.com/
Description: Plugin for embeding UV in Wordpress pages/posts.
Version: 0.1.0
Author: Krzysztof Sabat at ParsonsTKO
Author URI: https://parsonstko.com/
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
folger_iiif_uv is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
any later version.
folger_iiif_uv is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with folger_iiif_uv. If not, see https://parsonstko.com/.
*/
defined("ABSPATH") or die("Nothing to see here.");
class PTKO_folgerUVPlugin
{
private $uvClass;
private $admin;
private $pluginPath;
private $pluginFileSystemLocation;
function activate()
{
if (current_user_can("activate_plugins") === false) {
wp_die("You do not have the necessary access permissions to activate plugins.");
};
}
function deactivate()
{
if (current_user_can("activate_plugins") === false) {
wp_die("You do not have the necessary access permissions to deactivate plugins.");
};
deactivate_plugins(plugin_basename(__FILE__));
}
function uninstall()
{
}
function setAdmin($admin)
{
$this->admin = $admin;
}
function getAdmin()
{
return $this->admin;
}
function setUVPluginClass($inClass)
{
$this->uvClass = $inClass;
}
function getUVPluginClass()
{
return $this->uvClass;
}
function setPluginPath($f = __FILE__)
{
$this->pluginPath = plugin_dir_url($f);
}
function getPluginPath()
{
return $this->pluginPath;
}
function setPluginFSPath($f = __FILE__)
{
$this->pluginFileSystemLocation = plugin_dir_path($f);
}
function getPluginFSPath()
{
return $this->pluginFileSystemLocation;
}
function __construct()
{
require_once(__DIR__ . "/admin/ptkoFolgerIIIFUVAdmin.php");
require_once(__DIR__ . "/public/ptkoFolgerIIIFUV.php");
$this->setPluginPath(__FILE__);
$this->setPluginFSPath(__FILE__);
$this->setUVPluginClass(new ptkoFolgerIIIFUV($this));
$this->setAdmin(new ptkoFolgerIIIFUVAdmin($this));
register_activation_hook(__FILE__, array($this, "activate"));
add_shortcode("miranda_uv", array($this->uvClass, "UVEmbedShortcode") );
}
};
$PTKO_folgerIIIFUVPlugin = new PTKO_folgerUVPlugin();