2014-09-14 20:32:59 +00:00
< ? php
/**
* Includes the Plugin Class to display all Settings .
*
* @ filesource
* @ author Stefan Herndler
* @ since 1.5 . 0 14.09 . 14 14 : 47
2020-11-20 05:40:03 +00:00
*
2020-11-08 21:21:24 +00:00
* Edited for :
2020-12-03 17:38:14 +00:00
* 2.0 . 4 restore arrow settings 2020 - 11 - 01 T0509 + 0100
* 2.1 . 0 read - on button label 2020 - 11 - 08 T2148 + 0100
* 2.1 . 1 options for ref container and alternative tooltips 2020 - 11 - 16 T2152 + 0100
2020-12-06 16:30:14 +00:00
* 2.1 . 4 settings for ref container , tooltips and scrolling 2020 - 12 - 03 T0950 + 0100
2020-12-12 21:07:24 +00:00
* 2.1 . 6 slight UI reordering 2020 - 12 - 09 T1114 + 0100
* 2.1 . 6 option to disable URL line wrapping 2020 - 12 - 09 T1604 + 0100
* 2.1 . 6 remove expert mode setting as irrelevant 2020 - 12 - 09 T2105 + 0100
* 2.2 . 0 add options , redistribute , update strings 2020 - 12 - 12 T2135 + 0100
2020-11-20 05:40:03 +00:00
*
2020-12-12 21:07:24 +00:00
* Last modified : 2020 - 12 - 12 T2202 + 0100
2014-09-14 20:32:59 +00:00
*/
/**
* Displays and handles all Settings of the Plugin .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
*/
class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
2020-10-27 11:56:49 +00:00
/**
* Returns a Priority index . Lower numbers have a higher Priority .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
* @ return int
*/
public function getPriority () {
return 10 ;
}
/**
* Returns the unique slug of the sub page .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
* @ return string
*/
protected function getSubPageSlug () {
return " - " . MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ;
}
/**
* Returns the title of the sub page .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
* @ return string
*/
protected function getSubPageTitle () {
return MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME ;
}
/**
* Returns an array of all registered sections for the sub page .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
* @ return array
2020-12-12 21:07:24 +00:00
*
* Edited :
* 2.1 . 6 tabs reordered and renamed
* @ see customization vs configuration
* < https :// www . linkedin . com / pulse / 20140610191154 - 4746170 - configuration - vs - customization - when - and - why - would - i - implement - each >
*
* 2.1 . 6 removed if statement around expert tab
2020-10-27 11:56:49 +00:00
*/
protected function getSections () {
2014-10-08 21:36:35 +00:00
$l_arr_Tabs = array ();
2020-12-12 21:07:24 +00:00
$l_arr_Tabs [] = $this -> addSection ( " settings " , __ ( " General settings " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), 0 , true );
$l_arr_Tabs [] = $this -> addSection ( " customize " , __ ( " Referrers and tooltips " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), 1 , true );
$l_arr_Tabs [] = $this -> addSection ( " expert " , __ ( " Priority and CSS " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), 2 , true );
$l_arr_Tabs [] = $this -> addSection ( " how-to " , __ ( " Quick start guide " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), null , false );
2020-10-27 11:56:49 +00:00
return $l_arr_Tabs ;
}
/**
* Returns an array of all registered meta boxes for each section of the sub page .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
* @ return array
2020-11-20 05:40:03 +00:00
*
2020-12-12 21:07:24 +00:00
* Edited for 2.0 . 0 and later .
*
* HyperlinkArrow meta box :
* @ since 2.0 . 0 discontinued
* @ since 2.0 . 4 restored to meet user demand for arrow symbol semantics
* @ since 2.1 . 4 discontinued , content moved to Settings > Reference container > Display a backlink symbol
*
* @ since 2.0 . 4 to reflect changes in meta box label display since WPv5 . 5
* spans need position : fixed and become unlocalizable
* fix : logo is kept only in the label that doesn’ t need to be translated :
* Change string " %s styling " to " Footnotes styling " to fix layout in WPv5 . 5
* @ see details in class / config . php
*
* @ since 2.1 . 6 / 2.2 . 0 tabs reordered and renamed
2020-10-27 11:56:49 +00:00
*/
protected function getMetaBoxes () {
return array (
2020-12-12 21:07:24 +00:00
$this -> addMetaBox ( " settings " , " start-end " , __ ( " Footnote start and end short codes " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " StartEnd " ),
$this -> addMetaBox ( " settings " , " numbering " , __ ( " Footnotes numbering " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " Numbering " ),
$this -> addMetaBox ( " settings " , " scrolling " , __ ( " Scrolling behavior " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " Scrolling " ),
$this -> addMetaBox ( " settings " , " reference-container " , __ ( " Reference container " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " ReferenceContainer " ),
$this -> addMetaBox ( " settings " , " excerpts " , __ ( " Footnotes in excerpts " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " Excerpts " ),
2020-11-01 05:41:22 +00:00
$this -> addMetaBox ( " settings " , " love " , MCI_Footnotes_Config :: C_STR_PLUGIN_HEADING_NAME . ' ' . MCI_Footnotes_Config :: C_STR_LOVE_SYMBOL_HEADING , " Love " ),
2020-12-12 21:07:24 +00:00
$this -> addMetaBox ( " customize " , " superscript " , __ ( " Referrer typesetting and formatting " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " Superscript " ),
$this -> addMetaBox ( " customize " , " mouse-over-box-display " , __ ( " Tooltip display " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " MouseOverBoxDisplay " ),
$this -> addMetaBox ( " customize " , " mouse-over-box-truncation " , __ ( " Tooltip truncation " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " MouseOverBoxTruncation " ),
$this -> addMetaBox ( " customize " , " mouse-over-box-appearance " , __ ( " Tooltip appearance " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " MouseOverBoxAppearance " ),
2020-10-27 11:56:49 +00:00
2020-12-12 21:07:24 +00:00
$this -> addMetaBox ( " expert " , " lookup " , __ ( " WordPress hooks and priority levels " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " LookupHooks " ),
$this -> addMetaBox ( " expert " , " custom-css " , __ ( " Custom CSS " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " CustomCSS " ),
2014-10-08 21:36:35 +00:00
2020-10-27 11:56:49 +00:00
$this -> addMetaBox ( " how-to " , " help " , __ ( " Brief introduction in how to use the plugin " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " Help " ),
$this -> addMetaBox ( " how-to " , " donate " , __ ( " Help us to improve our Plugin " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), " Donate " )
);
}
/**
* Displays all settings for the reference container .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
2020-11-30 06:17:43 +00:00
*
* Completed :
2020-12-06 16:30:14 +00:00
* @ since 2.1 . 4 : layout and typography options 2020 - 11 - 30 T0548 + 0100
2020-10-27 11:56:49 +00:00
*/
public function ReferenceContainer () {
// options for the positioning of the reference container
$l_arr_Positions = array (
" footer " => __ ( " in the footer " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" post_end " => __ ( " at the end of the post " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" widget " => __ ( " in the widget area " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
2020-12-04 22:51:29 +00:00
// basic responsive page layout options:
$l_arr_PageLayoutOptions = array (
" none " => __ ( " Don’ t fix the layout " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-06 12:46:45 +00:00
" reference-container " => __ ( " to the reference container " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" page-content " => __ ( " to everything after the post title until the reference container " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" main-content " => __ ( " to everything from the post title to the reference container " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-04 22:51:29 +00:00
);
2020-11-30 06:17:43 +00:00
// options for the separating punctuation between backlinks:
// Unicode names are conventionally uppercase.
$l_arr_Separators = array (
" comma " => __ ( " COMMA " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" semicolon " => __ ( " SEMICOLON " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" en_dash " => __ ( " EN DASH " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
// options for the terminating punctuation after backlinks:
// The Unicode name of RIGHT PARENTHESIS was originally more accurate because it is bidi-mirrored.
// The wrong names were enforced in spite of Unicode, that subsequently scrambled to correct.
$l_arr_Terminators = array (
" period " => __ ( " FULL STOP " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" parenthesis " => __ ( " CLOSING PARENTHESIS " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" colon " => __ ( " COLON " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
2020-12-03 07:55:27 +00:00
// options for the first column width (per cent is a ratio, not a unit):
$l_arr_WidthUnits = array (
" % " => __ ( " per cent " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" px " => __ ( " pixels " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-06 12:46:45 +00:00
" rem " => __ ( " root em " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-03 07:55:27 +00:00
" em " => __ ( " em " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-06 12:46:45 +00:00
" vw " => __ ( " viewport width " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-03 07:55:27 +00:00
);
2020-11-16 20:57:15 +00:00
// options for Yes/No select box:
$l_arr_Enabled = array (
" yes " => __ ( " Yes " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" no " => __ ( " No " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
2020-10-27 11:56:49 +00:00
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " settings-reference-container " );
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-09 15:12:37 +00:00
" label-name " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_REFERENCE_CONTAINER_NAME , __ ( " Heading: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-10-27 11:56:49 +00:00
" name " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_REFERENCE_CONTAINER_NAME ),
2020-12-09 15:12:37 +00:00
" label-collapse " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_COLLAPSE , __ ( " Collapse by default: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-11-16 20:57:15 +00:00
" collapse " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_COLLAPSE , $l_arr_Enabled ),
2020-12-09 15:12:37 +00:00
" label-position " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_REFERENCE_CONTAINER_POSITION , __ ( " Position: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-04 22:51:29 +00:00
" position " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_REFERENCE_CONTAINER_POSITION , $l_arr_Positions ),
2020-12-09 15:12:37 +00:00
" label-page-layout " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT , __ ( " Apply basic responsive page layout: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-04 22:51:29 +00:00
" page-layout " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT , $l_arr_PageLayoutOptions ),
2020-12-06 12:46:45 +00:00
" notice-page-layout " => __ ( " Most themes don’ t need this fix. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-04 22:51:29 +00:00
2020-12-12 21:07:24 +00:00
" label-url-wrap " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTE_URL_WRAP_ENABLED , __ ( " Allow URLs to line-wrap anywhere: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
" url-wrap " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTE_URL_WRAP_ENABLED , $l_arr_Enabled ),
" notice-url-wrap " => __ ( " Unicode-conformant browsers don’ t need this fix. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-09 15:12:37 +00:00
" label-startpage " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE , __ ( " Display on start page too: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-11-17 02:14:21 +00:00
" startpage " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE , $l_arr_Enabled ),
2020-11-16 20:57:15 +00:00
2020-12-09 15:12:37 +00:00
" label-symbol " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE , __ ( " Display a backlink symbol: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-01 12:59:28 +00:00
" symbol-enable " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE , $l_arr_Enabled ),
" symbol-options " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_HYPERLINK_ARROW , MCI_Footnotes_Convert :: getArrow ()),
" symbol-custom " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_HYPERLINK_ARROW_USER_DEFINED ),
2020-12-06 12:46:45 +00:00
" notice-symbol " => __ ( " Your input overrides the selection. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-11-16 20:57:15 +00:00
2020-12-09 15:12:37 +00:00
" label-switch " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH , __ ( " Symbol appended, not prepended: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-03 07:55:27 +00:00
" switch " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH , $l_arr_Enabled ),
2020-12-09 15:12:37 +00:00
" label-3column " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE , __ ( " Backlink symbol in an extra column: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-01 12:59:28 +00:00
" 3column " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE , $l_arr_Enabled ),
2020-12-06 12:46:45 +00:00
" notice-3column " => __ ( " This legacy layout is available if identical footnotes are not combined. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-10-27 11:56:49 +00:00
2020-12-09 15:12:37 +00:00
" label-separator " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_SEPARATOR_ENABLED , __ ( " Add a separator when enumerating backlinks: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-11-30 06:17:43 +00:00
" separator-enable " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_SEPARATOR_ENABLED , $l_arr_Enabled ),
" separator-options " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_BACKLINKS_SEPARATOR_OPTION , $l_arr_Separators ),
" separator-custom " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_BACKLINKS_SEPARATOR_CUSTOM ),
2020-12-06 12:46:45 +00:00
" notice-separator " => __ ( " Your input overrides the selection. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-11-28 09:58:23 +00:00
2020-12-09 15:12:37 +00:00
" label-terminator " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_TERMINATOR_ENABLED , __ ( " Add a terminal punctuation to backlinks: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-11-30 06:17:43 +00:00
" terminator-enable " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_TERMINATOR_ENABLED , $l_arr_Enabled ),
" terminator-options " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_BACKLINKS_TERMINATOR_OPTION , $l_arr_Terminators ),
" terminator-custom " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_BACKLINKS_TERMINATOR_CUSTOM ),
2020-12-06 12:46:45 +00:00
" notice-terminator " => __ ( " Your input overrides the selection. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-03 07:55:27 +00:00
2020-12-09 15:12:37 +00:00
" label-width " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_COLUMN_WIDTH_ENABLED , __ ( " Set backlinks column width: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-03 07:55:27 +00:00
" width-enable " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_COLUMN_WIDTH_ENABLED , $l_arr_Enabled ),
2020-12-05 04:48:09 +00:00
" width-scalar " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR , 0 , 500 , true ),
2020-12-03 07:55:27 +00:00
" width-unit " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_BACKLINKS_COLUMN_WIDTH_UNIT , $l_arr_WidthUnits ),
2020-12-06 12:46:45 +00:00
" notice-width " => __ ( " Absolute width in pixels doesn’ t need to be accurate to the tenth, but relative width in rem or em may. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-11-28 09:58:23 +00:00
2020-12-09 15:12:37 +00:00
" label-max-width " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED , __ ( " Set backlinks column maximum width: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-03 07:55:27 +00:00
" max-width-enable " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED , $l_arr_Enabled ),
2020-12-05 04:48:09 +00:00
" max-width-scalar " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR , 0 , 500 , true ),
2020-12-03 07:55:27 +00:00
" max-width-unit " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT , $l_arr_WidthUnits ),
2020-12-06 12:46:45 +00:00
" notice-max-width " => __ ( " Absolute width in pixels doesn’ t need to be accurate to the tenth, but relative width in rem or em may. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-03 07:55:27 +00:00
2020-12-09 15:12:37 +00:00
" label-line-break " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_LINE_BREAKS_ENABLED , __ ( " Stack backlinks when enumerating: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-03 07:55:27 +00:00
" line-break " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_BACKLINKS_LINE_BREAKS_ENABLED , $l_arr_Enabled ),
2020-12-12 21:07:24 +00:00
" notice-line-break " => __ ( " This option adds a line break before each added backlink when identical footnotes are combined. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-10-27 11:56:49 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
/**
2020-12-12 21:07:24 +00:00
* Displays all options for the footnotes start and end tag short codes
* Displays all options for the footnotes numbering
* Displays all options for the scrolling behavior
2020-10-27 11:56:49 +00:00
*
* @ author Stefan Herndler
* @ since 1.5 . 0
2020-12-12 21:07:24 +00:00
*
* Edited heading 2020 - 12 - 12 T1412 + 0100
* @ since 2.2 . 0 more short code options 2020 - 12 - 12 T1412 + 0100
* @ since 2.2 . 0 3 boxes for clarity 2020 - 12 - 12 T1422 + 0100
2020-10-27 11:56:49 +00:00
*/
2020-12-12 21:07:24 +00:00
public function StartEnd () {
// footnotes start tag short code options:
2020-10-27 11:56:49 +00:00
$l_arr_ShortCodeStart = array (
" (( " => " (( " ,
2020-12-12 21:07:24 +00:00
" ((( " => " ((( " ,
" { { " => " { { " ,
" { { { " => " { { { " ,
" [n] " => " [n] " ,
" [fn] " => " [fn] " ,
2020-10-27 11:56:49 +00:00
htmlspecialchars ( " <fn> " ) => htmlspecialchars ( " <fn> " ),
" [ref] " => " [ref] " ,
2020-12-12 21:07:24 +00:00
htmlspecialchars ( " <ref> " ) => htmlspecialchars ( " <ref> " ),
htmlspecialchars ( " <!--n> " ) => htmlspecialchars ( " <!--n> " ),
// Custom (user-defined) start and end tags bracketing the footnote text inline:
" userdefined " => __ ( 'custom short code' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
2020-10-27 11:56:49 +00:00
);
2020-12-12 21:07:24 +00:00
// footnotes end tag short code options:
2020-10-27 11:56:49 +00:00
$l_arr_ShortCodeEnd = array (
" )) " => " )) " ,
2020-12-12 21:07:24 +00:00
" ))) " => " ))) " ,
" }} " => " }} " ,
" }}} " => " }}} " ,
" [/n] " => " [/n] " ,
" [/fn] " => " [/fn] " ,
2020-10-27 11:56:49 +00:00
htmlspecialchars ( " </fn> " ) => htmlspecialchars ( " </fn> " ),
" [/ref] " => " [/ref] " ,
2020-12-12 21:07:24 +00:00
htmlspecialchars ( " </ref> " ) => htmlspecialchars ( " </ref> " ),
htmlspecialchars ( " <n--> " ) => htmlspecialchars ( " <n--> " ),
// Custom (user-defined) start and end tags bracketing the footnote text inline:
" userdefined " => __ ( 'custom short code' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
2020-10-27 11:56:49 +00:00
);
// load template file
2020-12-12 21:07:24 +00:00
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " settings-start-end " );
2020-10-27 11:56:49 +00:00
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-09 15:12:37 +00:00
" label-short-code-start " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_START , __ ( " Footnote start tag short code: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-10-27 11:56:49 +00:00
" short-code-start " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_START , $l_arr_ShortCodeStart ),
2020-11-30 06:17:43 +00:00
" short-code-start-user " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED ),
2020-10-27 11:56:49 +00:00
2020-12-09 15:12:37 +00:00
" label-short-code-end " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_END , __ ( " Footnote end tag short code: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-10-27 11:56:49 +00:00
" short-code-end " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_END , $l_arr_ShortCodeEnd ),
" short-code-end-user " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED ),
2020-11-30 06:17:43 +00:00
// for script showing/hiding user defined text boxes:
2020-10-27 11:56:49 +00:00
" short-code-start-id " => MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_START ,
" short-code-end-id " => MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_END ,
" short-code-start-user-id " => MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED ,
" short-code-end-user-id " => MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED ,
2020-11-30 06:17:43 +00:00
2020-12-12 21:07:24 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
public function Numbering () {
// define some space for the output
$l_str_Space = " " ;
// options for the combination of identical footnotes
$l_arr_Enable = array (
" yes " => __ ( " Yes " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" no " => __ ( " No " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
// options for the numbering style of the footnotes:
$l_arr_CounterStyle = array (
" arabic_plain " => __ ( " plain Arabic numbers " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . $l_str_Space . " 1, 2, 3, 4, 5, … " ,
" arabic_leading " => __ ( " zero-padded Arabic numbers " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . $l_str_Space . " 01, 02, 03, 04, 05, … " ,
" latin_low " => __ ( " lowercase Latin letters " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . $l_str_Space . " a, b, c, d, e, … " ,
" latin_high " => __ ( " uppercase Latin letters " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . $l_str_Space . " A, B, C, D, E, … " ,
" romanic " => __ ( " uppercase Roman numerals " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . $l_str_Space . " I, II, III, IV, V, … " ,
" roman_low " => __ ( " lowercase Roman numerals " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . $l_str_Space . " i, ii, iii, iv, v, … " ,
);
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " settings-numbering " );
// replace all placeholders
$l_obj_Template -> replace (
array (
" label-counter-style " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_COUNTER_STYLE , __ ( " Numbering style: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-11-30 06:17:43 +00:00
" counter-style " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_COUNTER_STYLE , $l_arr_CounterStyle ),
// algorithmically combine identicals:
2020-12-09 15:12:37 +00:00
" label-identical " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_COMBINE_IDENTICAL_FOOTNOTES , __ ( " Combine identical footnotes: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-05 04:48:09 +00:00
" identical " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_COMBINE_IDENTICAL_FOOTNOTES , $l_arr_Enable ),
2020-12-12 21:07:24 +00:00
" notice-identical " => __ ( " This option may require copy-pasting footnotes in multiple instances. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" description1-identical " => __ ( " Even when footnotes are combined, footnote numbers keep incrementing. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" description2-identical " => __ ( " This avoids suboptimal referrer and backlink disambiguation using a secondary numbering system. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" description3-identical " => __ ( " Repeating the content is an opportunity to add details. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
public function Scrolling () {
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " settings-scrolling " );
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-05 04:48:09 +00:00
2020-12-09 15:12:37 +00:00
" label-scroll-offset " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_SCROLL_OFFSET , __ ( " Scroll offset: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-05 04:48:09 +00:00
" scroll-offset " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_SCROLL_OFFSET , 0 , 100 ),
" notice-scroll-offset " => __ ( " per cent from the upper edge of the window " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-09 15:12:37 +00:00
" label-scroll-duration " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_SCROLL_DURATION , __ ( " Scroll duration: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-05 04:48:09 +00:00
" scroll-duration " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_SCROLL_DURATION , 0 , 20000 ),
" notice-scroll-duration " => __ ( " milliseconds " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-11-30 06:17:43 +00:00
2020-10-27 11:56:49 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
/**
* Displays all settings for 'I love Footnotes' .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
2020-12-12 21:07:24 +00:00
*
* Edited :
* @ since 2.2 . 0 position - sensitive placeholders to support more locales 2020 - 12 - 11 T0432 + 0100
* @ since 2.2 . 0 more options 2020 - 12 - 11 T0432 + 0100
2020-10-27 11:56:49 +00:00
*/
public function Love () {
2020-12-12 21:07:24 +00:00
// options for the acknowledgment display in the footer:
2020-10-27 11:56:49 +00:00
$l_arr_Love = array (
2020-12-12 21:07:24 +00:00
// logo only:
2020-12-09 15:12:37 +00:00
" text-3 " => sprintf ( '%s' , MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME ),
2020-12-12 21:07:24 +00:00
// logo followed by heart symbol:
" text-4 " => sprintf ( '%s %s' , MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME , MCI_Footnotes_Config :: C_STR_LOVE_SYMBOL ),
// logo preceded by heart symbol:
" text-5 " => sprintf ( '%s %s' , MCI_Footnotes_Config :: C_STR_LOVE_SYMBOL , MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME ),
// "I love Footnotes": placeholder %1$s is the 'footnotes' logogram, placeholder %2$s is a heart symbol.
" text-1 " => sprintf ( __ ( 'I %2$s %1$s' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME , MCI_Footnotes_Config :: C_STR_LOVE_SYMBOL ),
// "This website uses Footnotes."
" text-6 " => sprintf ( __ ( 'This website uses %s.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME ),
// "This website uses the Footnotes plugin."
" text-7 " => sprintf ( __ ( 'This website uses the %s plugin.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME ),
// "This website uses the awesome Footnotes plugin."
" text-2 " => sprintf ( __ ( 'This website uses the awesome %s plugin.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME ),
" random " => __ ( 'randomly determined display of either mention' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
// "No display of any “Footnotes love” mention in the footer"
" no " => sprintf ( __ ( 'no display of any “%1$s %2$s” mention in the footer' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME , MCI_Footnotes_Config :: C_STR_LOVE_SYMBOL )
2020-10-27 11:56:49 +00:00
);
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " settings-love " );
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-09 15:12:37 +00:00
" label-love " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_LOVE , sprintf ( __ ( " Tell the world you’ re using %s: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME )),
2020-10-27 11:56:49 +00:00
" love " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_LOVE , $l_arr_Love ),
2020-12-12 21:07:24 +00:00
" label-no-love " => $this -> addText ( sprintf ( __ ( " Shortcode to inhibit the display of the %s mention on specific pages: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), MCI_Footnotes_Config :: C_STR_PLUGIN_PUBLIC_NAME )),
2020-10-27 11:56:49 +00:00
" no-love " => $this -> addText ( MCI_Footnotes_Config :: C_STR_NO_LOVE_SLUG )
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
/**
2020-12-12 21:07:24 +00:00
* Displays the excerpt setting
2020-10-27 11:56:49 +00:00
*
* @ author Stefan Herndler
* @ since 1.5 . 0
2020-12-12 21:07:24 +00:00
*
* Edited heading 2020 - 12 - 12 T1453 + 0100
* @ since 2.1 . 1 more settings and notices
* @ since 2.2 . 0 dedicated to the excerpt setting and its notices 2020 - 12 - 12 T1454 + 0100
2020-10-27 11:56:49 +00:00
*/
2020-12-12 21:07:24 +00:00
public function Excerpts () {
2020-11-16 20:57:15 +00:00
// options for Yes/No select box:
2020-10-27 11:56:49 +00:00
$l_arr_Enabled = array (
" yes " => __ ( " Yes " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" no " => __ ( " No " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
// load template file
2020-12-12 21:07:24 +00:00
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " settings-excerpts " );
2020-10-27 11:56:49 +00:00
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-12 21:07:24 +00:00
" label-excerpts " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_IN_EXCERPT , __ ( " Display footnotes in excerpts: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
" excerpts " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_IN_EXCERPT , $l_arr_Enabled ),
" notice-excerpts " => __ ( " The recommended value is No. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
// In some themes, the Advanced Excerpt plugin is indispensable to display footnotes in excerpts.
" description1-excerpts " => sprintf ( __ ( " In some themes, the %s plugin is indispensable to display footnotes in excerpts. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), '<a href="https://wordpress.org/plugins/advanced-excerpt/" target="_blank">Advanced Excerpt</a>' ),
" description2-excerpts " => __ ( " Footnotes cannot be disabled in excerpts. A workaround is to avoid footnotes in the first 55 words. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-10-27 11:56:49 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
/**
2020-12-12 21:07:24 +00:00
* Displays all settings for the footnote referrers
2020-10-27 11:56:49 +00:00
*
* @ author Stefan Herndler
* @ since 1.5 . 0
2020-12-12 21:07:24 +00:00
*
* Edited heading 2020 - 12 - 12 T1513 + 0100
* @ since 2.1 . 1 option for superscript ( optionally baseline referrers )
* @ since 2.2 . 0 option for link element moved here 2020 - 12 - 12 T1514 + 0100
2020-10-27 11:56:49 +00:00
*/
public function Superscript () {
2020-11-16 20:57:15 +00:00
// options for Yes/No select box:
$l_arr_Enabled = array (
" yes " => __ ( " Yes " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" no " => __ ( " No " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
2020-10-27 11:56:49 +00:00
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " customize-superscript " );
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-12 21:07:24 +00:00
" label-superscript " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS , __ ( " Display footnote referrers in superscript: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-11-17 02:14:21 +00:00
" superscript " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS , $l_arr_Enabled ),
2020-11-16 20:57:15 +00:00
2020-12-12 21:07:24 +00:00
" label-before " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_STYLING_BEFORE , __ ( " At the start of the footnote referrers: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-10-27 11:56:49 +00:00
" before " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_STYLING_BEFORE ),
2020-12-12 21:07:24 +00:00
" label-after " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_STYLING_AFTER , __ ( " At the end of the footnote referrers: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
" after " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_STYLING_AFTER ),
" label-link " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_LINK_ELEMENT_ENABLED , __ ( " Use the link element for referrers and backlinks: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
" link " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_LINK_ELEMENT_ENABLED , $l_arr_Enabled ),
" notice-link " => __ ( " The link element is needed to apply the theme’ s link color. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-10-27 11:56:49 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
/**
* Displays all settings for the footnotes mouse - over box .
*
* @ author Stefan Herndler
* @ since 1.5 . 2
2020-12-12 21:07:24 +00:00
*
* Edited :
* @ since 2.2 . 0 3 parts to address increased settings number
2020-10-27 11:56:49 +00:00
*/
2020-12-12 21:07:24 +00:00
public function MouseOverBoxDisplay () {
2020-11-16 20:57:15 +00:00
// options for Yes/No select box:
2020-10-27 11:56:49 +00:00
$l_arr_Enabled = array (
" yes " => __ ( " Yes " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" no " => __ ( " No " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
// options for the Mouse-over box position
$l_arr_Position = array (
2020-12-12 21:07:24 +00:00
" top left " => __ ( " top left " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" top center " => __ ( " top center " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" top right " => __ ( " top right " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" center right " => __ ( " center right " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" bottom right " => __ ( " bottom right " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-10-27 11:56:49 +00:00
" bottom center " => __ ( " bottom center " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-12 21:07:24 +00:00
" bottom left " => __ ( " bottom left " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" center left " => __ ( " center left " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-03 07:55:27 +00:00
);
2020-10-27 11:56:49 +00:00
// load template file
2020-12-12 21:07:24 +00:00
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " mouse-over-box-display " );
2020-10-27 11:56:49 +00:00
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-03 07:55:27 +00:00
2020-12-12 21:07:24 +00:00
" label-enable " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED , __ ( " Display tooltips: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-10-27 11:56:49 +00:00
" enable " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED , $l_arr_Enabled ),
2014-10-11 12:27:00 +00:00
2020-12-12 21:07:24 +00:00
" label-alternative " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE , __ ( " Display alternative tooltips: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-11-11 20:49:44 +00:00
" alternative " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE , $l_arr_Enabled ),
2020-12-12 21:07:24 +00:00
" notice-alternative " => __ ( " Intended to work around a tooltip outage. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-11-16 20:57:15 +00:00
2020-12-09 15:12:37 +00:00
" label-position " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION , __ ( " Position: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-10-27 11:56:49 +00:00
" position " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION , $l_arr_Position ),
2014-10-13 17:06:54 +00:00
2020-12-12 21:07:24 +00:00
" label-offset-x " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X , __ ( " Horizontal offset rightwards: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-05 04:48:09 +00:00
" offset-x " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X , - 150 , 150 ),
2020-12-09 15:12:37 +00:00
" notice-offset-x " => __ ( " pixels; negative value for a leftwards offset " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-13 17:06:54 +00:00
2020-12-09 15:12:37 +00:00
" label-offset-y " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y , __ ( " Vertical offset downwards: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-05 04:48:09 +00:00
" offset-y " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y , - 150 , 150 ),
2020-12-09 15:12:37 +00:00
" notice-offset-y " => __ ( " pixels; negative value for an upwards offset " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-13 17:06:54 +00:00
2020-12-09 15:12:37 +00:00
" label-max-width " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH , __ ( " Maximum width: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-03 07:55:27 +00:00
" max-width " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH , 0 , 1280 ),
2020-12-09 15:12:37 +00:00
" notice-max-width " => __ ( " pixels; 0 to disable this setting " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-03 07:55:27 +00:00
2020-12-09 15:12:37 +00:00
" label-fade-in-delay " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY , __ ( " Fade-in delay: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-06 12:46:45 +00:00
" fade-in-delay " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY , 0 , 20000 ),
" notice-fade-in-delay " => __ ( " milliseconds " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-09 15:12:37 +00:00
" label-fade-in-duration " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION , __ ( " Fade-in duration: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-06 12:46:45 +00:00
" fade-in-duration " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION , 0 , 20000 ),
" notice-fade-in-duration " => __ ( " milliseconds " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-09 15:12:37 +00:00
" label-fade-out-delay " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY , __ ( " Fade-out delay: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-06 12:46:45 +00:00
" fade-out-delay " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY , 0 , 20000 ),
" notice-fade-out-delay " => __ ( " milliseconds " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-09 15:12:37 +00:00
" label-fade-out-duration " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION , __ ( " Fade-out duration: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-06 12:46:45 +00:00
" fade-out-duration " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION , 0 , 20000 ),
" notice-fade-out-duration " => __ ( " milliseconds " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-12 21:07:24 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
public function MouseOverBoxTruncation () {
// options for Yes/No select box:
$l_arr_Enabled = array (
" yes " => __ ( " Yes " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" no " => __ ( " No " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " mouse-over-box-truncation " );
// replace all placeholders
$l_obj_Template -> replace (
array (
" label-truncation " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED , __ ( " Truncate the note in the tooltip: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
" truncation " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED , $l_arr_Enabled ),
" label-max-length " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH , __ ( " Maximum number of characters in the tooltip: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
" max-length " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH , 3 , 10000 ),
" label-readon " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_TOOLTIP_READON_LABEL , __ ( " ‘ Read on’ button label:" , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
" readon " => $this -> addTextBox ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_TOOLTIP_READON_LABEL ),
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
public function MouseOverBoxAppearance () {
// options for Yes/No select box:
$l_arr_Enabled = array (
" yes " => __ ( " Yes " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" no " => __ ( " No " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
);
// options for the font size unit:
$l_arr_FontSizeUnits = array (
" em " => __ ( " em " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" rem " => __ ( " rem " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" px " => __ ( " pixels " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" pt " => __ ( " points " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" pc " => __ ( " picas " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" mm " => __ ( " millimeters " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" % " => __ ( " per cent " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
);
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " mouse-over-box-appearance " );
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-03 07:55:27 +00:00
2020-12-09 15:12:37 +00:00
" label-font-size " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED , __ ( " Set font size: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-03 07:55:27 +00:00
" font-size-enable " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED , $l_arr_Enabled ),
2020-12-05 04:48:09 +00:00
" font-size-scalar " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR , 0 , 50 , true ),
2020-12-03 07:55:27 +00:00
" font-size-unit " => $this -> addSelectBox ( MCI_Footnotes_Settings :: C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT , $l_arr_FontSizeUnits ),
2020-12-06 12:46:45 +00:00
" notice-font-size " => __ ( " By default, the font size is set to equal the surrounding text. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-12-03 07:55:27 +00:00
2020-12-09 15:12:37 +00:00
" label-color " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR , __ ( " Text color: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2014-10-11 12:27:00 +00:00
" color " => $this -> addColorSelection ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR ),
2020-12-10 12:29:50 +00:00
" notice-color " => __ ( " To use the current theme’ s default text color: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . ' ' . __ ( " Clear or leave empty. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-11 12:27:00 +00:00
2020-12-09 15:12:37 +00:00
" label-background " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND , __ ( " Background color: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2014-10-11 12:27:00 +00:00
" background " => $this -> addColorSelection ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND ),
2020-12-10 12:29:50 +00:00
" notice-background " => __ ( " To use the current theme’ s default background color: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . ' ' . __ ( " Clear or leave empty. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-11 12:27:00 +00:00
2020-12-09 15:12:37 +00:00
" label-border-width " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH , __ ( " Border width: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-05 04:48:09 +00:00
" border-width " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH , 0 , 4 , true ),
2020-12-09 15:12:37 +00:00
" notice-border-width " => __ ( " pixels; 0 for borderless " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-11 12:27:00 +00:00
2020-12-09 15:12:37 +00:00
" label-border-color " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR , __ ( " Border color: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2014-10-11 12:27:00 +00:00
" border-color " => $this -> addColorSelection ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR ),
2020-12-10 12:29:50 +00:00
" notice-border-color " => __ ( " To use the current theme’ s default border color: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . ' ' . __ ( " Clear or leave empty. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-11 12:27:00 +00:00
2020-12-09 15:12:37 +00:00
" label-border-radius " => $this -> addLabel ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS , __ ( " Rounded corner radius: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2020-12-05 04:48:09 +00:00
" border-radius " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS , 0 , 500 ),
2020-12-09 15:12:37 +00:00
" notice-border-radius " => __ ( " pixels; 0 for sharp corners " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-11 12:27:00 +00:00
2020-12-09 15:12:37 +00:00
" label-box-shadow-color " => $this -> addLabel ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR , __ ( " Box shadow color: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
2014-10-18 18:14:59 +00:00
" box-shadow-color " => $this -> addColorSelection ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR ),
2020-12-10 12:29:50 +00:00
" notice-box-shadow-color " => __ ( " To use the current theme’ s default box shadow color: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ) . ' ' . __ ( " Clear or leave empty. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-18 18:14:59 +00:00
2020-10-27 11:56:49 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
2020-11-01 05:41:22 +00:00
/**
* Displays all settings for the prepended symbol
*
* @ author Stefan Herndler
* @ since 1.5 . 0
2020-11-20 05:40:03 +00:00
*
2020-11-01 05:41:22 +00:00
* Edited heading for v2 . 0.4
2020-11-20 05:40:03 +00:00
*
2020-11-16 20:57:15 +00:00
* The former 'hyperlink arrow' , incompatible with combined identical footnotes ,
2020-11-20 05:40:03 +00:00
* became 'prepended arrow' in v2 . 0.3 after a user complaint about missing backlinking semantics
* of the footnote number .
2020-12-03 07:55:27 +00:00
*
2020-12-06 16:30:14 +00:00
* @ since 2.1 . 4 moved to Settings > Reference container > Display a backlink symbol
2020-11-01 05:41:22 +00:00
*/
2020-10-27 11:56:49 +00:00
/**
* Displays the custom css box .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
2020-12-12 21:07:24 +00:00
*
* Edited :
* 2.1 . 6 drop localized notices for CSS classes as the number increased to 16
* list directly in the template , as CSS is in English anyway
* @ see templates / dashboard / customize - css . html
* 2020 - 12 - 09 T1113 + 0100
2020-10-27 11:56:49 +00:00
*/
public function CustomCSS () {
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " customize-css " );
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-12-09 15:12:37 +00:00
// "label-css" => $this->addLabel(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS, __("Add custom CSS:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
2020-10-27 11:56:49 +00:00
" css " => $this -> addTextArea ( MCI_Footnotes_Settings :: C_STR_CUSTOM_CSS ),
2020-12-09 15:12:37 +00:00
" headline " => $this -> addText ( __ ( " Recommended CSS classes: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )),
// CSS classes are listed in the template.
// Localized notices are dropped to ease translators’ task.
2020-10-27 11:56:49 +00:00
2020-12-09 15:12:37 +00:00
// "label-class-1" => ".footnote_plugin_tooltip_text",
// "class-1" => $this->addText(__("superscript, Footnotes index", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
2020-10-27 11:56:49 +00:00
2020-12-09 15:12:37 +00:00
// "label-class-2" => ".footnote_tooltip",
// "class-2" => $this->addText(__("mouse-over box, tooltip for each superscript", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
2020-10-27 11:56:49 +00:00
2020-12-09 15:12:37 +00:00
// "label-class-3" => ".footnote_plugin_index",
// "class-3" => $this->addText(__("1st column of the Reference Container, Footnotes index", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
2020-10-27 11:56:49 +00:00
2020-12-09 15:12:37 +00:00
// "label-class-4" => ".footnote_plugin_text",
// "class-4" => $this->addText(__("2nd column of the Reference Container, Footnote text", MCI_Footnotes_Config::C_STR_PLUGIN_NAME))
2020-10-27 11:56:49 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
2014-09-14 20:32:59 +00:00
2014-10-08 21:36:35 +00:00
/**
* Displays available Hooks to look for Footnote short codes .
*
* @ author Stefan Herndler
* @ since 1.5 . 5
2020-11-20 05:40:03 +00:00
*
2020-12-12 21:07:24 +00:00
* Edited :
* @ since 2.1 . 1 priority level setting for the_content 2020 - 11 - 16 T2152 + 0100
* @ since 2.1 . 4 priority level settings for the other hooks 2020 - 11 - 19 T1421 + 0100
*
* priority level was initially hard - coded default
* shows " 9223372036854775807 " in the numbox
* empty should be interpreted as PHP_INT_MAX ,
* but a numbox cannot be set to empty : < https :// github . com / Modernizr / Modernizr / issues / 171 >
* define - 1 as PHP_INT_MAX instead
2014-10-08 21:36:35 +00:00
*/
2020-12-12 21:07:24 +00:00
public function LookupHooks () {
2014-10-11 12:27:00 +00:00
// load template file
2014-10-08 21:36:35 +00:00
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " expert-lookup " );
2020-11-20 05:40:03 +00:00
2014-10-08 21:36:35 +00:00
// replace all placeholders
$l_obj_Template -> replace (
array (
2020-11-20 05:40:03 +00:00
2020-12-12 21:07:24 +00:00
" description-1 " => __ ( 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" description-2 " => sprintf ( __ ( 'For the_content, this figure must be lower than %1$d so that certain strings added by a plugin running at %1$d may not be mistaken as a footnote.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), 99 ),
" description-3 " => sprintf ( __ ( 'This makes also sure that the reference container displays above a feature inserted by a plugin running at %d.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), 1200 ),
" description-4 " => sprintf ( __ ( '%d is lowest priority, %d is highest.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), PHP_INT_MAX , 0 ),
" description-5 " => sprintf ( __ ( 'To set priority level to lowest, set it to %d, interpreted as %d, the constant %s.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), - 1 , PHP_INT_MAX , 'PHP_INT_MAX' ),
" description-6 " => __ ( 'The widget_text hook must be disabled, because a footnotes container is inserted at the bottom of each widget, but multiple containers in a page are not disambiguated.' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-11-20 05:40:03 +00:00
2014-10-08 21:36:35 +00:00
" head-hook " => __ ( " WordPress hook function name " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" head-checkbox " => __ ( " Activate " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-11-20 05:40:03 +00:00
" head-numbox " => __ ( " Priority level " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2014-10-08 21:36:35 +00:00
" head-url " => __ ( " WordPress documentation " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" label-the-title " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_THE_TITLE , " the_title " ),
" the-title " => $this -> addCheckbox ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_THE_TITLE ),
2020-11-20 05:40:03 +00:00
" priority-the-title " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL , - 1 , PHP_INT_MAX ),
" url-the-title " => " https://developer.wordpress.org/reference/hooks/the_title/ " ,
2014-10-08 21:36:35 +00:00
" label-the-content " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_THE_CONTENT , " the_content " ),
2020-11-20 05:40:03 +00:00
" the-content " => $this -> addCheckbox ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_THE_CONTENT ),
2020-11-18 00:47:53 +00:00
" priority-the-content " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL , - 1 , PHP_INT_MAX ),
2020-11-20 05:40:03 +00:00
" url-the-content " => " https://developer.wordpress.org/reference/hooks/the_content/ " ,
2020-11-19 20:34:45 +00:00
2014-10-08 21:36:35 +00:00
" label-the-excerpt " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_THE_EXCERPT , " the_excerpt " ),
" the-excerpt " => $this -> addCheckbox ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_THE_EXCERPT ),
2020-11-20 05:40:03 +00:00
" priority-the-excerpt " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL , - 1 , PHP_INT_MAX ),
" url-the-excerpt " => " https://developer.wordpress.org/reference/functions/the_excerpt/ " ,
2020-11-19 20:34:45 +00:00
2014-10-08 21:36:35 +00:00
" label-widget-title " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE , " widget_title " ),
" widget-title " => $this -> addCheckbox ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE ),
2020-11-20 05:40:03 +00:00
" priority-widget-title " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL , - 1 , PHP_INT_MAX ),
" url-widget-title " => " https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_title " ,
2020-11-19 20:34:45 +00:00
2014-10-08 21:36:35 +00:00
" label-widget-text " => $this -> addLabel ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT , " widget_text " ),
" widget-text " => $this -> addCheckbox ( MCI_Footnotes_Settings :: C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT ),
2020-11-20 05:40:03 +00:00
" priority-widget-text " => $this -> addNumBox ( MCI_Footnotes_Settings :: C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL , - 1 , PHP_INT_MAX ),
" url-widget-text " => " https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text " ,
2014-10-08 21:36:35 +00:00
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
2020-10-27 11:56:49 +00:00
/**
* Displays a short introduction of the Plugin .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
*/
public function Help () {
global $g_obj_MCI_Footnotes ;
// load footnotes starting and end tag
$l_arr_Footnote_StartingTag = $this -> LoadSetting ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_START );
$l_arr_Footnote_EndingTag = $this -> LoadSetting ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_END );
if ( $l_arr_Footnote_StartingTag [ " value " ] == " userdefined " || $l_arr_Footnote_EndingTag [ " value " ] == " userdefined " ) {
// load user defined starting and end tag
$l_arr_Footnote_StartingTag = $this -> LoadSetting ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
$l_arr_Footnote_EndingTag = $this -> LoadSetting ( MCI_Footnotes_Settings :: C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
}
$l_str_Example = " Hello " . $l_arr_Footnote_StartingTag [ " value " ] .
" Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, " .
" sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. " .
" Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, " .
" consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. " .
" At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. "
. $l_arr_Footnote_EndingTag [ " value " ] . " World! " ;
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " how-to-help " );
// replace all placeholders
$l_obj_Template -> replace (
array (
" label-start " => __ ( " Start your footnote with the following short code: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" start " => $l_arr_Footnote_StartingTag [ " value " ],
2020-12-09 15:12:37 +00:00
" label-end " => __ ( " …and end your footnote with this short code: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
2020-10-27 11:56:49 +00:00
" end " => $l_arr_Footnote_EndingTag [ " value " ],
" example-code " => $l_str_Example ,
" example-string " => " <br/> " . __ ( " will be displayed as: " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ),
" example " => $g_obj_MCI_Footnotes -> a_obj_Task -> exec ( $l_str_Example , true ),
" information " => sprintf ( __ ( " For further information please check out our %ssupport forum%s on WordPress.org. " , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME ), '<a href="http://wordpress.org/support/plugin/footnotes" target="_blank" class="footnote_plugin">' , '</a>' )
)
);
// call wp_head function to get the Styling of the mouse-over box
$g_obj_MCI_Footnotes -> a_obj_Task -> wp_head ();
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
/**
* Displays all Donate button to support the developers .
*
* @ author Stefan Herndler
* @ since 1.5 . 0
*/
public function Donate () {
// load template file
$l_obj_Template = new MCI_Footnotes_Template ( MCI_Footnotes_Template :: C_STR_DASHBOARD , " how-to-donate " );
// replace all placeholders
$l_obj_Template -> replace (
array (
" caption " => __ ( 'Donate now' , MCI_Footnotes_Config :: C_STR_PLUGIN_NAME )
)
);
// display template with replaced placeholders
echo $l_obj_Template -> getContent ();
}
}