diff --git a/classes/footnotes.php b/classes/footnotes.php new file mode 100644 index 0000000..57ab322 --- /dev/null +++ b/classes/footnotes.php @@ -0,0 +1,105 @@ +a_obj_Settings = new Class_FootnotesSettings(); + } + + /* execute class function: init, admin_init and admin_menu */ + add_action( 'init', array( $this, 'init' ) ); + add_action( 'admin_init', array( $this, 'admin_init' ) ); + add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + + /* register hook for activating the plugin */ + register_activation_hook( __FILE__, array( $this, 'activate' ) ); + /* register hook for deactivating the plugin */ + register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) ); + /* register hook for uninstalling the plugin */ + register_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) ); + } + + /** + * activates the plugin + * @since 1.0 + */ + function activate() + { + // unused + } + + /** + * deactivates the plugin + * @since 1.0 + */ + function deactivate() + { + // unused + } + + /** + * uninstalls the plugin + * @since 1.0 + */ + function uninstall() + { + require_once( PLUGIN_DIR . '/includes/uninstall.php' ); + } + + /** + * initialize function + * called in the class constructor + * @since 1.0 + */ + function init() + { + // unused + } + + /** + * do admin init stuff + * called in the class constructor + * @since 1.0 + */ + function admin_init() + { + // unused + } + + /** + * do admin menu stuff + * called in the class constructor + * @since 1.0 + */ + function admin_menu() + { + // unused + } + +} /* class Class_Footnotes */ \ No newline at end of file diff --git a/classes/footnotes_settings.php b/classes/footnotes_settings.php new file mode 100644 index 0000000..32cc67c --- /dev/null +++ b/classes/footnotes_settings.php @@ -0,0 +1,411 @@ + 'yes', + FOOTNOTE_INPUTFIELD_REFERENCES_LABEL => 'References', + FOOTNOTE_INPUTFIELD_COLLAPSE_REFERENCES => '' + ); + /* + * resulting pagehook for adding a new sub menu page to the settings + * @since 1.0 + */ + var $a_str_Pagehook; + /* + * collection of settings values for this plugin + * @since 1.0 + */ + var $a_arr_Options; + /* + * collection of tabs for the settings page of this plugin + * @since 1.0 + */ + private $a_arr_SettingsTabs = array(); + + /** + * @constructor + * @since 1.0 + */ + function __construct() + { + /* validates the settings of the plugin and replaces them with the default settings if invalid */ + add_option( FOOTNOTE_SETTINGS_CONTAINER, self::$a_arr_Default_Settings ); + /* loads and filters the settings for this plugin */ + $this->a_arr_Options = footnotes_filter_options( FOOTNOTE_SETTINGS_CONTAINER ); + + /* execute class includes on action-even: init, admin_init and admin_menu */ + add_action( 'init', array( $this, 'LoadScriptsAndStylesheets' ) ); + add_action( 'admin_init', array( $this, 'RegisterSettings' ) ); + + add_action( 'admin_init', array( $this, 'RegisterTab_General' ) ); + add_action( 'admin_init', array( $this, 'RegisterTab_HowTo' ) ); + + add_action( 'admin_menu', array( $this, 'AddSettingsMenuPanel' ) ); + } + + /** + * initialize settings page, loads scripts and stylesheets needed for the layout + * called in class constructor @ init + * @since 1.0 + */ + function LoadScriptsAndStylesheets() + { + /* add the jQuery plugin (already registered by WP) */ + wp_enqueue_script( 'jquery' ); + /* register public stylesheet */ + wp_register_style( 'footnote_public_style', plugins_url( '../css/footnote.css', __FILE__ ) ); + /* add public stylesheet */ + wp_enqueue_style( 'footnote_public_style' ); + /* register settings stylesheet */ + wp_register_style( 'footnote_settings_style', plugins_url( '../css/settings.css', __FILE__ ) ); + /* add settings stylesheet */ + wp_enqueue_style( 'footnote_settings_style' ); + } + + /** + * register the settings field in the database for the "save" function + * called in class constructor @ admin_init + * @since 1.0 + */ + function RegisterSettings() + { + register_setting( FOOTNOTE_SETTINGS_LABEL_GENERAL, FOOTNOTE_SETTINGS_CONTAINER ); + } + + /** + * sets the plugin's title for the admins settings menu + * called in class constructor @ admin_menu + * @since 1.0 + */ + function AddSettingsMenuPanel() + { + /* current user needs the permission to update plugins for further access */ + if ( !current_user_can( 'update_plugins' ) ) { + return; + } + /* submenu page title */ + $l_str_PageTitle = 'footnotes'; + /* submenu title */ + $l_str_MenuTitle = 'footnotes'; + /* Add a new submenu to the standard Settings panel */ + $this->a_str_Pagehook = add_options_page( $l_str_PageTitle, $l_str_MenuTitle, 'administrator', FOOTNOTES_SETTINGS_PAGE_ID, array( $this, 'OutputSettingsPage' ) ); + } + + /** + * Plugin Options page rendering goes here, checks + * for active tab and replaces key with the related + * settings key. Uses the plugin_options_tabs method + * to render the tabs. + * @since 1.0 + */ + function OutputSettingsPage() + { + /* gets active tag, or if nothing set the "general" tab will be set to active */ + $l_str_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : FOOTNOTE_SETTINGS_LABEL_GENERAL; + /* outputs all tabs */ + echo '
'; + $this->OutputSettingsPageTabs(); + /* outputs a form with the content of the current active tab */ + echo '
'; + wp_nonce_field( 'update-options' ); + settings_fields( $l_str_tab ); + /* outputs the settings field of the current active tab */ + do_settings_sections( $l_str_tab ); + /* adds a submit button to the current page */ + submit_button(); + echo '
'; + echo '
'; + } + + /** + * Renders our tabs in the plugin options page, + * walks through the object's tabs array and prints + * them one by one. Provides the heading for the + * plugin_options_page method. + * @since 1.0 + */ + function OutputSettingsPageTabs() + { + /* gets active tag, or if nothing set the "general" tab will be set to active */ + $l_str_CurrentTab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : FOOTNOTE_SETTINGS_LABEL_GENERAL; + screen_icon(); + echo ''; + } + + /** + * loads specific setting and returns an array with the keys [id, name, value] + * @since 1.0 + * @param $p_str_FieldID + * @return array + */ + protected function LoadSetting( $p_str_FieldID ) + { + $p_arr_Return = array(); + $p_arr_Return[ "id" ] = $this->getFieldID( $p_str_FieldID ); + $p_arr_Return[ "name" ] = $this->getFieldName( $p_str_FieldID ); + $p_arr_Return[ "value" ] = esc_attr( $this->getFieldValue( $p_str_FieldID ) ); + return $p_arr_Return; + } + + /** + * access settings field by name + * @since 1.0 + * @param string $p_str_FieldName + * @return string + */ + protected function getFieldName( $p_str_FieldName ) + { + return sprintf( '%s[%s]', FOOTNOTE_SETTINGS_CONTAINER, $p_str_FieldName ); + //return sprintf( '%s', $p_str_FieldName ); + } + + /** + * access settings field by id + * @since 1.0 + * @param string $p_str_FieldID + * @return string + */ + protected function getFieldID( $p_str_FieldID ) + { + return sprintf( '%s[%s]', FOOTNOTE_SETTINGS_CONTAINER, $p_str_FieldID ); + //return sprintf( '%s', $p_str_FieldID ); + } + + /** + * get settings field value + * @since 1.0 + * @param string $p_str_Key + * @return string + */ + protected function getFieldValue( $p_str_Key ) + { + return $this->a_arr_Options[ $p_str_Key ]; + } + + /** + * outputs a input type=text + * @param string $p_str_SettingsID [id of the settings field] + * @param string $p_str_ClassName [css class name] + * @since 1.0-beta + */ + function AddTextbox($p_str_SettingsID, $p_str_ClassName="") + { + /* collect data for given settings field */ + $l_arr_Data = $this->LoadSetting( $p_str_SettingsID ); + + /* if input shall have a css class, add the style tag for it */ + if (!empty($p_str_ClassName)) { + $p_str_ClassName = 'class="' . $p_str_ClassName . '"'; + } + + /* outputs an input field type TEXT */ + echo ''; + } + + /** + * outputs a input type=checkbox + * @param string $p_str_SettingsID [id of the settings field] + * @param string $p_str_ClassName [optional css class name] + * @since 1.0-beta + */ + function AddCheckbox($p_str_SettingsID, $p_str_ClassName="") + { + /* collect data for given settings field */ + $l_arr_Data = $this->LoadSetting( $p_str_SettingsID ); + + /* if input shall have a css class, add the style tag for it */ + if (!empty($p_str_ClassName)) { + $p_str_ClassName = 'class="' . $p_str_ClassName . '"'; + } + + /* lookup if the checkbox shall be pre-checked */ + $l_str_Checked = ""; + if (footnotes_ConvertToBool($l_arr_Data["value"])) { + $l_str_Checked = 'checked="checked"'; + } + + /* outputs an input field type CHECKBOX */ + echo sprintf('', $l_str_Checked); + } + + /** + * outputs a select box + * @param string $p_str_SettingsID [id of the settings field] + * @param array $p_arr_Options [array with options] + * @param string $p_str_ClassName [optional css class name] + * @since 1.0-beta + */ + function AddSelectbox($p_str_SettingsID, $p_arr_Options, $p_str_ClassName="") + { + /* collect data for given settings field */ + $l_arr_Data = $this->LoadSetting( $p_str_SettingsID ); + + /* if input shall have a css class, add the style tag for it */ + if (!empty($p_str_ClassName)) { + $p_str_ClassName = 'class="' . $p_str_ClassName . '"'; + } + + /* select starting tag */ + $l_str_Output = ''; + /* outputs the SELECT field */ + echo $l_str_Output; + } + + /** + * initialize general settings tab + * called in class constructor @ admin_init + * @since 1.0 + */ + function RegisterTab_General() + { + $l_str_SectionName = "Footnote_Secion_Settings_General"; + /* add tab to the tab array */ + $this->a_arr_SettingsTabs[ FOOTNOTE_SETTINGS_LABEL_GENERAL ] = __( "General", FOOTNOTES_PLUGIN_NAME ); + /* register settings tab */ + add_settings_section( $l_str_SectionName, __( "Settings", FOOTNOTES_PLUGIN_NAME ), array( $this, 'RegisterTab_General_Description' ), FOOTNOTE_SETTINGS_LABEL_GENERAL ); + add_settings_field( 'Register_References_Label', __( "References label:", FOOTNOTES_PLUGIN_NAME ), array( $this, 'Register_References_Label' ), FOOTNOTE_SETTINGS_LABEL_GENERAL, $l_str_SectionName ); + add_settings_field( 'Register_Collapse_References', __( "Collapse references by default:", FOOTNOTES_PLUGIN_NAME ), array( $this, 'Register_Collapse_References' ), FOOTNOTE_SETTINGS_LABEL_GENERAL, $l_str_SectionName ); + add_settings_field( 'Register_Combine_Identical', __( "Combine identical footnotes:", FOOTNOTES_PLUGIN_NAME ), array( $this, 'Register_Combine_Identical' ), FOOTNOTE_SETTINGS_LABEL_GENERAL, $l_str_SectionName ); + } + + /** + * adds a desciption to the general settings tab + * called in RegisterTab_General + * @since 1.0 + */ + function RegisterTab_General_Description() + { + // unused description + } + + /** + * outputs the settings field for the "references label" + * @since 1.0 + */ + function Register_References_Label() + { + /* add a textbox to the output */ + $this->AddTextbox(FOOTNOTE_INPUTFIELD_REFERENCES_LABEL, "footnote_plugin_50"); + } + + /** + * outputs the settings field for the "references label" + * @since 1.0-beta + */ + function Register_Collapse_References() + { + /* add a checkbox to the output */ + $this->AddCheckbox(FOOTNOTE_INPUTFIELD_COLLAPSE_REFERENCES); + } + + /** + * outputs the settings field for the "combine identical footnotes" + * @since 1.0 + */ + function Register_Combine_Identical() + { + /* get array with option elements */ + $l_arr_Options = array( + "yes" => __( "Yes", FOOTNOTES_PLUGIN_NAME ), + "no" => __( "No", FOOTNOTES_PLUGIN_NAME ) + ); + /* add a select box to the output */ + $this->AddSelectbox(FOOTNOTE_INPUTFIELD_COMBINE_IDENTICAL, $l_arr_Options, "footnote_plugin_25"); + } + + /** + * initialize howto settings tab + * called in class constructor @ admin_init + * @since 1.0 + */ + function RegisterTab_HowTo() + { + $l_str_SectionName = "Footnote_Secion_Settings_Howto"; + /* add tab to the tab array */ + $this->a_arr_SettingsTabs[ FOOTNOTE_SETTINGS_LABEL_HOWTO ] = __( "HowTo", FOOTNOTES_PLUGIN_NAME ); + /* register settings tab */ + add_settings_section( $l_str_SectionName, __( "HowTo", FOOTNOTES_PLUGIN_NAME ), array( $this, 'RegisterTab_HowTo_Description' ), FOOTNOTE_SETTINGS_LABEL_HOWTO ); + add_settings_field( 'Register_Howto_Box', "", array( $this, 'Register_Howto_Box' ), FOOTNOTE_SETTINGS_LABEL_HOWTO, $l_str_SectionName ); + } + + /** + * adds a descrption to the HowTo settings tab + * called int RegisterTab_HowTo + * @since 1.0 + */ + function RegisterTab_HowTo_Description() + { + echo __( "This is a brief introduction in how to use the plugin.", FOOTNOTES_PLUGIN_NAME ); + } + + /** + * outputs the content of the HowTo settings tab + * @since 1.0 + */ + function Register_Howto_Box() + { + ?> +
+
+

+ + +

+ +

+ + +

+ +
+

+ + +      + +

+
+ +

+ ', '' ); ?> +

+
+
+ p > span { padding-left: 20px !important; text-align: left !important; + cursor: pointer; +} + +.footnote_hide_box { + display:none; } /* container for the footnote in the bottom */ diff --git a/css/settings.css b/css/settings.css index a2d2710..e7005f8 100755 --- a/css/settings.css +++ b/css/settings.css @@ -3,15 +3,17 @@ * User: Stefan * Date: 15.05.14 * Time: 16:21 - * Version: 1.0 + * Version: 1.0-beta * Since: 1.0 */ /* overwrite some styling for inputs [type=text] and select-boxes */ -input[type=text], select { +input[type=text], input[type=checkbox], input[type=password], textarea, select { + margin-left: 12px !important; +} +input[type=text], input[type=password], textarea, select { padding-left: 8px !important; padding-right: 8px !important; - margin-left: 12px !important; } /* overwrite link layout on the settings page */ diff --git a/includes/defines.php b/includes/defines.php index 71d0d23..6ce803d 100644 --- a/includes/defines.php +++ b/includes/defines.php @@ -4,7 +4,7 @@ * User: Stefan * Date: 15.05.14 * Time: 16:21 - * Version: 1.0 + * Version: 1.0-beta * Since: 1.0 */ @@ -22,11 +22,15 @@ define( "FOOTNOTE_SETTINGS_LABEL_HOWTO", "footnotes_howto" ); /* internal label /* PLUGIN SETTINGS INPUT FIELDS */ define( "FOOTNOTE_INPUTFIELD_COMBINE_IDENTICAL", "footnote_inputfield_combine_identical" ); /* id of input field for the combine identical setting */ define( "FOOTNOTE_INPUTFIELD_REFERENCES_LABEL", "footnote_inputfield_references_label" ); /* id of input field for the references label setting */ +define( "FOOTNOTE_INPUTFIELD_COLLAPSE_REFERENCES", "footnote_inputfield_collapse_references" ); /* id of input field for the "collapse references" setting */ /* PLUGIN DEFAULT PLACEHOLDER */ define( "FOOTNOTE_PLACEHOLDER_START", "((" ); /* defines the default start tag for the placeholder */ define( "FOOTNOTE_PLACEHOLDER_END", "))" ); /* defines the default end tag for the placeholder */ +/* PLUGIN REFERENCES CONTAINER ID */ +define( "FOOTNOTE_REFERENCES_CONTAINER_ID", "footnote_references_container" ); /* id for the div surrounding the footnotes */ + /* PLUGIN DIRECTORIES */ define( "FOOTNOTES_PLUGIN_DIR_NAME", "footnotes" ); define( "FOOTNOTES_LANGUAGE_DIR", dirname( __FILE__ ) . "/../languages/" ); diff --git a/includes/plugin-settings.php b/includes/plugin-settings.php index 0276bb5..43625ec 100644 --- a/includes/plugin-settings.php +++ b/includes/plugin-settings.php @@ -4,7 +4,7 @@ * User: Stefan * Date: 15.05.14 * Time: 16:21 - * Version: 1.0 + * Version: 1.0-beta * Since: 1.0 */ @@ -33,7 +33,7 @@ function footnotes_plugin_settings_link( $links, $file ) * @param string $p_str_OptionsField * @return array */ -function footnote_filter_options( $p_str_OptionsField ) +function footnotes_filter_options( $p_str_OptionsField ) { $l_arr_Options = get_option( $p_str_OptionsField ); /* loop through all keys in the array and filters them */ @@ -42,4 +42,26 @@ function footnote_filter_options( $p_str_OptionsField ) } /* returns the filtered array */ return $l_arr_Options; +} + +/** + * converts a string depending on its value to a boolean + * @since 1.0-beta + * @param string $p_str_Value + * @return bool + */ +function footnotes_ConvertToBool($p_str_Value) { + /* convert string to lower-case to make it easier */ + $p_str_Value = strtolower($p_str_Value); + /* check if string seems to contain a "true" value */ + switch($p_str_Value) { + case "checked": + case "yes": + case "true": + case "on": + case "1": + return true; + } + /* nothing found that says "true", so we return false */ + return false; } \ No newline at end of file diff --git a/includes/replacer.php b/includes/replacer.php index a06fe1e..c2230e2 100644 --- a/includes/replacer.php +++ b/includes/replacer.php @@ -14,6 +14,12 @@ */ $g_arr_Footnotes = array(); +/* + * collection of all footnotes settings + * @since 1.0-beta + */ +$g_arr_FootnotesSettings = array(); + /** * starts listening for footnotes to be replaced * output will be buffered and not displayed @@ -23,7 +29,13 @@ $g_arr_Footnotes = array(); */ function footnotes_startReplacing( $p_str_Content ) { + /* access to the global settings collection */ + global $g_arr_FootnotesSettings; + /* stop the output and move it to a buffer instead, defines a callback function */ ob_start( "footnotes_replaceFootnotes" ); + /* load footnote settings */ + $g_arr_FootnotesSettings = footnotes_filter_options( FOOTNOTE_SETTINGS_CONTAINER ); + /* return unchanged content */ return $p_str_Content; } @@ -35,6 +47,7 @@ function footnotes_startReplacing( $p_str_Content ) */ function footnotes_DummyReplacing( $p_str_Content ) { + /* return unchanged content */ return $p_str_Content; } @@ -45,6 +58,7 @@ function footnotes_DummyReplacing( $p_str_Content ) */ function footnotes_StopReplacing() { + /* calls the callback function defined in ob_start(); */ ob_end_flush(); } @@ -130,6 +144,9 @@ function footnotes_getFromString( $p_str_Content ) } /** + * looks through all footnotes that has been replaced in the current content and + * adds a reference to the footnote at the end of the content + * function to collapse the reference container since 1.0-beta * @since 1.0 * @return string */ @@ -137,6 +154,8 @@ function footnotes_OutputReferenceContainer() { /* get access to the global array to read footnotes */ global $g_arr_Footnotes; + /* access to the global settings collection */ + global $g_arr_FootnotesSettings; /* no footnotes has been replaced on this page */ if ( empty( $g_arr_Footnotes ) ) { @@ -144,20 +163,22 @@ function footnotes_OutputReferenceContainer() return ""; } - /* read settings */ - $l_arr_Options = footnote_filter_options( FOOTNOTE_SETTINGS_CONTAINER ); - /* get setting for combine identical footnotes */ - $l_str_CombineIdentical = $l_arr_Options[ FOOTNOTE_INPUTFIELD_COMBINE_IDENTICAL ]; + /* get setting for combine identical footnotes and convert it to boolean */ + $l_bool_CombineIdentical = footnotes_ConvertToBool($g_arr_FootnotesSettings[ FOOTNOTE_INPUTFIELD_COMBINE_IDENTICAL ]); /* get setting for preferences label */ - $l_str_ReferencesLabel = $l_arr_Options[ FOOTNOTE_INPUTFIELD_REFERENCES_LABEL ]; - /* convert it from string to boolean */ - $l_bool_CombineIdentical = false; - if ( $l_str_CombineIdentical == "yes" ) { - $l_bool_CombineIdentical = true; - } + $l_str_ReferencesLabel = $g_arr_FootnotesSettings[ FOOTNOTE_INPUTFIELD_REFERENCES_LABEL ]; + /* get setting for collapse reference footnotes and convert it to boolean */ + $l_bool_CollapseReference = footnotes_ConvertToBool($g_arr_FootnotesSettings[ FOOTNOTE_INPUTFIELD_COLLAPSE_REFERENCES ]); - /* output string */ - $l_str_Output = '

' . $l_str_ReferencesLabel . '

'; + /* output string, prepare it with the reference label as headline */ + $l_str_Output = '

' . $l_str_ReferencesLabel . '

'; + /* add a box around the footnotes */ + $l_str_Output .= '
'; + /* add a javascript to expand the reference container when clicking on a footnote or the reference label */ + $l_str_Output .= ' + + '; + /* return the output string */ return $l_str_Output; } \ No newline at end of file diff --git a/includes/scripts.php b/includes/scripts.php index f329b5a..a5ace51 100644 --- a/includes/scripts.php +++ b/includes/scripts.php @@ -16,9 +16,9 @@ function footnotes_add_public_stylesheet() { /* register public stylesheet */ - wp_register_style( 'footnote_public_style', plugins_url( '../css/footnote.css', __FILE__ ) ); + wp_register_style( 'footnotes_public_style', plugins_url( '../css/footnote.css', __FILE__ ) ); /* add public stylesheet */ - wp_enqueue_style( 'footnote_public_style' ); + wp_enqueue_style( 'footnotes_public_style' ); } /** @@ -28,7 +28,7 @@ function footnotes_add_public_stylesheet() function footnotes_add_settings_stylesheet() { /* register settings stylesheet */ - wp_register_style( 'footnote_settings_style', plugins_url( '../css/settings.css', __FILE__ ) ); + wp_register_style( 'footnotes_settings_style', plugins_url( '../css/settings.css', __FILE__ ) ); /* add settings stylesheet */ - wp_enqueue_style( 'footnote_settings_style' ); + wp_enqueue_style( 'footnotes_settings_style' ); } \ No newline at end of file diff --git a/index.php b/index.php index ae8c009..33daf4a 100755 --- a/index.php +++ b/index.php @@ -4,13 +4,13 @@ Plugin URI: http://www.herndler.org Description: simple adding footnotes to your pages Author: Mark Cheret, Stefan Herndler - Version: 1.0.1 + Version: 1.0.2 Author URI: http://www.cheret.de Text Domain: footnotes Domain Path: /languages */ /* - Copyright 2014 Mark Cheret, Stefan Herndler (email : mark@cheret.de | admin@herndler.org) + Copyright 2014 Mark Cheret, Stefan Herndler (email : mark@cheret.de | support@herndler.org) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as @@ -69,9 +69,9 @@ if ( !function_exists( 'is_admin' ) ) { } /* require plugin class */ -require_once( dirname( __FILE__ ) . "/classes/footnote.php" ); +require_once( dirname( __FILE__ ) . "/classes/footnotes.php" ); /* require plugin settings class */ -require_once( dirname( __FILE__ ) . "/classes/footnote_settings.php" ); +require_once( dirname( __FILE__ ) . "/classes/footnotes_settings.php" ); /* action to locate language and load the wordpress-specific language file */ add_action( 'plugins_loaded', 'footnotes_load_language' ); diff --git a/languages/footnotes-de.mo b/languages/footnotes-de.mo index 8126bec..3ef8d1d 100755 Binary files a/languages/footnotes-de.mo and b/languages/footnotes-de.mo differ diff --git a/languages/footnotes-de.po b/languages/footnotes-de.po index c465667..6dba5bd 100755 --- a/languages/footnotes-de.po +++ b/languages/footnotes-de.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: footnotes\n" -"POT-Creation-Date: 2014-05-16 20:06+0100\n" -"PO-Revision-Date: 2014-05-16 20:07+0100\n" +"POT-Creation-Date: 2014-05-16 21:52+0100\n" +"PO-Revision-Date: 2014-05-16 21:53+0100\n" "Last-Translator: SHE \n" "Language-Team: SHE \n" "Language: de\n" @@ -18,55 +18,59 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SearchPath-0: .\n" -#: classes/footnote_settings.php:213 +#: classes/footnotes_settings.php:298 msgid "General" msgstr "Allgemein" -#: classes/footnote_settings.php:215 includes/plugin-settings.php:22 +#: classes/footnotes_settings.php:300 includes/plugin-settings.php:22 msgid "Settings" msgstr "Einstellungen" -#: classes/footnote_settings.php:216 +#: classes/footnotes_settings.php:301 msgid "References label:" msgstr "Überschrift \"Einzelnachweis\":" -#: classes/footnote_settings.php:217 +#: classes/footnotes_settings.php:302 +msgid "Collapse references by default:" +msgstr "Verstecke Einzelnachweise standardmäßig:" + +#: classes/footnotes_settings.php:303 msgid "Combine identical footnotes:" msgstr "Kombiniere meine Fußnoten:" -#: classes/footnote_settings.php:260 +#: classes/footnotes_settings.php:344 msgid "Yes" msgstr "Ja" -#: classes/footnote_settings.php:261 +#: classes/footnotes_settings.php:345 msgid "No" msgstr "Nein" -#: classes/footnote_settings.php:282 classes/footnote_settings.php:284 +#: classes/footnotes_settings.php:360 classes/footnotes_settings.php:362 msgid "HowTo" msgstr "Hilfe" -#: classes/footnote_settings.php:295 +#: classes/footnotes_settings.php:373 msgid "This is a brief introduction in how to use the plugin." msgstr "Eine kurze Anleitung für die Verwendung des Plugins." -#: classes/footnote_settings.php:308 +#: classes/footnotes_settings.php:386 msgid "Start your footnote with the following shortcode:" msgstr "Starten Sie eine Fußnote mit:" -#: classes/footnote_settings.php:313 +#: classes/footnotes_settings.php:391 msgid "...and end your footnote with this shortcode:" msgstr "...und beenden Sie diese mit:" -#: classes/footnote_settings.php:320 classes/footnote_settings.php:323 +#: classes/footnotes_settings.php:397 classes/footnotes_settings.php:400 msgid "example string" msgstr "Beispieltext" -#: classes/footnote_settings.php:321 +#: classes/footnotes_settings.php:398 msgid "will be displayed as:" msgstr "wird dargestellt als:" -#: classes/footnote_settings.php:329 +#: classes/footnotes_settings.php:405 #, php-format msgid "If you have any questions, please don't hesitate to %smail us%s." msgstr "Bei Fragen können Sie uns gerne eine %se-Mail%s senden." diff --git a/languages/footnotes-en.mo b/languages/footnotes-en.mo index 255593c..df8504a 100755 Binary files a/languages/footnotes-en.mo and b/languages/footnotes-en.mo differ diff --git a/languages/footnotes-en.po b/languages/footnotes-en.po index f7c4529..d31da85 100755 --- a/languages/footnotes-en.po +++ b/languages/footnotes-en.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: footnotes\n" -"POT-Creation-Date: 2014-05-16 20:06+0100\n" -"PO-Revision-Date: 2014-05-16 20:06+0100\n" +"POT-Creation-Date: 2014-05-16 21:52+0100\n" +"PO-Revision-Date: 2014-05-16 21:52+0100\n" "Last-Translator: SHE \n" "Language-Team: SHE \n" "Language: en\n" @@ -18,55 +18,59 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SearchPath-0: .\n" -#: classes/footnote_settings.php:213 +#: classes/footnotes_settings.php:298 msgid "General" msgstr "General" -#: classes/footnote_settings.php:215 includes/plugin-settings.php:22 +#: classes/footnotes_settings.php:300 includes/plugin-settings.php:22 msgid "Settings" msgstr "Settings" -#: classes/footnote_settings.php:216 +#: classes/footnotes_settings.php:301 msgid "References label:" msgstr "References label:" -#: classes/footnote_settings.php:217 +#: classes/footnotes_settings.php:302 +msgid "Collapse references by default:" +msgstr "Collapse references by default:" + +#: classes/footnotes_settings.php:303 msgid "Combine identical footnotes:" msgstr "Combine identical footnotes:" -#: classes/footnote_settings.php:260 +#: classes/footnotes_settings.php:344 msgid "Yes" msgstr "Yes" -#: classes/footnote_settings.php:261 +#: classes/footnotes_settings.php:345 msgid "No" msgstr "No" -#: classes/footnote_settings.php:282 classes/footnote_settings.php:284 +#: classes/footnotes_settings.php:360 classes/footnotes_settings.php:362 msgid "HowTo" msgstr "HowTo" -#: classes/footnote_settings.php:295 +#: classes/footnotes_settings.php:373 msgid "This is a brief introduction in how to use the plugin." msgstr "This is a brief introduction in how to use the plugin." -#: classes/footnote_settings.php:308 +#: classes/footnotes_settings.php:386 msgid "Start your footnote with the following shortcode:" msgstr "Start your footnote with the following shortcode:" -#: classes/footnote_settings.php:313 +#: classes/footnotes_settings.php:391 msgid "...and end your footnote with this shortcode:" msgstr "...and end your footnote with this shortcode:" -#: classes/footnote_settings.php:320 classes/footnote_settings.php:323 +#: classes/footnotes_settings.php:397 classes/footnotes_settings.php:400 msgid "example string" msgstr "example string" -#: classes/footnote_settings.php:321 +#: classes/footnotes_settings.php:398 msgid "will be displayed as:" msgstr "will be displayed as:" -#: classes/footnote_settings.php:329 +#: classes/footnotes_settings.php:405 #, php-format msgid "If you have any questions, please don't hesitate to %smail us%s." msgstr "If you have any questions, please don't hesitate to %smail us%s." diff --git a/readme.txt b/readme.txt index d1fcb10..1f963d2 100755 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Requires at least: 3.9 Tested up to: 3.9.1 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html -Stable Tag: 1.0.1 +Stable tag: 1.0.2 == Description == @@ -35,6 +35,12 @@ coming soon == Changelog == += 1.0.2 = +* New setting to collapse the reference container by default +* Added link behind the footnotes to automatically jump to the reference container +* New function to easy output input fields for the settings page +* Updated translation for the new setting + = 1.0.1 = * Separated functions in different files for a better overview * Added a version control to each file / class / function / variable diff --git a/templates/container.html b/templates/container.html index 142b198..117fde5 100755 --- a/templates/container.html +++ b/templates/container.html @@ -3,7 +3,7 @@ [[FOOTNOTE INDEX]].
- +   diff --git a/templates/footnote.html b/templates/footnote.html index fe6afad..b7cf915 100755 --- a/templates/footnote.html +++ b/templates/footnote.html @@ -1,5 +1,5 @@ - + [[FOOTNOTE INDEX]]) [[FOOTNOTE TEXT]]