- Add: Plugin Widget to define where the reference container shall appear when set to "widget area"

- Update: Translation for new settings and for the Widget description

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@920341 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Aricura 2014-05-24 12:38:22 +00:00
parent b7af8ff042
commit e6a31532e0
10 changed files with 216 additions and 95 deletions

View file

@ -472,9 +472,9 @@ class Class_FootnotesSettings
/* setting for 'footnote tag starts with' */
$l_arr_Options = array(
"((" => __("((", FOOTNOTES_PLUGIN_NAME),
"<fn>" => htmlspecialchars(__("<fn>", FOOTNOTES_PLUGIN_NAME)),
"[ref]" => __("[ref]", FOOTNOTES_PLUGIN_NAME),
"((" => "((",
"<fn>" => htmlspecialchars("<fn>"),
"[ref]" => "[ref]",
"userdefined" => __('user defined', FOOTNOTES_PLUGIN_NAME)
);
$this->AddLabel(FOOTNOTE_INPUTFIELD_PLACEHOLDER_START, __("Footnote tag starts with:", FOOTNOTES_PLUGIN_NAME));
@ -482,9 +482,9 @@ class Class_FootnotesSettings
/* setting for 'footnote tag ends with' */
$l_arr_Options = array(
"))" => __("))", FOOTNOTES_PLUGIN_NAME),
"</fn>" => htmlspecialchars(__("</fn>", FOOTNOTES_PLUGIN_NAME)),
"[/ref]" => __("[/ref]", FOOTNOTES_PLUGIN_NAME),
"))" => "))",
"</fn>" => htmlspecialchars("</fn>"),
"[/ref]" => "[/ref]",
"userdefined" => __('user defined', FOOTNOTES_PLUGIN_NAME)
);
$this->AddLabel(FOOTNOTE_INPUTFIELD_PLACEHOLDER_END, __("and ends with:", FOOTNOTES_PLUGIN_NAME) . '&nbsp;&nbsp;&nbsp;', 'text-align: right;');

View file

@ -0,0 +1,51 @@
<?php
/**
* Created by PhpStorm.
* User: Stefan
* Date: 24.05.14
* Time: 13:57
*/
class Class_FootnotesWidget extends WP_Widget {
/**
* @constructor
*/
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) );
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'footnotes_widget' );
$this->WP_Widget( 'footnotes_widget', sprintf(__("%s Widget", FOOTNOTES_PLUGIN_NAME), FOOTNOTES_PLUGIN_PUBLIC_NAME), $widget_ops, $control_ops );
}
/**
* widget form creation
* @param $instance
*/
function form($instance) {
echo __('The widget defines the position of the reference container if set to "widget area".', FOOTNOTES_PLUGIN_NAME);
}
/**
* widget update
* @param $new_instance
* @param $old_instance
*/
function update($new_instance, $old_instance) {
return $new_instance;
}
/**
* widget display
* @param $args
* @param $instance
*/
function widget($args, $instance) {
/* access to the global settings collection */
global $g_arr_FootnotesSettings;
/* get setting for 'display reference container position' */
$l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE];
if ($l_str_ReferenceContainerPosition == "widget") {
echo footnotes_OutputReferenceContainer();
}
}
}

View file

@ -61,3 +61,5 @@ define("FOOTNOTES_TEMPLATES_DIR", dirname(__FILE__) . "/../templates/");
* @since 1.1.1
*/
define("FOOTNOTES_NO_SLUGME_PLUG", "[[no footnotes: love]]");
define("FOOTNOTES_REFERENCE_CONTAINER_POSITION", "[[footnotes reference container position]]");

View file

@ -123,8 +123,15 @@ function footnotes_Replacer_WidgetText($p_str_Content)
*/
function footnotes_StopReplacing()
{
/* access to the global settings collection */
global $g_arr_FootnotesSettings;
/* get setting for 'display reference container position' */
$l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE];
if ($l_str_ReferenceContainerPosition == "footer") {
echo footnotes_OutputReferenceContainer();
}
}
/**
* outputs a link to love and share this awesome plugin

View file

@ -53,6 +53,8 @@ require_once(dirname(__FILE__) . "/includes/replacer.php");
require_once(dirname(__FILE__) . "/classes/footnotes.php");
/* require plugin settings class */
require_once(dirname(__FILE__) . "/classes/footnotes_settings.php");
/* require plugin widget class */
require_once(dirname(__FILE__) . "/classes/footnotes_widget.php");
/* register functions for the footnote replacement */
footnotes_RegisterReplacementFunctions();
@ -82,6 +84,9 @@ add_action('plugins_loaded', 'footnotes_load_language');
$l_str_plugin_file = FOOTNOTES_PLUGIN_DIR_NAME . '/index.php';
add_filter("plugin_action_links_{$l_str_plugin_file}", 'footnotes_plugin_settings_link', 10, 2);
/* register footnotes widget */
add_action('widgets_init', create_function('', 'return register_widget("Class_FootnotesWidget");'));
/* initialize an object of the plugin class */
global $g_obj_FootnotesPlugin;

