Release 1.2.3

- Bugfix: Removed 'Warning output' of Plugins activation and deactivation function (thanks to Piet Bos, Spain)
- Bugfix: Added missing meta boxes parameter on Settings page (thanks to Piet Bos, Spain)
- Bugfix: Removed Widget text formatting
- Bugfix: Load default settings value of setting doesn't exist yet (first usage)
- Bugfix: Replacement of footnotes tag on public pages with html special characters in the content
- Feature: Footnotes tag color is set to the default link color depending on the current Theme (thanks to Daniel Formo, Norway)

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@929484 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Aricura 2014-06-10 08:51:02 +00:00
parent fbfa893886
commit 3b7e77da48
9 changed files with 37 additions and 21 deletions

View file

@ -42,7 +42,7 @@ class Class_Footnotes
* activates the plugin * activates the plugin
* @since 1.0 * @since 1.0
*/ */
function activate() static function activate()
{ {
// unused // unused
} }
@ -51,7 +51,7 @@ class Class_Footnotes
* deactivates the plugin * deactivates the plugin
* @since 1.0 * @since 1.0
*/ */
function deactivate() static function deactivate()
{ {
// unused // unused
} }
@ -61,7 +61,7 @@ class Class_Footnotes
* updated file path in version 1.0.6 * updated file path in version 1.0.6
* @since 1.0 * @since 1.0
*/ */
function uninstall() static function uninstall()
{ {
/* uninstalling the plugin is only allowed for logged in users */ /* uninstalling the plugin is only allowed for logged in users */
if (!is_user_logged_in()) { if (!is_user_logged_in()) {

View file

@ -137,7 +137,7 @@ class Class_FootnotesSettings
settings_fields($l_str_tab); settings_fields($l_str_tab);
/* outputs the settings field of the current active tab */ /* outputs the settings field of the current active tab */
do_settings_sections($l_str_tab); do_settings_sections($l_str_tab);
do_meta_boxes($l_str_tab, 'main'); do_meta_boxes($l_str_tab, 'main', NULL);
/* adds a submit button to the current page */ /* adds a submit button to the current page */
/* /*
* add submit button only if there are some settings on the current page * add submit button only if there are some settings on the current page

View file

@ -14,7 +14,7 @@ class Class_FootnotesWidget extends WP_Widget {
function Class_FootnotesWidget() { function Class_FootnotesWidget() {
$widget_ops = array( 'classname' => 'Class_FootnotesWidget', 'description' => __('The widget defines the position of the reference container if set to "widget area".', FOOTNOTES_PLUGIN_NAME) ); $widget_ops = array( 'classname' => 'Class_FootnotesWidget', 'description' => __('The widget defines the position of the reference container if set to "widget area".', FOOTNOTES_PLUGIN_NAME) );
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'footnotes_widget' ); $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'footnotes_widget' );
$this->WP_Widget( 'footnotes_widget', FOOTNOTES_PLUGIN_PUBLIC_NAME, $widget_ops, $control_ops ); $this->WP_Widget( 'footnotes_widget', FOOTNOTES_PLUGIN_NAME, $widget_ops, $control_ops );
} }
/** /**

View file

@ -90,7 +90,7 @@
} }
.footnote_plugin_link:hover { .footnote_plugin_link:hover {
color: #4777ff !important; /*color: #4777ff !important;*/
text-decoration: none !important; text-decoration: none !important;
} }
@ -102,7 +102,7 @@
/* tooltip */ /* tooltip */
.footnote_plugin_tooltip { .footnote_plugin_tooltip {
outline: none !important; outline: none !important;
color: #4777ff !important; /*color: #4777ff !important;*/
text-decoration: none !important; text-decoration: none !important;
cursor: pointer !important; cursor: pointer !important;
} }

View file

@ -66,6 +66,14 @@ function footnotes_filter_options($p_str_OptionsField, $p_arr_DefaultValues, $p_
$l_arr_Options[$l_str_Key] = ""; $l_arr_Options[$l_str_Key] = "";
} }
} }
// check if each key from the default values exist in return array
foreach($p_arr_DefaultValues as $l_str_Key => $l_str_Value) {
// if key not exists, add it with its default value
if (!array_key_exists($l_str_Key, $l_arr_Options)) {
$l_arr_Options[$l_str_Key] = $l_str_Value;
}
}
/* returns the filtered array */ /* returns the filtered array */
return $l_arr_Options; return $l_arr_Options;
} }

