-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
141 lines (105 loc) · 3.8 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/*****
Plugin Name: TA Evangelische Termine
Plugin URI: http://byggvir.de/wordpress-plugin-evt-veranstaltungen/
Description: Dieses Plugin stellt eine Schnittstelle zu den Termindatenbanken der evangelischen Landeskirchen und angeschlossenen Organisationen bereit, die die Datenbank "Evangelische Termine" im Internet nutzen. Die Termine können mit dem Shortcode evtcalendar in Seiten und Artikel eingebunden werden. Daneben steht ein Widget für die Anzeige der Termine in den Seitenleisten zur Verfügung.
Author: Thomas Arend
Version: 2019.0.1
Date: 12.06.2019
Author URI: http://byggvir.de/
License: GPL 3 or later
This plugin is based on
* http://termine.ekir.de
xml.php interface example code
* http://codex.wordpress.org/Widgets_API
example Widget plugin
* https://codex.wordpress.org/Writing_a_Plugin
description and examples
*/
/**
* @package TA-Evangelische-Termine
* @version 2019.0.1
* @author Thomas Arend <thomas@arend-rhb.de>
* @copyright 2014-2019 Thomas Arend Rheinbach Germany
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
// Security check: Exit if script is called directly
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/*****
* Define a prefix for EVT
*/
define( "EVT", 'EVT_' );
if ( !class_exists( EVT . 'Termine' ) )
{
class EVT_Termine
{
/**
* Construct the plugin object
*/
public function __construct( )
{
// Initialize Settings
require_once( sprintf( "%s/includes/settings.php", dirname( __FILE__ ) ) );
$EVT_Termine_Settings = new EVT_Termine_Settings();
} // END public function __construct
/**
* Activate the plugin
*/
public static function activate( )
{
// Do nothing
} // END public static function activate
/**
* Deactivate the plugin
*/
public static function deactivate( )
{
// Do nothing
} // END public static function deactivate
} // END class EVT_Termine
} // END if(!class_exists(EVT.'Termine'))
if ( class_exists( EVT . 'Termine' ) )
{
// Installation and uninstallation hooks
register_activation_hook( __FILE__, array(
EVT . 'Termine',
'activate'
) );
register_deactivation_hook( __FILE__, array(
EVT . 'Termine',
'deactivate'
) );
// Instantiate the plugin class
$evt_termine = new EVT_Termine();
// Add a link to the settings page onto the plugin page
if ( isset( $evt_termine ) )
{
// Add the settings link to the plugins page
function EVT_settings_link( $links )
{
$settings_link = '<a href="options-general.php?page=evt_termine">Settings</a>';
array_unshift( $links, $settings_link );
return $links;
}
$plugin = plugin_basename( __FILE__ );
add_filter( "plugin_action_links_$plugin", EVT . 'settings_link' );
} //isset( $evt_termine )
} //class_exists( EVT . 'Termine' )
// Include files
require_once( sprintf( "%s/includes/global.php", dirname( __FILE__ ) ) );
require_once( sprintf( "%s/includes/postprocess.php", dirname( __FILE__ ) ) );
require_once( sprintf( "%s/includes/lib.php", dirname( __FILE__ ) ) );
require_once( sprintf( "%s/includes/shortcode_calendar.php", dirname( __FILE__ ) ) );
require_once( sprintf( "%s/includes/widget.php", dirname( __FILE__ ) ) );
// We need some CSS to format the calender
function add_evt_stylesheet( )
{
wp_register_style( EVT . 'StyleSheets', plugins_url( 'css/styles.css', __FILE__ ) );
wp_enqueue_style( EVT . 'StyleSheets' );
}
// Add the EVTStyleSheets
add_action( 'wp_print_styles', 'add_evt_stylesheet' );
// Add shortcodes
// add_shortcode( 'evtcalendar', 'evt_calendar' );
?>