2021-02-26 08:07:03 +00:00
< ? php
2021-02-23 16:00:59 +00:00
/**
* Includes the Plugin Widget to put the Reference Container to the Widget area .
*
* @ filesource
2021-02-26 08:07:03 +00:00
* @ author Stefan Herndler
* @ since 1.5 . 0 14.09 . 14 14 : 26
*
* Edited 2.2 . 0 2020 - 12 - 12 T2131 + 0100
2021-02-23 16:00:59 +00:00
*/
2021-02-26 08:07:03 +00:00
2021-02-23 16:00:59 +00:00
/**
* Registers a Widget to put the Reference Container to the widget area .
*
2021-02-26 08:07:03 +00:00
* @ author Stefan Herndler
2021-02-23 16:00:59 +00:00
* @ since 1.5 . 0
*/
2021-02-26 08:07:03 +00:00
class MCI_Footnotes_Widget_ReferenceContainer extends MCI_Footnotes_WidgetBase {
2021-02-23 16:00:59 +00:00
/**
* Returns an unique ID as string used for the Widget Base ID .
*
2021-02-26 08:07:03 +00:00
* @ author Stefan Herndler
2021-02-23 16:00:59 +00:00
* @ since 1.5 . 0
* @ return string
*/
2021-02-26 08:07:03 +00:00
protected function getID () {
return " footnotes_widget " ;
2021-02-23 16:00:59 +00:00
}
/**
* Returns the Public name of the Widget to be displayed in the Configuration page .
*
2021-02-26 08:07:03 +00:00
* @ author Stefan Herndler
2021-02-23 16:00:59 +00:00
* @ since 1.5 . 0
* @ return string
*/
2021-02-26 08:07:03 +00:00
protected function getName () {
2021-02-23 16:00:59 +00:00
return MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ;
}
/**
* Returns the Description of the child widget .
*
2021-02-26 08:07:03 +00:00
* @ author Stefan Herndler
2021-02-23 16:00:59 +00:00
* @ since 1.5 . 0
* @ return string
2021-02-26 08:07:03 +00:00
*
2021-02-23 16:00:59 +00:00
* Edit : curly quotes 2.2 . 0 2020 - 12 - 12 T2130 + 0100
*/
2021-02-26 08:07:03 +00:00
protected function getDescription () {
return __ ( 'The widget defines the position of the reference container if set to “widget area”.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME );
2021-02-23 16:00:59 +00:00
}
/**
* Outputs the Settings of the Widget .
*
2021-02-26 08:07:03 +00:00
* @ author Stefan Herndler
2021-02-23 16:00:59 +00:00
* @ since 1.5 . 0
2021-02-26 08:07:03 +00:00
* @ param mixed $instance
2021-02-23 16:00:59 +00:00
* @ return void
2021-02-26 08:07:03 +00:00
*
2021-02-23 16:00:59 +00:00
* Edit : curly quotes 2.2 . 0 2020 - 12 - 12 T2130 + 0100
*/
2021-02-26 08:07:03 +00:00
public function form ( $instance ) {
echo __ ( 'The widget defines the position of the reference container if set to “widget area”.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME );
2021-02-23 16:00:59 +00:00
}
/**
* Outputs the Content of the Widget .
*
2021-02-26 08:07:03 +00:00
* @ author Stefan Herndler
2021-02-23 16:00:59 +00:00
* @ since 1.5 . 0
2021-02-26 08:07:03 +00:00
* @ param mixed $args
* @ param mixed $instance
2021-02-23 16:00:59 +00:00
*/
2021-02-26 08:07:03 +00:00
public function widget ( $args , $instance ) {
global $g_obj_MCI_Footnotes ;
// reference container positioning is set to "widget area"
if ( MCI_Footnotes_Settings :: instance () -> get ( MCI_Footnotes_Settings :: C_STR_REFERENCE_CONTAINER_POSITION ) == " widget " ) {
echo $g_obj_MCI_Footnotes -> a_obj_Task -> ReferenceContainer ();
2021-02-23 16:00:59 +00:00
}
}
}