View file

@ -64,7 +64,7 @@ function footnotes_Replacer_Content($p_str_Content)
/* get setting for 'display reference container position' */ /* get setting for 'display reference container position' */
$l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE]; $l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE];
/* returns content */ /* returns content */
return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false, true); return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false);
} }
/** /**
@ -81,7 +81,7 @@ function footnotes_Replacer_Excerpt($p_str_Content)
$l_bool_SearchExcerpt = footnotes_ConvertToBool($g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_SEARCH_IN_EXCERPT]); $l_bool_SearchExcerpt = footnotes_ConvertToBool($g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_SEARCH_IN_EXCERPT]);
/* search in the excerpt only if activated */ /* search in the excerpt only if activated */
if ($l_bool_SearchExcerpt) { if ($l_bool_SearchExcerpt) {
return footnotes_replaceFootnotes($p_str_Content, false, false, true); return footnotes_replaceFootnotes($p_str_Content, false, false);
} }
/* returns content */ /* returns content */
return $p_str_Content; return $p_str_Content;
@ -112,7 +112,7 @@ function footnotes_Replacer_WidgetText($p_str_Content)
/* get setting for 'display reference container position' */ /* get setting for 'display reference container position' */
$l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE]; $l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE];
/* returns content */ /* returns content */
return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false, false); return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false);
} }
/** /**
@ -182,10 +182,9 @@ function footnotes_LoveAndShareMe()
* @param string $p_str_Content * @param string $p_str_Content
* @param bool $p_bool_OutputReferences [default: true] * @param bool $p_bool_OutputReferences [default: true]
* @param bool $p_bool_ReplaceHtmlCharsSettings [ default: false] * @param bool $p_bool_ReplaceHtmlCharsSettings [ default: false]
* @param bool $p_bool_ReplaceHtmlCharsContent [ default: false]
* @return string * @return string
*/ */
function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = true, $p_bool_ReplaceHtmlCharsSettings = false, $p_bool_ReplaceHtmlCharsContent = false) function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = true, $p_bool_ReplaceHtmlCharsSettings = false)
{ {
/* access to the global settings collection */ /* access to the global settings collection */
global $g_arr_FootnotesSettings; global $g_arr_FootnotesSettings;
@ -193,7 +192,8 @@ function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = t
$g_arr_FootnotesSettings = footnotes_filter_options(FOOTNOTE_SETTINGS_CONTAINER, Class_FootnotesSettings::$a_arr_Default_Settings, $p_bool_ReplaceHtmlCharsSettings); $g_arr_FootnotesSettings = footnotes_filter_options(FOOTNOTE_SETTINGS_CONTAINER, Class_FootnotesSettings::$a_arr_Default_Settings, $p_bool_ReplaceHtmlCharsSettings);
/* replace all footnotes in the content */ /* replace all footnotes in the content */
$p_str_Content = footnotes_getFromString($p_str_Content, $p_bool_ReplaceHtmlCharsContent); $p_str_Content = footnotes_getFromString($p_str_Content, true);
$p_str_Content = footnotes_getFromString($p_str_Content, false);
/* add the reference list if set */ /* add the reference list if set */
if ($p_bool_OutputReferences) { if ($p_bool_OutputReferences) {

View file

@ -4,7 +4,7 @@
Plugin URI: http://wordpress.org/plugins/footnotes/ Plugin URI: http://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. 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: media competence institute Author: media competence institute
Version: 1.2.2 Version: 1.2.3
Author URI: http://cheret.co.uk/mci Author URI: http://cheret.co.uk/mci
Text Domain: footnotes Text Domain: footnotes
Domain Path: /languages Domain Path: /languages
@ -35,7 +35,6 @@
* Since: 1.0 * Since: 1.0
*/ */
/* include constants */ /* include constants */
require_once(dirname(__FILE__) . "/includes/defines.php"); require_once(dirname(__FILE__) . "/includes/defines.php");
/* include language functions */ /* include language functions */
@ -83,6 +82,11 @@ add_filter("plugin_action_links_{$l_str_plugin_file}", 'footnotes_plugin_setting
/* register footnotes widget */ /* register footnotes widget */
add_action('widgets_init', create_function('', 'return register_widget("Class_FootnotesWidget");')); add_action('widgets_init', create_function('', 'return register_widget("Class_FootnotesWidget");'));
/* register hook for activating the plugin */
register_activation_hook(__FILE__, array('Class_Footnotes', 'activate'));
/* register hook for deactivating the plugin */
register_deactivation_hook(__FILE__, array('Class_Footnotes', 'deactivate'));
/* only admin is allowed to execute the plugin settings */ /* only admin is allowed to execute the plugin settings */
if (!function_exists('is_admin')) { if (!function_exists('is_admin')) {
header('Status: 403 Forbidden'); header('Status: 403 Forbidden');
@ -90,10 +94,6 @@ if (!function_exists('is_admin')) {
exit(); exit();
} }
/* register hook for activating the plugin */
register_activation_hook(__FILE__, array('Class_Footnotes', 'activate'));
/* register hook for deactivating the plugin */
register_deactivation_hook(__FILE__, array('Class_Footnotes', 'deactivate'));
/* register hook for uninstalling the plugin */ /* register hook for uninstalling the plugin */
register_uninstall_hook(__FILE__, array('Class_Footnotes', 'uninstall')); register_uninstall_hook(__FILE__, array('Class_Footnotes', 'uninstall'));

View file

@ -5,7 +5,7 @@ Requires at least: 3.9
Tested up to: 3.9.1 Tested up to: 3.9.1
License: GPLv3 or later License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html
Stable Tag: 1.2.2 Stable Tag: 1.2.3
== Description == == Description ==
@ -64,6 +64,14 @@ No, this Plugin has been written from scratch. Of course some inspirations on ho
== Changelog == == Changelog ==
= 1.2.3 =
- Bugfix: Removed 'Warning output' of Plugins activation and deactivation function (thanks to Piet Bos, Spain)
- Bugfix: Added missing meta boxes parameter on Settings page (thanks to Piet Bos, Spain)
- Bugfix: Removed Widget text formatting
- Bugfix: Load default settings value of setting doesn't exist yet (first usage)
- Bugfix: Replacement of footnotes tag on public pages with html special characters in the content
- Feature: Footnotes tag color is set to the default link color depending on the current Theme (thanks to Daniel Formo, Norway)
= 1.2.2 = = 1.2.2 =
- Bugfix: WYSIWYG editor and plain text editor buttons insert footnote short code correctly (also if defined like html tag) - Bugfix: WYSIWYG editor and plain text editor buttons insert footnote short code correctly (also if defined like html tag)
- Update: The admin can decide which "I love footnotes" text (or not text) will be displayed in the footer - Update: The admin can decide which "I love footnotes" text (or not text) will be displayed in the footer

View file

@ -1,6 +1,6 @@
<sup class="footnote_plugin_tooltip" name="footnote_plugin_tooltip_[[FOOTNOTE INDEX]]" <sup class="footnote_plugin_tooltip" name="footnote_plugin_tooltip_[[FOOTNOTE INDEX]]"
onclick="footnote_expand_reference_container('#footnote_plugin_reference_[[FOOTNOTE INDEX]]');"> onclick="footnote_expand_reference_container('#footnote_plugin_reference_[[FOOTNOTE INDEX]]');">
[[FOOTNOTE INDEX]]) <a>[[FOOTNOTE INDEX]])</a>
<span> <span>
[[FOOTNOTE TEXT]] [[FOOTNOTE TEXT]]
</span> </span>