58b3dd27f6
- Add: Setting to enable/disable the mouse-over box - Add: Current WordPress Theme to the Diagnostics sub page - Add: ManFisher note in the "other Plugins" sub page - Update: Removed unnecessary hidden inputs from the Settings page - Update: Merged public CSS files to reduce the output and improve the performance - Update: Translations (EN and DE) - Bugfix: Removed the 'trim' function to allow whitespaces at the beginning and end of each setting - Bugfix: Convert the footnotes short code to HTML special chars when adding them into the page/post editor (visual and text) - Bugfix: Detailed error messages if other Plugins can't be loaded. Also added empty strings as default values to avoid 'undefined' git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@1000036 b8457f37-d9ea-0310-8a92-e5e31aec5664
111 lines
No EOL
2.8 KiB
PHP
111 lines
No EOL
2.8 KiB
PHP
<?php
|
|
/**
|
|
* Includes the main Class of the Plugin.
|
|
*
|
|
* @filesource
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0 12.09.14 10:56
|
|
*/
|
|
|
|
|
|
/**
|
|
* Entry point of the Plugin. Loads the Dashboard and executes the Task.
|
|
*
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0
|
|
*/
|
|
class MCI_Footnotes {
|
|
|
|
/**
|
|
* Reference to the Plugin Task object.
|
|
*
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0
|
|
* @var null|MCI_Footnotes_Task
|
|
*/
|
|
public $a_obj_Task = null;
|
|
|
|
/**
|
|
* Executes the Plugin.
|
|
*
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0
|
|
*/
|
|
public function run() {
|
|
// register language
|
|
MCI_Footnotes_Language::registerHooks();
|
|
// register Button hooks
|
|
MCI_Footnotes_WYSIWYG::registerHooks();
|
|
// register general hooks
|
|
MCI_Footnotes_Hooks::registerHooks();
|
|
// register all Widgets of the Plugin.
|
|
$this->initializeWidgets();
|
|
// initialize the Plugin Dashboard
|
|
$this->initializeDashboard();
|
|
// initialize the Plugin Task
|
|
$this->initializeTask();
|
|
|
|
// Register all Public Stylesheets
|
|
add_action('init', array($this, 'registerPublicStyling'));
|
|
// Register all Public Scripts
|
|
add_action('init', array($this, 'registerPublicScripts'));
|
|
// Enqueue all Public Stylesheets
|
|
add_action('wp_enqueue_scripts', array($this, 'registerPublicStyling'));
|
|
// Enqueue all Public Scripts
|
|
add_action('wp_enqueue_scripts', array($this, 'registerPublicScripts'));
|
|
}
|
|
|
|
/**
|
|
* Initializes all Widgets of the Plugin.
|
|
*
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0
|
|
*/
|
|
private function initializeWidgets() {
|
|
add_action('widgets_init', create_function('', 'return register_widget("MCI_Footnotes_Widget_ReferenceContainer");'));
|
|
}
|
|
|
|
/**
|
|
* Initializes the Dashboard of the Plugin and loads them.
|
|
*
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0
|
|
*/
|
|
private function initializeDashboard() {
|
|
new MCI_Footnotes_Layout_Init();
|
|
}
|
|
|
|
/**
|
|
* Initializes the Plugin Task and registers the Task hooks.
|
|
*
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0
|
|
*/
|
|
private function initializeTask() {
|
|
$this->a_obj_Task = new MCI_Footnotes_Task();
|
|
$this->a_obj_Task->registerHooks();
|
|
}
|
|
|
|
/**
|
|
* Registers and enqueue scripts to the public pages.
|
|
*
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0
|
|
*/
|
|
public function registerPublicScripts() {
|
|
// add the jQuery plugin (already registered by WordPress)
|
|
wp_enqueue_script('jquery');
|
|
wp_enqueue_script('mci_footnotes_js_jquery_tools', plugins_url('../js/jquery.tools.min.js', __FILE__), array());
|
|
}
|
|
|
|
/**
|
|
* Registers and enqueue stylesheets to the public pages.
|
|
*
|
|
* @author Stefan Herndler
|
|
* @since 1.5.0
|
|
*/
|
|
public function registerPublicStyling() {
|
|
wp_register_style('mci_footnotes_css_public', plugins_url('../css/public.css', __FILE__));
|
|
wp_enqueue_style('mci_footnotes_css_public');
|
|
}
|
|
} |