2014-05-20 11:23:45 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
Plugin Name: footnotes
|
2014-05-22 12:59:19 +00:00
|
|
|
Plugin URI: http://wordpress.org/plugins/footnotes/
|
2014-05-20 11:53:13 +00:00
|
|
|
Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
|
|
|
|
Author: media competence institute
|
2014-05-25 08:11:52 +00:00
|
|
|
Version: 1.2.1
|
2014-05-20 11:53:13 +00:00
|
|
|
Author URI: http://cheret.co.uk/mci
|
2014-05-20 11:23:45 +00:00
|
|
|
Text Domain: footnotes
|
|
|
|
Domain Path: /languages
|
|
|
|
*/
|
|
|
|
/*
|
2014-05-20 11:38:36 +00:00
|
|
|
Copyright 2014 Mark Cheret, Stefan Herndler (email : mark@cheret.de | support@herndler.org)
|
2014-05-20 11:23:45 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License, version 3, as
|
|
|
|
published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program 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 this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-05-20 11:33:11 +00:00
|
|
|
* Created by Stefan Herndler.
|
|
|
|
* User: Stefan
|
|
|
|
* Date: 15.05.14
|
|
|
|
* Time: 16:21
|
2014-05-22 12:47:54 +00:00
|
|
|
* Version: 1.1.1
|
2014-05-20 11:33:11 +00:00
|
|
|
* Since: 1.0
|
2014-05-20 11:23:45 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2014-05-20 11:33:11 +00:00
|
|
|
/* include constants */
|
2014-05-21 18:33:26 +00:00
|
|
|
require_once(dirname(__FILE__) . "/includes/defines.php");
|
2014-05-20 11:33:11 +00:00
|
|
|
/* include language functions */
|
2014-05-21 18:33:26 +00:00
|
|
|
require_once(dirname(__FILE__) . "/includes/language.php");
|
2014-05-20 11:33:11 +00:00
|
|
|
/* include storage functions and global plugin functions */
|
2014-05-21 18:33:26 +00:00
|
|
|
require_once(dirname(__FILE__) . "/includes/plugin-settings.php");
|
2014-05-20 11:33:11 +00:00
|
|
|
/* include script and stylesheet functions */
|
2014-05-21 18:33:26 +00:00
|
|
|
require_once(dirname(__FILE__) . "/includes/scripts.php");
|
2014-05-20 11:33:11 +00:00
|
|
|
/* include script and stylesheet functions */
|
2014-05-21 18:33:26 +00:00
|
|
|
require_once(dirname(__FILE__) . "/includes/convert.php");
|
Version 1.0.4
* Updated replacing function when footnote is a link (bugfix)
* Footnote hover box remains until cursor leaves footnote or hover box
* Links in the footnote hover box are click able
* New setting to allow footnotes on Summarized Posts
* New setting to tell the world you're using footnotes plugin
* New setting for the counter style of the footnote index
** Arabic Numbers (1, 2, 3, 4, 5, ...)
** Arabic Numbers leading 0 (01, 02, 03, 04, 05, ...)
** Latin Characters lower-case (a, b, c, d, e, ...)
** Latin Characters upper-case (A, B, C, D, E, ...)
** Roman Numerals (I, II, III, IV, V, ...)
* Adding a link to the WordPress plugin in the footer if the WP-admin accepts it
* Updated translations for the new settings
* re-changed the version number to have 3 digits
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@917816 b8457f37-d9ea-0310-8a92-e5e31aec5664
2014-05-20 11:44:38 +00:00
|
|
|
/* include script and stylesheet functions */
|
2014-05-24 14:11:30 +00:00
|
|
|
require_once(dirname(__FILE__) . "/includes/wysiwyg-editor.php");
|
|
|
|
/* include script and stylesheet functions */
|
2014-05-21 18:33:26 +00:00
|
|
|
require_once(dirname(__FILE__) . "/includes/replacer.php");
|
2014-05-20 11:33:11 +00:00
|
|
|
|
2014-05-20 11:42:07 +00:00
|
|
|
/* require plugin class */
|
2014-05-21 18:33:26 +00:00
|
|
|
require_once(dirname(__FILE__) . "/classes/footnotes.php");
|
2014-05-20 11:42:07 +00:00
|
|
|
/* require plugin settings class */
|
2014-05-21 18:33:26 +00:00
|
|
|
require_once(dirname(__FILE__) . "/classes/footnotes_settings.php");
|
2014-05-24 12:38:22 +00:00
|
|
|
/* require plugin widget class */
|
|
|
|
require_once(dirname(__FILE__) . "/classes/footnotes_widget.php");
|
2014-05-20 11:42:07 +00:00
|
|
|
|
Version 1.0.4
* Updated replacing function when footnote is a link (bugfix)
* Footnote hover box remains until cursor leaves footnote or hover box
* Links in the footnote hover box are click able
* New setting to allow footnotes on Summarized Posts
* New setting to tell the world you're using footnotes plugin
* New setting for the counter style of the footnote index
** Arabic Numbers (1, 2, 3, 4, 5, ...)
** Arabic Numbers leading 0 (01, 02, 03, 04, 05, ...)
** Latin Characters lower-case (a, b, c, d, e, ...)
** Latin Characters upper-case (A, B, C, D, E, ...)
** Roman Numerals (I, II, III, IV, V, ...)
* Adding a link to the WordPress plugin in the footer if the WP-admin accepts it
* Updated translations for the new settings
* re-changed the version number to have 3 digits
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@917816 b8457f37-d9ea-0310-8a92-e5e31aec5664
2014-05-20 11:44:38 +00:00
|
|
|
/* register functions for the footnote replacement */
|
|
|
|
footnotes_RegisterReplacementFunctions();
|
2014-05-20 11:23:45 +00:00
|
|
|
|
|
|
|
/* adds javascript and stylesheets to the public page */
|
2014-05-21 18:33:26 +00:00
|
|
|
add_action('wp_enqueue_scripts', 'footnotes_add_public_stylesheet');
|
2014-05-20 11:23:45 +00:00
|
|
|
|
2014-05-24 14:11:30 +00:00
|
|
|
/* defines the callback function for the editor buttons */
|
|
|
|
add_action('wp_ajax_nopriv_footnotes_getTags', 'footnotes_wysiwyg_ajax_callback' );
|
|
|
|
add_action('wp_ajax_footnotes_getTags', 'footnotes_wysiwyg_ajax_callback' );
|
|
|
|
/* add new button to the WYSIWYG - editor */
|
|
|
|
add_filter('mce_buttons', 'footnotes_wysiwyg_editor_functions');
|
|
|
|
add_filter( "mce_external_plugins", "footnotes_wysiwyg_editor_buttons" );
|
|
|
|
/* add new button to the plain text editor */
|
|
|
|
add_action( 'admin_print_footer_scripts', 'footnotes_text_editor_buttons' );
|
|
|
|
|
|
|
|
/* action to locate language and load the wordpress-specific language file */
|
|
|
|
add_action('plugins_loaded', 'footnotes_load_language');
|
|
|
|
|
|
|
|
/* add link to the settings page in plugin main page */
|
|
|
|
$l_str_plugin_file = FOOTNOTES_PLUGIN_DIR_NAME . '/index.php';
|
|
|
|
add_filter("plugin_action_links_{$l_str_plugin_file}", 'footnotes_plugin_settings_link', 10, 2);
|
|
|
|
|
|
|
|
/* register footnotes widget */
|
|
|
|
add_action('widgets_init', create_function('', 'return register_widget("Class_FootnotesWidget");'));
|
|
|
|
|
2014-05-20 11:23:45 +00:00
|
|
|
/* only admin is allowed to execute the plugin settings */
|
2014-05-21 18:33:26 +00:00
|
|
|
if (!function_exists('is_admin')) {
|
|
|
|
header('Status: 403 Forbidden');
|
|
|
|
header('HTTP/1.1 403 Forbidden');
|
|
|
|
exit();
|
2014-05-20 11:23:45 +00:00
|
|
|
}
|
|
|
|
|
2014-05-22 13:33:57 +00:00
|
|
|
/* register hook for activating the plugin */
|
|
|
|
register_activation_hook(__FILE__, array('Class_Footnotes', 'activate'));
|
|
|
|
/* register hook for deactivating the plugin */
|
|
|
|
register_deactivation_hook(__FILE__, array('Class_Footnotes', 'deactivate'));
|
|
|
|
/* register hook for uninstalling the plugin */
|
|
|
|
register_uninstall_hook(__FILE__, array('Class_Footnotes', 'uninstall'));
|
|
|
|
|
2014-05-20 11:23:45 +00:00
|
|
|
/* initialize an object of the plugin class */
|
|
|
|
global $g_obj_FootnotesPlugin;
|
|
|
|
|
|
|
|
/* if object isn't initialized yet, initialize it now */
|
2014-05-21 18:33:26 +00:00
|
|
|
if (empty($g_obj_FootnotesPlugin)) {
|
|
|
|
$g_obj_FootnotesPlugin = new Class_Footnotes();
|
2014-05-20 11:23:45 +00:00
|
|
|
}
|