diff --git a/class/convert.php b/class/convert.php
index 3f8232b..767d25c 100644
--- a/class/convert.php
+++ b/class/convert.php
@@ -5,6 +5,11 @@
* @filesource
* @author Stefan Herndler
* @since 1.5.0 12.09.14 10:56
+ *
+ * Edited:
+ * @since 2.2.0 add lowercase Roman 2020-12-12T1540+0100
+ *
+ * Last modified: 2020-12-12T1541+0100
*/
@@ -24,11 +29,16 @@ class MCI_Footnotes_Convert {
* @param int $p_int_Index Index to be converted.
* @param string $p_str_ConvertStyle Style of the new/converted Index.
* @return string Converted Index as string in the defined counter style.
+ *
+ * Edited:
+ * @since 2.2.0 lowercase Roman numerals supported
*/
public static function Index($p_int_Index, $p_str_ConvertStyle = "arabic_plain") {
switch ($p_str_ConvertStyle) {
case "romanic":
- return self::toRomanic($p_int_Index);
+ return self::toRomanic($p_int_Index, true);
+ case "roman_low":
+ return self::toRomanic($p_int_Index, false);
case "latin_high":
return self::toLatin($p_int_Index, true);
case "latin_low":
@@ -97,8 +107,11 @@ class MCI_Footnotes_Convert {
* @since 1.0-gamma
* @param int $p_int_Value Value/Index to be converted.
* @return string
+ *
+ * Edited:
+ * @since 2.2.0 optionally lowercase (code from Latin) 2020-12-12T1538+0100
*/
- private static function toRomanic($p_int_Value) {
+ private static function toRomanic($p_int_Value, $p_bool_UpperCase) {
// table containing all necessary romanic letters
$l_arr_RomanicLetters = array(
'M' => 1000,
@@ -128,7 +141,10 @@ class MCI_Footnotes_Convert {
}
}
// return romanic letters as string
- return $l_str_Return;
+ if ($p_bool_UpperCase) {
+ return strtoupper($l_str_Return);
+ }
+ return strtolower($l_str_Return);
}
/**
diff --git a/class/dashboard/init.php b/class/dashboard/init.php
index 0dc6760..0bafb42 100644
--- a/class/dashboard/init.php
+++ b/class/dashboard/init.php
@@ -16,187 +16,187 @@
*/
class MCI_Footnotes_Layout_Init {
- /**
- * Slug for the Plugin main menu.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @var string
- */
- const C_STR_MAIN_MENU_SLUG = "mfmmf";
+ /**
+ * Slug for the Plugin main menu.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @var string
+ */
+ const C_STR_MAIN_MENU_SLUG = "mfmmf";
- /**
- * Plugin main menu name.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @var string
- */
- const C_STR_MAIN_MENU_TITLE = "ManFisher";
+ /**
+ * Plugin main menu name.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @var string
+ */
+ const C_STR_MAIN_MENU_TITLE = "ManFisher";
- /**
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @var array
- */
- private $a_arr_SubPageClasses = array();
+ /**
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @var array
+ */
+ private $a_arr_SubPageClasses = array();
- /**
- * Class Constructor. Initializes all WordPress hooks for the Plugin Settings.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public function __construct() {
- // iterate through each class define in the current script
- foreach(get_declared_classes() as $l_str_ClassName) {
- // accept only child classes of the layout engine
- if(is_subclass_of($l_str_ClassName, 'MCI_Footnotes_LayoutEngine')) {
- /** @var MCI_Footnotes_LayoutEngine $l_obj_Class */
- $l_obj_Class = new $l_str_ClassName();
- // append new instance of the layout engine sub class
- $this->a_arr_SubPageClasses[$l_obj_Class->getPriority()] = $l_obj_Class;
- }
- }
- ksort($this->a_arr_SubPageClasses);
+ /**
+ * Class Constructor. Initializes all WordPress hooks for the Plugin Settings.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ */
+ public function __construct() {
+ // iterate through each class define in the current script
+ foreach(get_declared_classes() as $l_str_ClassName) {
+ // accept only child classes of the layout engine
+ if(is_subclass_of($l_str_ClassName, 'MCI_Footnotes_LayoutEngine')) {
+ /** @var MCI_Footnotes_LayoutEngine $l_obj_Class */
+ $l_obj_Class = new $l_str_ClassName();
+ // append new instance of the layout engine sub class
+ $this->a_arr_SubPageClasses[$l_obj_Class->getPriority()] = $l_obj_Class;
+ }
+ }
+ ksort($this->a_arr_SubPageClasses);
- // register hooks/actions
- add_action('admin_init', array($this, 'initializeSettings'));
- add_action('admin_menu', array($this, 'registerMainMenu'));
- // register AJAX callbacks for Plugin information
- add_action("wp_ajax_nopriv_footnotes_getPluginInfo", array($this, "getPluginMetaInformation"));
- add_action("wp_ajax_footnotes_getPluginInfo", array($this, "getPluginMetaInformation"));
- }
+ // register hooks/actions
+ add_action('admin_init', array($this, 'initializeSettings'));
+ add_action('admin_menu', array($this, 'registerMainMenu'));
+ // register AJAX callbacks for Plugin information
+ add_action("wp_ajax_nopriv_footnotes_getPluginInfo", array($this, "getPluginMetaInformation"));
+ add_action("wp_ajax_footnotes_getPluginInfo", array($this, "getPluginMetaInformation"));
+ }
- /**
- * Initializes all sub pages and registers the settings.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public function initializeSettings() {
- MCI_Footnotes_Settings::instance()->RegisterSettings();
- // iterate though each sub class of the layout engine and register their sections
- /** @var MCI_Footnotes_LayoutEngine $l_obj_LayoutEngineSubClass */
- foreach($this->a_arr_SubPageClasses as $l_obj_LayoutEngineSubClass) {
- $l_obj_LayoutEngineSubClass->registerSections();
- }
- }
+ /**
+ * Initializes all sub pages and registers the settings.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ */
+ public function initializeSettings() {
+ MCI_Footnotes_Settings::instance()->RegisterSettings();
+ // iterate though each sub class of the layout engine and register their sections
+ /** @var MCI_Footnotes_LayoutEngine $l_obj_LayoutEngineSubClass */
+ foreach($this->a_arr_SubPageClasses as $l_obj_LayoutEngineSubClass) {
+ $l_obj_LayoutEngineSubClass->registerSections();
+ }
+ }
- /**
- * Registers the new main menu for the WordPress dashboard.
- * Registers all sub menu pages for the new main menu.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @see http://codex.wordpress.org/Function_Reference/add_menu_page
- */
- public function registerMainMenu() {
- global $menu;
- // iterate through each main menu
- foreach($menu as $l_arr_MainMenu) {
- // iterate through each main menu attribute
- foreach($l_arr_MainMenu as $l_str_Attribute) {
- // main menu already added, append sub pages and stop
- if ($l_str_Attribute == self::C_STR_MAIN_MENU_SLUG) {
- $this->registerSubPages();
- return;
- }
- }
- }
+ /**
+ * Registers the new main menu for the WordPress dashboard.
+ * Registers all sub menu pages for the new main menu.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @see http://codex.wordpress.org/Function_Reference/add_menu_page
+ */
+ public function registerMainMenu() {
+ global $menu;
+ // iterate through each main menu
+ foreach($menu as $l_arr_MainMenu) {
+ // iterate through each main menu attribute
+ foreach($l_arr_MainMenu as $l_str_Attribute) {
+ // main menu already added, append sub pages and stop
+ if ($l_str_Attribute == self::C_STR_MAIN_MENU_SLUG) {
+ $this->registerSubPages();
+ return;
+ }
+ }
+ }
- // add a new main menu page to the WordPress dashboard
- add_menu_page(
- self::C_STR_MAIN_MENU_TITLE, // page title
- self::C_STR_MAIN_MENU_TITLE, // menu title
- 'manage_options', // capability
- self::C_STR_MAIN_MENU_SLUG, // menu slug
- array($this, "displayOtherPlugins"), // function
- plugins_url('footnotes/img/main-menu.png'), // icon url
- null // position
- );
- $this->registerSubPages();
- }
+ // add a new main menu page to the WordPress dashboard
+ add_menu_page(
+ self::C_STR_MAIN_MENU_TITLE, // page title
+ self::C_STR_MAIN_MENU_TITLE, // menu title
+ 'manage_options', // capability
+ self::C_STR_MAIN_MENU_SLUG, // menu slug
+ array($this, "displayOtherPlugins"), // function
+ plugins_url('footnotes/img/main-menu.png'), // icon url
+ null // position
+ );
+ $this->registerSubPages();
+ }
- /**
- * Registers all SubPages for this Plugin.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- private function registerSubPages() {
- // first registered sub menu page MUST NOT contain a unique slug suffix
- // iterate though each sub class of the layout engine and register their sub page
- /** @var MCI_Footnotes_LayoutEngine $l_obj_LayoutEngineSubClass */
- foreach($this->a_arr_SubPageClasses as $l_obj_LayoutEngineSubClass) {
- $l_obj_LayoutEngineSubClass->registerSubPage();
- }
- }
+ /**
+ * Registers all SubPages for this Plugin.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ */
+ private function registerSubPages() {
+ // first registered sub menu page MUST NOT contain a unique slug suffix
+ // iterate though each sub class of the layout engine and register their sub page
+ /** @var MCI_Footnotes_LayoutEngine $l_obj_LayoutEngineSubClass */
+ foreach($this->a_arr_SubPageClasses as $l_obj_LayoutEngineSubClass) {
+ $l_obj_LayoutEngineSubClass->registerSubPage();
+ }
+ }
- /**
- * Displays other Plugins from the developers.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public function displayOtherPlugins() {
- printf("
");
- // load template file
- $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "manfisher");
- echo $l_obj_Template->getContent();
+ /**
+ * Displays other Plugins from the developers.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ */
+ public function displayOtherPlugins() {
+ printf("
");
+
+ printf('');
+ }
- /**
- * AJAX call. returns a JSON string containing meta information about a specific WordPress Plugin.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public function getPluginMetaInformation() {
- // get plugin internal name from POST data
- $l_str_PluginName = array_key_exists("plugin", $_POST) ? $_POST["plugin"] : null;
- if (empty($l_str_PluginName)) {
- echo json_encode(array("error" => "Plugin name invalid."));
- exit;
- }
- $l_str_Url = "https://api.wordpress.org/plugins/info/1.0/".$l_str_PluginName.".json";
- // call URL and collect data
- $l_arr_Response = wp_remote_get($l_str_Url);
- // check if response is valid
- if (is_wp_error($l_arr_Response)) {
- echo json_encode(array("error" => "Error receiving Plugin Information from WordPress."));
- exit;
- }
- if (!array_key_exists("body", $l_arr_Response)) {
- echo json_encode(array("error" => "Error reading WordPress API response message."));
- exit;
- }
- // get the body of the response
- $l_str_Response = $l_arr_Response["body"];
- // get plugin object
- $l_arr_Plugin = json_decode($l_str_Response, true);
- if (empty($l_arr_Plugin)) {
- echo json_encode(array("error" => "Error reading Plugin meta information. URL: " . $l_str_Url . " Response: " . $l_str_Response));
- exit;
- }
+ /**
+ * AJAX call. returns a JSON string containing meta information about a specific WordPress Plugin.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ */
+ public function getPluginMetaInformation() {
+ // get plugin internal name from POST data
+ $l_str_PluginName = array_key_exists("plugin", $_POST) ? $_POST["plugin"] : null;
+ if (empty($l_str_PluginName)) {
+ echo json_encode(array("error" => "Plugin name invalid."));
+ exit;
+ }
+ $l_str_Url = "https://api.wordpress.org/plugins/info/1.0/".$l_str_PluginName.".json";
+ // call URL and collect data
+ $l_arr_Response = wp_remote_get($l_str_Url);
+ // check if response is valid
+ if (is_wp_error($l_arr_Response)) {
+ echo json_encode(array("error" => "Error receiving Plugin Information from WordPress."));
+ exit;
+ }
+ if (!array_key_exists("body", $l_arr_Response)) {
+ echo json_encode(array("error" => "Error reading WordPress API response message."));
+ exit;
+ }
+ // get the body of the response
+ $l_str_Response = $l_arr_Response["body"];
+ // get plugin object
+ $l_arr_Plugin = json_decode($l_str_Response, true);
+ if (empty($l_arr_Plugin)) {
+ echo json_encode(array("error" => "Error reading Plugin meta information. URL: " . $l_str_Url . " Response: " . $l_str_Response));
+ exit;
+ }
$l_int_NumRatings = array_key_exists("num_ratings", $l_arr_Plugin) ? intval($l_arr_Plugin["num_ratings"]) : 0;
$l_int_Rating = array_key_exists("rating", $l_arr_Plugin) ? floatval($l_arr_Plugin["rating"]) : 0.0;
$l_int_Stars = round(5 * $l_int_Rating / 100.0, 1);
- // return Plugin information as JSON encoded string
- echo json_encode(
- array(
- "error" => "",
- "PluginDescription" => array_key_exists("short_description", $l_arr_Plugin) ? html_entity_decode($l_arr_Plugin["short_description"]) : "Error reading Plugin information",
- "PluginAuthor" => array_key_exists("author", $l_arr_Plugin) ? html_entity_decode($l_arr_Plugin["author"]) : "unknown",
- "PluginRatingText" => $l_int_Stars . " " . __("rating based on", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . " " . $l_int_NumRatings . " " . __("ratings", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+ // return Plugin information as JSON encoded string
+ echo json_encode(
+ array(
+ "error" => "",
+ "PluginDescription" => array_key_exists("short_description", $l_arr_Plugin) ? html_entity_decode($l_arr_Plugin["short_description"]) : "Error reading Plugin information",
+ "PluginAuthor" => array_key_exists("author", $l_arr_Plugin) ? html_entity_decode($l_arr_Plugin["author"]) : "unknown",
+ "PluginRatingText" => $l_int_Stars . " " . __("rating based on", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . " " . $l_int_NumRatings . " " . __("ratings", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"PluginRating1" => $l_int_Stars >= 0.5 ? "star-full" : "star-empty",
"PluginRating2" => $l_int_Stars >= 1.5 ? "star-full" : "star-empty",
"PluginRating3" => $l_int_Stars >= 2.5 ? "star-full" : "star-empty",
@@ -205,8 +205,8 @@ class MCI_Footnotes_Layout_Init {
"PluginRating" => $l_int_NumRatings,
"PluginLastUpdated" => array_key_exists("last_updated", $l_arr_Plugin) ? $l_arr_Plugin["last_updated"] : "unknown",
"PluginDownloads" => array_key_exists("downloaded", $l_arr_Plugin) ? $l_arr_Plugin["downloaded"] : "---"
- )
- );
- exit;
- }
+ )
+ );
+ exit;
+ }
}
diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php
index 1326188..bfc4d36 100644
--- a/class/dashboard/layout.php
+++ b/class/dashboard/layout.php
@@ -10,9 +10,9 @@
* 2.1.2 add versioning of settings.css for cache busting 2020-11-19T1456+0100
* 2.1.4 automate passing version number for cache busting 2020-11-30T0648+0100
* 2.1.4 optional step argument and support for floating in numbox 2020-12-05T0540+0100
- * 2.2.0 fix punctuation-related localization issue in dashboard labels 2020-12-08T1547+0100
+ * 2.1.6 fix punctuation-related localization issue in dashboard labels 2020-12-08T1547+0100
*
- * Last modified: 2020-12-08T1547+0100
+ * Last modified: 2020-12-10T1447+0100
*/
@@ -114,7 +114,12 @@ abstract class MCI_Footnotes_LayoutEngine {
* @return array meta box description to be able to append a meta box to the output.
*/
protected function addMetaBox($p_str_SectionID, $p_str_ID, $p_str_Title, $p_str_CallbackFunctionName) {
- return array("parent" => MCI_Footnotes_Config::C_STR_PLUGIN_NAME . "-" . $p_str_SectionID, "id" => $p_str_ID, "title" => $p_str_Title, "callback" => $p_str_CallbackFunctionName);
+ return array(
+ "parent" => MCI_Footnotes_Config::C_STR_PLUGIN_NAME . "-" . $p_str_SectionID,
+ "id" => $p_str_ID,
+ "title" => $p_str_Title,
+ "callback" => $p_str_CallbackFunctionName
+ );
}
/**
@@ -379,8 +384,8 @@ abstract class MCI_Footnotes_LayoutEngine {
* @param string $p_str_Caption Label caption.
* @return string
*
- * Edited 2020-12-01T0159+0100
- * @since #################### no colon
+ * Edited 2020-12-01T0159+0100..
+ * @since 2.1.6 no colon
*/
protected function addLabel($p_str_SettingName, $p_str_Caption) {
if (empty($p_str_Caption)) {
@@ -394,6 +399,7 @@ abstract class MCI_Footnotes_LayoutEngine {
// and narrow per new school.
// Add colon to label strings for inclusion in localization.
// Colon after label is widely preferred best practice, mandatory per style guides.
+ //
return sprintf('', $p_str_SettingName, $p_str_Caption);
// ^ here deleted colon 2020-12-08T1546+0100
}
@@ -504,14 +510,14 @@ abstract class MCI_Footnotes_LayoutEngine {
* @return string
*
* Edited:
- * @since 2.1.4 step argument and number_format() to allow decimals 2020-12-03T0631+0100..2020-12-05T2006+0100
+ * @since 2.1.4 step argument and number_format() to allow decimals 2020-12-03T0631+0100..2020-12-12T1110+0100
*/
protected function addNumBox($p_str_SettingName, $p_in_Min, $p_int_Max, $p_bool_Deci = false ) {
// collect data for given settings field
$l_arr_Data = $this->LoadSetting($p_str_SettingName);
if ($p_bool_Deci) {
- $l_str_Value = number_format($l_arr_Data["value"], 1);
+ $l_str_Value = number_format(floatval($l_arr_Data["value"]), 1);
return sprintf('',
$l_arr_Data["name"], $l_arr_Data["id"], $l_str_Value, $p_in_Min, $p_int_Max);
} else {
diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php
index d02c9be..5b45240 100644
--- a/class/dashboard/subpage-main.php
+++ b/class/dashboard/subpage-main.php
@@ -11,11 +11,12 @@
* 2.1.0 read-on button label 2020-11-08T2148+0100
* 2.1.1 options for ref container and alternative tooltips 2020-11-16T2152+0100
* 2.1.4 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100
- * 2.2.0 slight UI reordering 2020-12-09T1114+0100
- * 2.2.0 option to disable URL line wrapping 2020-12-09T1604+0100
- * 2.2.0 remove expert mode setting as irrelevant 2020-12-09T2105+0100
+ * 2.1.6 slight UI reordering 2020-12-09T1114+0100
+ * 2.1.6 option to disable URL line wrapping 2020-12-09T1604+0100
+ * 2.1.6 remove expert mode setting as irrelevant 2020-12-09T2105+0100
+ * 2.2.0 add options, redistribute, update strings 2020-12-12T2135+0100
*
- * Last modified: 2020-12-09T2105+0100
+ * Last modified: 2020-12-12T2202+0100
*/
/**
@@ -65,13 +66,20 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* @author Stefan Herndler
* @since 1.5.0
* @return array
+ *
+ * Edited:
+ * 2.1.6 tabs reordered and renamed
+ * @see customization vs configuration
+ *
+ *
+ * 2.1.6 removed if statement around expert tab
*/
protected function getSections() {
$l_arr_Tabs = array();
- $l_arr_Tabs[] = $this->addSection("settings", __("Settings", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 0, true);
- $l_arr_Tabs[] = $this->addSection("expert", __("Priority", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 2, true);
- $l_arr_Tabs[] = $this->addSection("customize", __("Configure", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 1, true);
- $l_arr_Tabs[] = $this->addSection("how-to", __("How to", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), null, false);
+ $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);
return $l_arr_Tabs;
}
@@ -82,27 +90,37 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* @since 1.5.0
* @return array
*
- * Edited for v2.0.4 to reflect changes in display since WPv5.5
- * Details in class/config.php
+ * 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
*/
protected function getMetaBoxes() {
return array(
- // Change string "%s styling" to "Footnotes styling" to fix layout in WPv5.5:
- $this->addMetaBox("settings", "styling", __("Main settings", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Styling"),
- $this->addMetaBox("settings", "reference-container", __("Reference Container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "ReferenceContainer"),
- $this->addMetaBox("settings", "other", __("Other settings", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Other"),
- // Leave intact since this is not localized:
+ $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"),
$this->addMetaBox("settings", "love", MCI_Footnotes_Config::C_STR_PLUGIN_HEADING_NAME . ' ' . MCI_Footnotes_Config::C_STR_LOVE_SYMBOL_HEADING, "Love"),
+
+ $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"),
- $this->addMetaBox("expert", "lookup", __("WordPress hooks and priority levels", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "lookupHooks"),
-
- // The HyperlinkArrow meta box ceased for 2.0.0
- // The HyperlinkArrow meta box was restored for 2.0.4 to meet user demand for arrow symbol semantics
- // The HyperlinkArrow meta box ceased for 2.1.4 as its content is moved to Settings > Reference container > Display a backlink symbol
- $this->addMetaBox("customize", "superscript", __("Referrer typesetting", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Superscript"),
- $this->addMetaBox("customize", "mouse-over-box", __("Mouse-over box", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBox"),
-
- $this->addMetaBox("customize", "custom-css", __("Custom CSS", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "CustomCSS"),
+ $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"),
$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")
@@ -179,6 +197,10 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"page-layout" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, $l_arr_PageLayoutOptions),
"notice-page-layout" => __("Most themes don’t need this fix.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+ "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),
+
"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)),
"startpage" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE, $l_arr_Enabled),
@@ -221,6 +243,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"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)),
"line-break" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_LINE_BREAKS_ENABLED, $l_arr_Enabled),
+ "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),
)
);
// display template with replaced placeholders
@@ -228,44 +251,51 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
}
/**
- * Displays all settings for the footnotes styling.
+ * 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
*
* @author Stefan Herndler
* @since 1.5.0
+ *
+ * Edited heading 2020-12-12T1412+0100
+ * @since 2.2.0 more short code options 2020-12-12T1412+0100
+ * @since 2.2.0 3 boxes for clarity 2020-12-12T1422+0100
*/
- public function Styling() {
- // 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 start of the footnotes short code
+ public function StartEnd() {
+ // footnotes start tag short code options:
$l_arr_ShortCodeStart = array(
"((" => "((",
+ "(((" => "(((",
+ "{{" => "{{",
+ "{{{" => "{{{",
+ "[n]" => "[n]",
+ "[fn]" => "[fn]",
htmlspecialchars("") => htmlspecialchars(""),
"[ref]" => "[ref]",
- "userdefined" => __('user defined', MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
+ htmlspecialchars("") => htmlspecialchars(""),
+ htmlspecialchars("") => htmlspecialchars(""),
+ // Custom (user-defined) start and end tags bracketing the footnote text inline:
+ "userdefined" => __('custom short code', MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
);
// load template file
- $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "settings-styling");
+ $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "settings-start-end");
// replace all placeholders
$l_obj_Template->replace(
array(
@@ -283,12 +313,58 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"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,
- "label-counter-style" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE, __("Counter style:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ )
+ );
+ // 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)),
"counter-style" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE, $l_arr_CounterStyle),
// algorithmically combine identicals:
"label-identical" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES, __("Combine identical footnotes:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"identical" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES, $l_arr_Enable),
+ "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(
"label-scroll-offset" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, __("Scroll offset:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"scroll-offset" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, 0, 100),
@@ -309,17 +385,31 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
*
* @author Stefan Herndler
* @since 1.5.0
+ *
+ * Edited:
+ * @since 2.2.0 position-sensitive placeholders to support more locales 2020-12-11T0432+0100
+ * @since 2.2.0 more options 2020-12-11T0432+0100
*/
public function Love() {
- // options for the positioning of the reference container
+ // options for the acknowledgment display in the footer:
$l_arr_Love = array(
- // I love Footnotes
- "text-1" => sprintf(__('I %s %s', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), MCI_Footnotes_Config::C_STR_LOVE_SYMBOL, MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME),
- "text-2" => sprintf(__('This site uses the awesome %s Plugin.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME),
- // logo only
+ // logo only:
"text-3" => sprintf('%s', MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME),
- "random" => __('random-driven display of either variant', MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "no" => sprintf(__("no display of any “%s %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)
+ // 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)
);
// load template file
@@ -330,7 +420,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"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)),
"love" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_LOVE, $l_arr_Love),
- "label-no-love" => $this->addText(sprintf(__("Don’t tell the world you’re using %s on specific pages by adding the following short code:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME)),
+ "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)),
"no-love" => $this->addText(MCI_Footnotes_Config::C_STR_NO_LOVE_SLUG)
)
);
@@ -339,12 +429,16 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
}
/**
- * Displays all settings that are not grouped in special meta boxes.
+ * Displays the excerpt setting
*
* @author Stefan Herndler
* @since 1.5.0
+ *
+ * Edited heading 2020-12-12T1453+0100
+ * @since 2.1.1 more settings and notices
+ * @since 2.2.0 dedicated to the excerpt setting and its notices 2020-12-12T1454+0100
*/
- public function Other() {
+ public function Excerpts() {
// options for Yes/No select box:
$l_arr_Enabled = array(
"yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
@@ -352,22 +446,16 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
);
// load template file
- $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "settings-other");
+ $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "settings-excerpts");
// replace all placeholders
$l_obj_Template->replace(
array(
- "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),
-
- "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),
-
- "label-excerpt" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_IN_EXCERPT, __("Display footnotes in excerpts:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
- "excerpt" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_IN_EXCERPT, $l_arr_Enabled),
- "notice1-excerpt" => __("This should be disabled.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "notice2-excerpt" => __("In some themes, the Advanced Excerpt plugin is indispensable to display footnotes in excerpts.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "notice3-excerpt" => __("Footnotes cannot be disabled in excerpts. A workaround is to avoid footnotes in the first 55 words.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+ "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), 'Advanced Excerpt'),
+ "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),
)
);
// display template with replaced placeholders
@@ -375,10 +463,14 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
}
/**
- * Displays all settings for the footnotes Superscript.
+ * Displays all settings for the footnote referrers
*
* @author Stefan Herndler
* @since 1.5.0
+ *
+ * Edited heading 2020-12-12T1513+0100
+ * @since 2.1.1 option for superscript (optionally baseline referrers)
+ * @since 2.2.0 option for link element moved here 2020-12-12T1514+0100
*/
public function Superscript() {
// options for Yes/No select box:
@@ -391,14 +483,18 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
// replace all placeholders
$l_obj_Template->replace(
array(
- "label-superscript" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, __("Enable superscript for footnote referrers:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ "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)),
"superscript" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, $l_arr_Enabled),
- "label-before" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE, __("Before the footnote referrer:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ "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)),
"before" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE),
- "label-after" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER, __("After the footnote referrer:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
- "after" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER)
+ "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),
)
);
// display template with replaced placeholders
@@ -410,8 +506,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
*
* @author Stefan Herndler
* @since 1.5.2
+ *
+ * Edited:
+ * @since 2.2.0 3 parts to address increased settings number
*/
- public function MouseOverBox() {
+ public function MouseOverBoxDisplay() {
// options for Yes/No select box:
$l_arr_Enabled = array(
"yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
@@ -419,53 +518,33 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
);
// options for the Mouse-over box position
$l_arr_Position = array(
- "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),
+ "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),
"bottom center" => __("bottom center", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "bottom left" => __("bottom left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "center left" => __("center left", 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),
+ "bottom left" => __("bottom left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+ "center left" => __("center left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
);
// load template file
- $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "customize-mouse-over-box");
+ $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "mouse-over-box-display");
// replace all placeholders
$l_obj_Template->replace(
array(
- // tooltip settings:
-
- "label-enable" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED, __("Enable the tooltip infobox:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ "label-enable" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED, __("Display tooltips:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"enable" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED, $l_arr_Enabled),
- "label-alternative" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, __("Use alternative tooltip implementation:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ "label-alternative" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, __("Display alternative tooltips:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"alternative" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, $l_arr_Enabled),
-
- "label-activate-excerpt" => $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)),
- "activate-excerpt" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, $l_arr_Enabled),
-
- "label-excerpt-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)),
- "excerpt-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),
+ "notice-alternative" => __("Intended to work around a tooltip outage.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-position" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, __("Position:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"position" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, $l_arr_Position),
- "label-offset-x" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, __("Horizontal offset:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ "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)),
"offset-x" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -150, 150),
"notice-offset-x" => __("pixels; negative value for a leftwards offset", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
@@ -477,8 +556,6 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"max-width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, 0, 1280),
"notice-max-width" => __("pixels; 0 to disable this setting", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- // display durations:
-
"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)),
"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),
@@ -495,7 +572,62 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"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),
- // tooltip styling:
+ )
+ );
+ // 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(
"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)),
"font-size-enable" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED, $l_arr_Enabled),
@@ -553,11 +685,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
*
* @author Stefan Herndler
* @since 1.5.0
- *
- * Edited:
- * 2.2.0 drop localized notices, list directly in the template 2020-12-09T1113+0100
- *
- * @see templates/dashboard/customize-css.html
+ *
+ * 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-09T1113+0100
*/
public function CustomCSS() {
// load template file
@@ -596,30 +729,30 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* @author Stefan Herndler
* @since 1.5.5
*
- * Edited for:
- * 2.1.1 add priority level setting for the_content 2020-11-16T2152+0100
- * 2.1.4 add priority level settings for the other hooks 2020-11-19T1421+0100
+ * Edited:
+ * @since 2.1.1 priority level setting for the_content 2020-11-16T2152+0100
+ * @since 2.1.4 priority level settings for the other hooks 2020-11-19T1421+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:
+ * define -1 as PHP_INT_MAX instead
*/
- public function lookupHooks() {
+ public function LookupHooks() {
// load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "expert-lookup");
// replace all placeholders
- // 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:
- // define -1 as PHP_INT_MAX instead
-
$l_obj_Template->replace(
array(
- "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" => __("For the_content, this figure must be lower than 99 so that a string added by a plugin running at 99 may not be mistaken as a footnote.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "description-3" => __("This makes also sure that the reference container displays above a feature inserted by a plugin running at 1200.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "description-4" => __("Default 9223372036854775807 is lowest priority, 0 is highest.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "description-5" => __("To restore default priority, set to -1, interpreted as 9223372036854775807, the constant PHP_INT_MAX.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
- "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),
+ "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),
"head-hook" => __("WordPress hook function name", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"head-checkbox" => __("Activate", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
diff --git a/class/hooks.php b/class/hooks.php
index 08aa338..a54930e 100644
--- a/class/hooks.php
+++ b/class/hooks.php
@@ -5,6 +5,9 @@
* @filesource
* @author Stefan Herndler
* @since 1.5.0 12.09.14 10:56
+ *
+ * Edited:
+ * @since 2.2.0 2020-12-12T1223+0100
*/
/**
@@ -15,74 +18,77 @@
*/
class MCI_Footnotes_Hooks {
- /**
- * Registers all WordPress hooks.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public static function registerHooks() {
- register_activation_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "activatePlugin"));
- register_deactivation_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "deactivatePlugin"));
- register_uninstall_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "uninstallPlugin"));
- }
+ /**
+ * Registers all WordPress hooks.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ */
+ public static function registerHooks() {
+ register_activation_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "activatePlugin"));
+ register_deactivation_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "deactivatePlugin"));
+ register_uninstall_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "uninstallPlugin"));
+ }
- /**
- * Executed when the Plugin gets activated.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public static function activatePlugin() {
- // currently unused
- }
+ /**
+ * Executed when the Plugin gets activated.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ */
+ public static function activatePlugin() {
+ // currently unused
+ }
- /**
- * Executed when the Plugin gets deactivated.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public static function deactivatePlugin() {
- // currently unused
- }
+ /**
+ * Executed when the Plugin gets deactivated.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ */
+ public static function deactivatePlugin() {
+ // currently unused
+ }
- /**
- * Executed when the Plugin gets uninstalled.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public static function uninstallPlugin() {
- // WordPress User has to be logged in
- if (!is_user_logged_in()) {
- wp_die(__('You must be logged in to run this script.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
- }
- // WordPress User needs the permission to (un)install plugins
- if (!current_user_can('install_plugins')) {
- wp_die(__('You do not have permission to run this script.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
- }
- // deletes all settings and restore the default values
- MCI_Footnotes_Settings::instance()->ClearAll();
- }
+ /**
+ * Executed when the Plugin gets uninstalled.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ *
+ * Edit: ClearAll didn’t actually work.
+ * @since 2.2.0 this function is not called any longer when deleting the plugin
+ */
+ public static function uninstallPlugin() {
+ // WordPress User has to be logged in
+ if (!is_user_logged_in()) {
+ wp_die(__('You must be logged in to run this script.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
+ }
+ // WordPress User needs the permission to (un)install plugins
+ if (!current_user_can('install_plugins')) {
+ wp_die(__('You do not have permission to run this script.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
+ }
+ // deletes all settings and restore the default values
+ // MCI_Footnotes_Settings::instance()->ClearAll();
+ }
- /**
- * Add Links to the Plugin in the "installed Plugins" page.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @param array $p_arr_Links Current Links.
- * @param string $p_str_PluginFileName Plugins init file name.
- * @return array
- */
- public static function PluginLinks($p_arr_Links, $p_str_PluginFileName) {
- // append link to the WordPress Plugin page
- $p_arr_Links[] = sprintf('%s', __('Support', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
- // append link to the Settings page
- $p_arr_Links[] = sprintf('%s', admin_url('admin.php?page=mfmmf-footnotes'), __('Settings', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
- // append link to the PlayPal Donate function
- $p_arr_Links[] = sprintf('%s', __('Donate', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
- // return new links
- return $p_arr_Links;
- }
-}
\ No newline at end of file
+ /**
+ * Add Links to the Plugin in the "installed Plugins" page.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @param array $p_arr_Links Current Links.
+ * @param string $p_str_PluginFileName Plugins init file name.
+ * @return array
+ */
+ public static function PluginLinks($p_arr_Links, $p_str_PluginFileName) {
+ // append link to the WordPress Plugin page
+ $p_arr_Links[] = sprintf('%s', __('Support', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
+ // append link to the Settings page
+ $p_arr_Links[] = sprintf('%s', admin_url('admin.php?page=mfmmf-footnotes'), __('Settings', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
+ // append link to the PlayPal Donate function
+ $p_arr_Links[] = sprintf('%s', __('Donate', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
+ // return new links
+ return $p_arr_Links;
+ }
+}
diff --git a/class/init.php b/class/init.php
index 854bf79..2a9b7f0 100644
--- a/class/init.php
+++ b/class/init.php
@@ -159,28 +159,28 @@ class MCI_Footnotes {
// not use '-css' in the handle, is appended automatically;
// constant FOOTNOTES_VERSION defined in footnotes.php, media all is default
wp_enqueue_style(
- 'mci-footnotes-public',
- plugins_url(
- MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/public.css'
- ),
- array(),
- FOOTNOTES_VERSION,
- 'all'
- );
+ 'mci-footnotes-public',
+ plugins_url(
+ MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/public.css'
+ ),
+ array(),
+ FOOTNOTES_VERSION,
+ 'all'
+ );
// optional layout fix by lack of layout support:
// since 2.1.4 2020-12-05T1417+0100
$l_str_LayoutOption = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT);
if ($l_str_LayoutOption != 'none') {
wp_enqueue_style(
- 'mci-footnotes-layout-' . $l_str_LayoutOption,
- plugins_url(
- MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/layout-' . $l_str_LayoutOption . '.css'
- ),
- array(),
- FOOTNOTES_VERSION,
- 'all'
- );
+ 'mci-footnotes-layout-' . $l_str_LayoutOption,
+ plugins_url(
+ MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/layout-' . $l_str_LayoutOption . '.css'
+ ),
+ array(),
+ FOOTNOTES_VERSION,
+ 'all'
+ );
}
}
}
diff --git a/class/language.php b/class/language.php
index 9e2730e..4e4cf6c 100644
--- a/class/language.php
+++ b/class/language.php
@@ -7,7 +7,9 @@
*
* Edited for:
* 2.0.0 PHP-related bug fix thanks to MatKus (@matkus) 2020-10-26T1609+0100
- * 2.2.0 conform to WordPress plugin language file name scheme 2020-12-08T1931+0100
+ * 2.1.6 conform to WordPress plugin language file name scheme 2020-12-08T1931+0100
+ *
+ * Last modified: 2020-12-11T1449+0100
*/
/**
@@ -65,7 +67,7 @@ class MCI_Footnotes_Language {
return load_plugin_textdomain(
MCI_Footnotes_Config::C_STR_PLUGIN_NAME,
false, // This argument only fills the gap left by a deprecated argument (since WP2.7).
- MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/languages' // The plugin basedir is provided.
+ MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/languages' // The plugin basedir is provided; trailing slash will be clipped.
);
}
}
diff --git a/class/settings.php b/class/settings.php
index 601a8e7..d0d8a4e 100644
--- a/class/settings.php
+++ b/class/settings.php
@@ -21,7 +21,7 @@
* 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100
* 2.1.6 set default priority level of the_content to 98 2020-12-10T0447+0100
*
- * Last modified: 2020-12-10T0447+0100
+ * Last modified: 2020-12-12T1224+0100
*/
@@ -145,8 +145,8 @@ class MCI_Footnotes_Settings {
* @author Stefan Herndler
* @since 1.5.5
* @var string
- *
- * @since 2.1.6: this setting removed as irrelevant since priority level setting is permanently visible 2020-12-09T2107+0100
+ *
+ * @since 2.1.6: this setting removed as irrelevant since priority level setting is permanently visible 2020-12-09T2107+0100
*/
const C_BOOL_FOOTNOTES_EXPERT_MODE = "footnote_inputfield_enable_expert_mode";
@@ -466,10 +466,10 @@ class MCI_Footnotes_Settings {
/**
* Settings Container Key for URL wrap option
- *
- * This is made optional because it may cause issues when the regex catches too much;
- * alongside the regex now contains a catch-all negative lookbehind excluding every URL
- * preceded by '\w=.'
+ *
+ * This is made optional because it may cause issues when the regex catches too much;
+ * alongside the regex now contains a catch-all negative lookbehind excluding every URL
+ * preceded by '\w=.'
*
* @since 2.1.6
* @var bool
@@ -672,13 +672,12 @@ class MCI_Footnotes_Settings {
// empty should be interpreted as PHP_INT_MAX, but a numbox cannot be set to empty:
//
// define -1 as PHP_INT_MAX instead
- self::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL => PHP_INT_MAX,
-
- // Priority level of the_content as the only relevant one
- // must be less than 99 because that is the level of Super Socializer,
- // and the Pinterest button code contains at least one instance of '(('
- // and one of '))', i.e. the default footnote start and end short codes,
- // causing an issue with two fake footnotes messing up the whole website.
+ self::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL => PHP_INT_MAX,
+
+ // Priority level of the_content as the only relevant one
+ // must be less than 99 because social icons may yield scripts that
+ // contain the strings '((' and '))', i.e. the default footnote start
+ // and end short codes, causing issues with fake footnotes.
self::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL => 98,
self::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL => PHP_INT_MAX,
self::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL => PHP_INT_MAX,
@@ -833,6 +832,9 @@ class MCI_Footnotes_Settings {
*
* @author Stefan Herndler
* @since 1.5.0
+ *
+ * Edit: This didn’t actually work.
+ * @since 2.2.0 this function is not called any longer when deleting the plugin
*/
public function ClearAll() {
// iterate through each Settings Container
diff --git a/class/task.php b/class/task.php
index 1c53169..38597d9 100644
--- a/class/task.php
+++ b/class/task.php
@@ -28,7 +28,7 @@
* 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100
* 2.1.6 add catch-all exclusion to fix URL line wrapping 2020-12-09T1921+0100
*
- * Last modified: 2020-12-10T1006+0100
+ * Last modified: 2020-12-11T1437+0100
*/
// If called directly, abort:
@@ -282,6 +282,9 @@ class MCI_Footnotes_Task {
*
* @author Stefan Herndler
* @since 1.5.0
+ *
+ * Edited:
+ * @since 2.2.0 more options 2020-12-11T0506+0100
*/
public function wp_footer() {
if (MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION) == "footer") {
@@ -294,22 +297,20 @@ class MCI_Footnotes_Task {
return;
}
// set a hyperlink to the word "footnotes" in the Love slug
- $l_str_LinkedName = sprintf('%s',MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME);
+ $l_str_LinkedName = sprintf('%s', MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME);
// get random love me text
if (strtolower($l_str_LoveMeIndex) == "random") {
- $l_str_LoveMeIndex = "text-" . rand(1,3);
+ $l_str_LoveMeIndex = "text-" . rand(1,7);
}
switch ($l_str_LoveMeIndex) {
- case "text-1":
- $l_str_LoveMeText = sprintf(__('I %s %s', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), MCI_Footnotes_Config::C_STR_LOVE_SYMBOL, $l_str_LinkedName);
- break;
- case "text-2":
- $l_str_LoveMeText = sprintf(__('this site uses the awesome %s Plugin', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), $l_str_LinkedName);
- break;
- case "text-3":
- default:
- $l_str_LoveMeText = sprintf(__('extra smooth %s', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), $l_str_LinkedName);
- break;
+ // options named wrt backcompat, simplest is default:
+ case "text-1": $l_str_LoveMeText = sprintf(__('I %2$s %1$s', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), $l_str_LinkedName, MCI_Footnotes_Config::C_STR_LOVE_SYMBOL); break;
+ case "text-2": $l_str_LoveMeText = sprintf(__('This website uses the awesome %s plugin.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), $l_str_LinkedName); break;
+ case "text-4": $l_str_LoveMeText = sprintf('%s %s', $l_str_LinkedName, MCI_Footnotes_Config::C_STR_LOVE_SYMBOL); break;
+ case "text-5": $l_str_LoveMeText = sprintf('%s %s', MCI_Footnotes_Config::C_STR_LOVE_SYMBOL, $l_str_LinkedName); break;
+ case "text-6": $l_str_LoveMeText = sprintf(__('This website uses %s.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), $l_str_LinkedName); break;
+ case "text-7": $l_str_LoveMeText = sprintf(__('This website uses the %s plugin.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), $l_str_LinkedName); break;
+ case "text-3": default: $l_str_LoveMeText = sprintf('%s', $l_str_LinkedName); break;
}
echo sprintf('
%s
', $l_str_LoveMeText);
}
@@ -518,7 +519,7 @@ class MCI_Footnotes_Task {
$l_str_FootnoteText = substr($p_str_Content, $l_int_PosStart + strlen($l_str_StartingTag), $l_int_Length - strlen($l_str_StartingTag));
// fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element,
- // to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents
+ // to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents.
// spare however values of the href and the src arguments!
// Even ARIA labels may take an URL as value, so use \w=[\'"] as a catch-all 2020-12-10T1005+0100
// see public.css
diff --git a/class/widgets/reference-container.php b/class/widgets/reference-container.php
index 58a5747..0c7931f 100644
--- a/class/widgets/reference-container.php
+++ b/class/widgets/reference-container.php
@@ -5,6 +5,8 @@
* @filesource
* @author Stefan Herndler
* @since 1.5.0 14.09.14 14:26
+ *
+ * Edited 2.2.0 2020-12-12T2131+0100
*/
@@ -16,64 +18,68 @@
*/
class MCI_Footnotes_Widget_ReferenceContainer extends MCI_Footnotes_WidgetBase {
- /**
- * Returns an unique ID as string used for the Widget Base ID.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @return string
- */
- protected function getID() {
- return "footnotes_widget";
- }
+ /**
+ * Returns an unique ID as string used for the Widget Base ID.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @return string
+ */
+ protected function getID() {
+ return "footnotes_widget";
+ }
- /**
- * Returns the Public name of the Widget to be displayed in the Configuration page.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @return string
- */
- protected function getName() {
- return MCI_Footnotes_Config::C_STR_PLUGIN_NAME;
- }
+ /**
+ * Returns the Public name of the Widget to be displayed in the Configuration page.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @return string
+ */
+ protected function getName() {
+ return MCI_Footnotes_Config::C_STR_PLUGIN_NAME;
+ }
- /**
- * Returns the Description of the child widget.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @return string
- */
- 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);
- }
+ /**
+ * Returns the Description of the child widget.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @return string
+ *
+ * Edit: curly quotes 2.2.0 2020-12-12T2130+0100
+ */
+ 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);
+ }
- /**
- * Outputs the Settings of the Widget.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @param mixed $instance
- * @return void
- */
- 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);
- }
+ /**
+ * Outputs the Settings of the Widget.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @param mixed $instance
+ * @return void
+ *
+ * Edit: curly quotes 2.2.0 2020-12-12T2130+0100
+ */
+ 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);
+ }
- /**
- * Outputs the Content of the Widget.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- * @param mixed $args
- * @param mixed $instance
- */
- 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();
- }
- }
-}
\ No newline at end of file
+ /**
+ * Outputs the Content of the Widget.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.0
+ * @param mixed $args
+ * @param mixed $instance
+ */
+ 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();
+ }
+ }
+}
diff --git a/css/public.css b/css/public.css
index 14ce23c..1db27e7 100755
--- a/css/public.css
+++ b/css/public.css
@@ -5,9 +5,14 @@
* Created-Time: 16:21
* Since: 1.0
*
- * Version: 2.2.0d6
+ * Version: 2.2.0d8
*
- * Last modified: 2020-12-10T1320+0100
+ * Classes added to public.css may be added to the
+ * list documenting CSS classes for Custom CSS if
+ * recommended for general use.
+ * List in templates/dashboard/customize-css.html
+ *
+ * Last modified: 2020-12-12T2203+0100
*/
@@ -99,12 +104,11 @@ Classes:
.footnote_tooltip {
display: none;
- z-index: 2147483647;
+ z-index: 2147483647 !important;
cursor: auto;
text-align: left;
padding: 12px;
line-height: 1.2;
- /*font-size: inherit; moved to settings since 2.1.4 */
font-weight: normal;
font-style: normal;
}
diff --git a/css/settings.css b/css/settings.css
index 39122d0..e815e19 100755
--- a/css/settings.css
+++ b/css/settings.css
@@ -5,9 +5,9 @@
* Created-Time: 16:21
* Since: 1.0
*
- * Version: 2.2.0d6
+ * Version: 2.2.0d8
*
- * Last modified: 2020-12-10T1320+0100
+ * Last modified: 2020-12-12T2203+0100
*/
@@ -182,22 +182,19 @@ IE doesn’t support nth child, but these are not critical
white-space: nowrap;
}
-/*
-Other settings
-*/
-#settings_other tr td:nth-child(2) {
- width: 30%;
-}
-
/*
Custom CSS
+Localized notices are dropped to ease translators’ task.
16 CSS classes are listed directly in the template
templates/dashboard/customize-css.html
-Localized notices are dropped to ease translators’ task.
+
end tags are omitted per HTML5 standard, to improve
+maintainability and readability of the source list.
+
-The textarea has monospace font but no tab support.
+The textarea has monospace font, but no other features
+helping edit CSS, as tab support and syntactic colors.
*/
#customize_css tr td:first-child {
width: 44% !important;
@@ -227,10 +224,18 @@ The textarea has monospace font but no tab support.
/************************************************************
Notices
-span previously formatted as em element
-but emphasis is not the correct semantics,
-as it is rendered as bold in other scripts
-so we need an explicit italic style:
+These spans were previously formatted using the em element.
+But the intended semantics was not emphasis.
+In locales using boldface to emphasize, the effect is the
+exact opposite of the intention.
+
+So we must use spans with explicit italic font style.
+Scripts not featuring italic fonts fall back to normal,
+and that is just fine, as italic is only needed here for
+scripts that do have italic, and failing to use it would
+look weird.
+
+since 2.1.4
*/
.footnotes_notice {
font-style: italic;
@@ -239,12 +244,15 @@ so we need an explicit italic style:
/************************************************************
Descriptions
-fullwidth div above or below settings tables:
+padded div above or below a settings table
+
+Use case: more extensive information not fitting into a brief
+notice after the end of the settings box.
*/
.footnotes_description {
- padding: 0 10%;
+ padding: 0 6%;
}
.footnotes_description p {
- font-size: 1.4em;
+ font-size: 1.2em;
font-style: italic;
}
diff --git a/footnotes.php b/footnotes.php
index 77f3c71..07d0e48 100755
--- a/footnotes.php
+++ b/footnotes.php
@@ -4,12 +4,12 @@
Plugin URI: https://wordpress.org/plugins/footnotes/
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: Mark Cheret
- Version: 2.2.0d6
+ Version: 2.2.0d8
Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes
Domain Path: /languages
*/
-define( 'FOOTNOTES_VERSION', '2.2.0d6' );
+define( 'FOOTNOTES_VERSION', '2.2.0d8' );
/*
Copyright 2020 Mark Cheret (email: mark@cheret.de)
diff --git a/js/wysiwyg-editor.js b/js/wysiwyg-editor.js
index 38322a9..0c305dd 100644
--- a/js/wysiwyg-editor.js
+++ b/js/wysiwyg-editor.js
@@ -1,5 +1,8 @@
/**
* Created by Stefan on 24.05.14.
+ *
+ *
+ * Edit: be careful to maintain version number near EOF 2020-12-11T1225+0100
*/
(function() {
@@ -57,18 +60,20 @@
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
+ *
+ * Edit: needs update the version number manually 2020-12-11T1224+0100
*/
getInfo : function() {
return {
longname : 'Inserts the Footnotes short code.',
author : 'Mark Cheret',
authorurl : 'https://cheret.de',
- infourl : 'http://wordpress.org/plugins/footnotes/',
- version : "2.0.0"
+ infourl : 'https://wordpress.org/plugins/footnotes/',
+ version : "2.1.6"
};
}
});
// Register plugin
tinymce.PluginManager.add('footnotes', tinymce.plugins.Footnotes);
-})();
\ No newline at end of file
+})();
diff --git a/readme.txt b/readme.txt
index ae4ad91..27ceaff 100755
--- a/readme.txt
+++ b/readme.txt
@@ -2,7 +2,7 @@
Contributors: mark.cheret, lolzim, pewgeuges, dartiss
Tags: footnote, footnotes, bibliography, formatting, notes, Post, posts, reference, referencing
Requires at least: 3.9
-Tested up to: 5.5
+Tested up to: 5.6
Requires PHP: 5.6
Stable Tag: 2.1.6
License: GPLv3 or later
@@ -80,21 +80,33 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog ==
-= 2.2.0d6 =
+= 2.2.0d7 =
+- Add: Start/end short codes: more predefined options
+- Add: Numbering styles: lowercase Roman numerals support
+- Update: Dashboard: Tooltip settings: grouped into 3 thematic containers
+- Update: Dashboard: Main settings: grouped into 3 specific containers
+- Update: Dashboard: moved link element option to the Referrers options
+- Update: Dashboard: moved URL wrap option to the Reference container options
+- Update: Dashboard: grouped both Custom CSS and priority level settings
+- Update: Dashboard: renamed tabs
+- Bugfix: Tooltips: add 'important' property to z-index to fix display overlay issue
- Bugfix: Localization: correct arguments for plugin textdomain load function
+- Update: Priority levels: update the notice in the dashboard Priority tab
+- Bugfix: Reference container, tooltips: URL wrap: specifically catch the quotation mark
+- Add: Footnotes mention in the footer: more options
= 2.1.6 =
- Bugfix: Priority levels: set the_content priority level to 98 to prevent plugin conflict
- Bugfix: Tooltips: set z-index to maximum 2147483647 to address display issues with overlay content
-- Bugfix: Reference container, tooltips: fix issues with URL wrap span by catch-all negative lookbehind
-- Bugfix: Reference container, tooltips: add option to disable URL line wrapping added for browser support
+- Bugfix: Reference container, tooltips: URL wrap: fix issues with span by catch-all negative lookbehind
+- Bugfix: Dashboard: URL wrap: add option to properly enable/disable URL wrap
- Update: Dashboard: reorder tabs and update tab labels
- Bugfix: Dashboard: remove Expert mode enable setting since permanently enabled as 'Priority'
- Bugfix: Dashboard: fix punctuation-related localization issue by including colon in labels
- Bugfix: Localization: conform to WordPress plugin language file name scheme
= 2.1.5 =
-- Bugfix: Reference container, tooltips: exclude image source too from URL line wrapping span
+- Bugfix: Reference container, tooltips: URL wrap: exclude image source too
= 2.1.4 =
- Add: Dashboard: Main settings: add settings for scroll offset and duration
diff --git a/templates/dashboard/customize-css.html b/templates/dashboard/customize-css.html
index b28460d..595b938 100644
--- a/templates/dashboard/customize-css.html
+++ b/templates/dashboard/customize-css.html
@@ -2,7 +2,7 @@
[[headline]]
-
+
.footnote_referrer = enclosing <span>
.footnote_plugin_tooltip_text = inner <sup>, not tooltip
@@ -22,8 +22,8 @@
.footnote_backlink = <a> or <span> if identical footnotes are combined, or in second <td> in 3-column table
.footnote_index_arrow = nested <span>, symbol only
.footnote_plugin_text = second <td>, or third <td> in 3-column table
-