Binary file not shown.

View file

@ -1,9 +1,9 @@
msgid ""
msgstr ""
"Project-Id-Version: footnotes\n"
"POT-Creation-Date: 2014-05-22 15:42+0100\n"
"PO-Revision-Date: 2014-05-22 15:43+0100\n"
"Last-Translator: SHE <s.herndler@methis.at>\n"
"POT-Creation-Date: 2014-05-24 14:35+0100\n"
"PO-Revision-Date: 2014-05-24 14:37+0100\n"
"Last-Translator: Stefan Herndler <support@herndler.org>\n"
"Language-Team: SHE <s.herndler@methis.at>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
@ -26,107 +26,108 @@ msgstr "Sie müssen angemeldet sein um diese Funktion ausführen zu können."
msgid "You do not have permission to run this script."
msgstr "Sie haben nicht die Berechtigung diese Funktion auszuführen."
#: classes/footnotes_settings.php:381
#: classes/footnotes_settings.php:409
msgid "General"
msgstr "Allgemein"
#: classes/footnotes_settings.php:383
#: classes/footnotes_settings.php:411
#, php-format
msgid "%s Settings"
msgstr "%s Einstellungen"
#: classes/footnotes_settings.php:384
#: classes/footnotes_settings.php:412
msgid "References Container"
msgstr "Einzelnachweise"
#: classes/footnotes_settings.php:385
msgid "Footnotes styling"
msgstr "Layout der Fußnoten"
#: classes/footnotes_settings.php:413
#, php-format
msgid "%s styling"
msgstr "%s Design"
#: classes/footnotes_settings.php:386
#: classes/footnotes_settings.php:415
msgid "Other"
msgstr "Andere"
#: classes/footnotes_settings.php:406
#: classes/footnotes_settings.php:435
msgid "References label:"
msgstr "Überschrift \"Einzelnachweis\":"
#: classes/footnotes_settings.php:411
#: classes/footnotes_settings.php:440
msgid "Collapse references by default:"
msgstr "Verstecke Einzelnachweise standardmäßig:"
#: classes/footnotes_settings.php:420
#: classes/footnotes_settings.php:449
msgid "in the footer"
msgstr "am Ende der Seite"
#: classes/footnotes_settings.php:421
#: classes/footnotes_settings.php:450
msgid "at the end of the post"
msgstr "nach einem Beitrag"
#: classes/footnotes_settings.php:422
#: classes/footnotes_settings.php:451
msgid "in the widget area"
msgstr "im Widget"
#: classes/footnotes_settings.php:424
#: classes/footnotes_settings.php:453
msgid "Where shall the reference container appear:"
msgstr "Positionierung der Einzelnachweise:"
#: classes/footnotes_settings.php:436 classes/footnotes_settings.php:473
#: classes/footnotes_settings.php:482
#: classes/footnotes_settings.php:465 classes/footnotes_settings.php:522
#: classes/footnotes_settings.php:543
msgid "Yes"
msgstr "Ja"
#: classes/footnotes_settings.php:437 classes/footnotes_settings.php:474
#: classes/footnotes_settings.php:483
#: classes/footnotes_settings.php:466 classes/footnotes_settings.php:523
#: classes/footnotes_settings.php:544
msgid "No"
msgstr "Nein"
#: classes/footnotes_settings.php:439
#: classes/footnotes_settings.php:468
msgid "Combine identical footnotes:"
msgstr "Kombiniere meine Fußnoten:"
#: classes/footnotes_settings.php:444
#: classes/footnotes_settings.php:478 classes/footnotes_settings.php:488
msgid "user defined"
msgstr "benutzerdefiniert"
#: classes/footnotes_settings.php:480
msgid "Footnote tag starts with:"
msgstr "Fußnoten starten mit:"
#: classes/footnotes_settings.php:448
#: classes/footnotes_settings.php:490
msgid "and ends with:"
msgstr "und endet mit:"
#: classes/footnotes_settings.php:455
#: classes/footnotes_settings.php:504
msgid "Arabic Numbers - Plain"
msgstr "arabische Ziffern"
#: classes/footnotes_settings.php:456
#: classes/footnotes_settings.php:505
msgid "Arabic Numbers - Leading 0"
msgstr "arabisch Ziffern - führende Null"
#: classes/footnotes_settings.php:457
#: classes/footnotes_settings.php:506
msgid "Latin Character - lower case"
msgstr "alphabetisch - Kleinschreibung"
#: classes/footnotes_settings.php:458
#: classes/footnotes_settings.php:507
msgid "Latin Character - upper case"
msgstr "alphabetisch - Großschreibung"
#: classes/footnotes_settings.php:459
#: classes/footnotes_settings.php:508
msgid "Roman Numerals"
msgstr "Römische Ziffern"
#: classes/footnotes_settings.php:461
#: classes/footnotes_settings.php:510
msgid "Counter style:"
msgstr "Fußnoten Zähler:"
#: classes/footnotes_settings.php:476
msgid "Allow footnotes on Summarized Posts:"
msgstr "Erlaube Fußnoten in Zusammenfassungen:"
#: classes/footnotes_settings.php:485
#: classes/footnotes_settings.php:525
#, php-format
msgid "Tell the world you're using %s:"
msgstr "Teile der Welt mit, dass du %s verwendest:"
#: classes/footnotes_settings.php:490
#: classes/footnotes_settings.php:530
#, php-format
msgid ""
"Don't tell the world you're using %s on specific pages by adding the "
@ -135,35 +136,52 @@ msgstr ""
"Platzhalter um der Welt an einzelnen Seiten nicht mitzuteilen, dass Sie %s "
"verwenden:"
#: classes/footnotes_settings.php:503
#: classes/footnotes_settings.php:546
msgid "Allow footnotes on Summarized Posts:"
msgstr "Erlaube Fußnoten in Zusammenfassungen:"
#: classes/footnotes_settings.php:559
msgid "HowTo"
msgstr "Hilfe"
#: classes/footnotes_settings.php:506
#: classes/footnotes_settings.php:562
msgid "Brief introduction in how to use the plugin"
msgstr "Kurze Anleitung für die Verwendung des Plugins."
#: classes/footnotes_settings.php:532
#: classes/footnotes_settings.php:588
msgid "Start your footnote with the following shortcode:"
msgstr "Starten Sie eine Fußnote mit:"
#: classes/footnotes_settings.php:538
#: classes/footnotes_settings.php:594
msgid "...and end your footnote with this shortcode:"
msgstr "...und beenden Sie diese mit:"
#: classes/footnotes_settings.php:546 classes/footnotes_settings.php:549
#: classes/footnotes_settings.php:602 classes/footnotes_settings.php:605
msgid "example string"
msgstr "Beispieltext"
#: classes/footnotes_settings.php:547
#: classes/footnotes_settings.php:603
msgid "will be displayed as:"
msgstr "wird dargestellt als:"
#: classes/footnotes_settings.php:554
#: classes/footnotes_settings.php:610
#, php-format
msgid "If you have any questions, please don't hesitate to %se-mail%s us."
msgstr "Bei Fragen können Sie uns gerne eine %se-Mail%s senden."
#: classes/footnotes_widget.php:15 classes/footnotes_widget.php:25
msgid ""
"The widget defines the position of the reference container if set to "
"\"widget area\"."
msgstr ""
"Das Widget definiert die Position der Einzelnachweise wenn \"im Widget\" "
"eingestellt ist."
#: classes/footnotes_widget.php:17
#, php-format
msgid "%s Widget"
msgstr "%s Widget"
#: includes/plugin-settings.php:22
msgid "Settings"
msgstr "Einstellungen"
@ -172,7 +190,7 @@ msgstr "Einstellungen"
msgid "Support"
msgstr "Support"
#: includes/replacer.php:187
#: includes/replacer.php:160
#, php-format
msgid "Hey there, I'm using the awesome WordPress Plugin called %s"
msgstr "Diese Seite verwendet das %s Plugin"

