This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
footnotes/classes/widget.php
Aricura 3802249ec4 Changes for upcoming version 1.3.0
- Bugfix: Changed tooltip class to be unique
- Bugfix: Changed superscript styling to not manipulate the line height
- Bugfix: Changed styling of the footnotes text in the reference container to avoid line breaks
- Updated: Reformatted code
- Added: new settings tab for custom CSS settings

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@957947 b8457f37-d9ea-0310-8a92-e5e31aec5664
2014-07-31 10:17:38 +00:00

70 lines
No EOL
1.8 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: Stefan
* Date: 24.05.14
* Time: 13:57
*/
// define class only once
if (!class_exists("MCI_Footnotes_Widget")) :
/**
* Class MCI_Footnotes_Widget
* @since 1.0
*/
class MCI_Footnotes_Widget extends WP_Widget {
/**
* @constructor
*/
public function __construct() {
// set widget class and description
$l_arr_WidgetMeta = array(
'classname' => 'Class_FootnotesWidget',
'description' => __('The widget defines the position of the reference container if set to "widget area".', FOOTNOTES_PLUGIN_NAME)
);
// set widget layout information
$l_arr_WidgetLayout = array(
'width' => 300,
'height' => 350,
'id_base' => 'footnotes_widget'
);
// add widget to the list
$this->WP_Widget('footnotes_widget', FOOTNOTES_PLUGIN_NAME, $l_arr_WidgetMeta, $l_arr_WidgetLayout);
}
/**
* widget form creation
* @param $instance
* @return void
*/
public function form($instance) {
echo __('The widget defines the position of the reference container if set to "widget area".', FOOTNOTES_PLUGIN_NAME);
}
/**
* widget update
* @param $new_instance
* @param $old_instance
* @return mixed
*/
public function update($new_instance, $old_instance) {
return $new_instance;
}
/**
* widget display
* @param $args
* @param $instance
*/
public function widget($args, $instance) {
global $g_obj_MCI_Footnotes;
// reference container positioning is set to "widget area"
if ($g_obj_MCI_Footnotes->a_obj_Task->a_arr_Settings[FOOTNOTES_INPUT_REFERENCE_CONTAINER_PLACE] == "widget") {
echo $g_obj_MCI_Footnotes->a_obj_Task->ReferenceContainer();
}
}
} // class MCI_Footnotes_Widget
endif;