Binary file not shown.

View file

@ -1,9 +1,9 @@
msgid ""
msgstr ""
"Project-Id-Version: footnotes\n"
"POT-Creation-Date: 2014-05-22 15:42+0100\n"
"PO-Revision-Date: 2014-05-22 15:42+0100\n"
"Last-Translator: SHE <s.herndler@methis.at>\n"
"POT-Creation-Date: 2014-05-24 14:35+0100\n"
"PO-Revision-Date: 2014-05-24 14:35+0100\n"
"Last-Translator: Stefan Herndler <support@herndler.org>\n"
"Language-Team: SHE <s.herndler@methis.at>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
@ -26,107 +26,108 @@ msgstr "You must be logged in to run this script."
msgid "You do not have permission to run this script."
msgstr "You do not have permission to run this script."
#: classes/footnotes_settings.php:381
#: classes/footnotes_settings.php:409
msgid "General"
msgstr "General"
#: classes/footnotes_settings.php:383
#: classes/footnotes_settings.php:411
#, php-format
msgid "%s Settings"
msgstr "%s Settings"
#: classes/footnotes_settings.php:384
#: classes/footnotes_settings.php:412
msgid "References Container"
msgstr "References Container"
#: classes/footnotes_settings.php:385
msgid "Footnotes styling"
msgstr "Footnotes styling"
#: classes/footnotes_settings.php:413
#, php-format
msgid "%s styling"
msgstr "%s styling"
#: classes/footnotes_settings.php:386
#: classes/footnotes_settings.php:415
msgid "Other"
msgstr "Other"
#: classes/footnotes_settings.php:406
#: classes/footnotes_settings.php:435
msgid "References label:"
msgstr "References label:"
#: classes/footnotes_settings.php:411
#: classes/footnotes_settings.php:440
msgid "Collapse references by default:"
msgstr "Collapse references by default:"
#: classes/footnotes_settings.php:420
#: classes/footnotes_settings.php:449
msgid "in the footer"
msgstr "in the footer"
#: classes/footnotes_settings.php:421
#: classes/footnotes_settings.php:450
msgid "at the end of the post"
msgstr "at the end of the post"
#: classes/footnotes_settings.php:422
#: classes/footnotes_settings.php:451
msgid "in the widget area"
msgstr "in the widget area"
#: classes/footnotes_settings.php:424
#: classes/footnotes_settings.php:453
msgid "Where shall the reference container appear:"
msgstr "Where shall the reference container appear:"
#: classes/footnotes_settings.php:436 classes/footnotes_settings.php:473
#: classes/footnotes_settings.php:482
#: classes/footnotes_settings.php:465 classes/footnotes_settings.php:522
#: classes/footnotes_settings.php:543
msgid "Yes"
msgstr "Yes"
#: classes/footnotes_settings.php:437 classes/footnotes_settings.php:474
#: classes/footnotes_settings.php:483
#: classes/footnotes_settings.php:466 classes/footnotes_settings.php:523
#: classes/footnotes_settings.php:544
msgid "No"
msgstr "No"
#: classes/footnotes_settings.php:439
#: classes/footnotes_settings.php:468
msgid "Combine identical footnotes:"
msgstr "Combine identical footnotes:"
#: classes/footnotes_settings.php:444
#: classes/footnotes_settings.php:478 classes/footnotes_settings.php:488
msgid "user defined"
msgstr "user defined"
#: classes/footnotes_settings.php:480
msgid "Footnote tag starts with:"
msgstr "Footnote tag starts with:"
#: classes/footnotes_settings.php:448
#: classes/footnotes_settings.php:490
msgid "and ends with:"
msgstr "and ends with:"
#: classes/footnotes_settings.php:455
#: classes/footnotes_settings.php:504
msgid "Arabic Numbers - Plain"
msgstr "Arabic Numbers - Plain"
#: classes/footnotes_settings.php:456
#: classes/footnotes_settings.php:505
msgid "Arabic Numbers - Leading 0"
msgstr "Arabic Numbers - Leading 0"
#: classes/footnotes_settings.php:457
#: classes/footnotes_settings.php:506
msgid "Latin Character - lower case"
msgstr "Latin Character - lower case"
#: classes/footnotes_settings.php:458
#: classes/footnotes_settings.php:507
msgid "Latin Character - upper case"
msgstr "Latin Character - upper case"
#: classes/footnotes_settings.php:459
#: classes/footnotes_settings.php:508
msgid "Roman Numerals"
msgstr "Roman Numerals"
#: classes/footnotes_settings.php:461
#: classes/footnotes_settings.php:510
msgid "Counter style:"
msgstr "Counter style:"
#: classes/footnotes_settings.php:476
msgid "Allow footnotes on Summarized Posts:"
msgstr "Allow footnotes on Summarized Posts:"
#: classes/footnotes_settings.php:485
#: classes/footnotes_settings.php:525
#, php-format
msgid "Tell the world you're using %s:"
msgstr "Tell the world you're using %s:"
#: classes/footnotes_settings.php:490
#: classes/footnotes_settings.php:530
#, php-format
msgid ""
"Don't tell the world you're using %s on specific pages by adding the "
@ -135,35 +136,52 @@ msgstr ""
"Don't tell the world you're using %s on specific pages by adding the "
"following short code:"
#: classes/footnotes_settings.php:503
#: classes/footnotes_settings.php:546
msgid "Allow footnotes on Summarized Posts:"
msgstr "Allow footnotes on Summarized Posts:"
#: classes/footnotes_settings.php:559
msgid "HowTo"
msgstr "HowTo"
#: classes/footnotes_settings.php:506
#: classes/footnotes_settings.php:562
msgid "Brief introduction in how to use the plugin"
msgstr "Brief introduction in how to use the plugin"
#: classes/footnotes_settings.php:532
#: classes/footnotes_settings.php:588
msgid "Start your footnote with the following shortcode:"
msgstr "Start your footnote with the following shortcode:"
#: classes/footnotes_settings.php:538
#: classes/footnotes_settings.php:594
msgid "...and end your footnote with this shortcode:"
msgstr "...and end your footnote with this shortcode:"
#: classes/footnotes_settings.php:546 classes/footnotes_settings.php:549
#: classes/footnotes_settings.php:602 classes/footnotes_settings.php:605
msgid "example string"
msgstr "example string"
#: classes/footnotes_settings.php:547
#: classes/footnotes_settings.php:603
msgid "will be displayed as:"
msgstr "will be displayed as:"
#: classes/footnotes_settings.php:554
#: classes/footnotes_settings.php:610
#, php-format
msgid "If you have any questions, please don't hesitate to %se-mail%s us."
msgstr "If you have any questions, please don't hesitate to %se-mail%s us."
#: classes/footnotes_widget.php:15 classes/footnotes_widget.php:25
msgid ""
"The widget defines the position of the reference container if set to "
"\"widget area\"."
msgstr ""
"The widget defines the position of the reference container if set to "
"\"widget area\"."
#: classes/footnotes_widget.php:17
#, php-format
msgid "%s Widget"
msgstr "%s Widget"
#: includes/plugin-settings.php:22
msgid "Settings"
msgstr "Settings"
@ -172,11 +190,29 @@ msgstr "Settings"
msgid "Support"
msgstr "Support"
#: includes/replacer.php:187
#: includes/replacer.php:160
#, php-format
msgid "Hey there, I'm using the awesome WordPress Plugin called %s"
msgstr "Hey there, I'm using the awesome %s Plugin"
#~ msgid "(("
#~ msgstr "(("
#~ msgid "<fn>"
#~ msgstr "<fn>"
#~ msgid "[ref]"
#~ msgstr "[ref]"
#~ msgid "))"
#~ msgstr "))"
#~ msgid "</fn>"
#~ msgstr "</fn>"
#~ msgid "[/ref]"
#~ msgstr "[/ref]"
#~ msgid "starts with:"
#~ msgstr "starts with:"

View file

@ -42,8 +42,10 @@ No, this Plugin has been written from scratch. Of course some inspirations on ho
= 1.1.2 =
- Update: Moved footnotes 'love' settings to a separate container
- Bugfix: Setting for the position of the "reference container" works for the options "footer" and "end of post"
- Bugfix: Setting for the position of the "reference container" works for the options "footer", "end of post" and "widget area"
- Add: Pre defined footnote short codes and possibility for a user defined short code
- Add: Plugin Widget to define where the reference container shall appear when set to "widget area"
- Update: Translation for new settings and for the Widget description
= 1.1.1 =
- Feature: Short code to not display the 'love me' slug on specific pages ( short code = [[no footnotes: love]] )