diff --git a/class/dashboard/init.php b/class/dashboard/init.php
index 5c8678e..7b6016a 100644
--- a/class/dashboard/init.php
+++ b/class/dashboard/init.php
@@ -247,11 +247,11 @@ class MCI_Footnotes_Layout_Init {
"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_NumRatings >= 0.5 ? "star-full" : "star-empty",
- "PluginRating2" => $l_int_NumRatings >= 1.5 ? "star-full" : "star-empty",
- "PluginRating3" => $l_int_NumRatings >= 2.5 ? "star-full" : "star-empty",
- "PluginRating4" => $l_int_NumRatings >= 3.5 ? "star-full" : "star-empty",
- "PluginRating5" => $l_int_NumRatings >= 4.5 ? "star-full" : "star-empty",
+ "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",
+ "PluginRating4" => $l_int_Stars >= 3.5 ? "star-full" : "star-empty",
+ "PluginRating5" => $l_int_Stars >= 4.5 ? "star-full" : "star-empty",
"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"] : "---"
diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php
index ce9aaf7..4c925c2 100644
--- a/class/dashboard/layout.php
+++ b/class/dashboard/layout.php
@@ -189,8 +189,6 @@ abstract class MCI_Footnotes_LayoutEngine {
* @since 1.5.0
*/
private function appendScripts() {
- // add jQuery to the sub menu page
- wp_enqueue_script('jquery');
// enable meta boxes layout and close functionality
wp_enqueue_script('postbox');
// add WordPress color picker layout
diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php
index e6e9305..77f11a6 100644
--- a/class/dashboard/subpage-main.php
+++ b/class/dashboard/subpage-main.php
@@ -290,6 +290,17 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"no" => __("No", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
);
+ // options for the Mouse-over box position
+ $l_arr_Position = array(
+ "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)
+ );
// load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "customize-mouse-over-box");
// replace all placeholders
@@ -304,7 +315,18 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-excerpt-length" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, __("Maximum characters for the excerpt", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"excerpt-length" => $this->addTextBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH),
- "label-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __("Color", 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, __("Offset X (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ "offset-x" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -50, 50),
+ "notice-offset-x" => __("Offset (X axis) in px (may be negative)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+
+ "label-offset-y" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, __("Offset Y (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ "offset-y" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, -50, 50),
+ "notice-offset-y" => __("Offset (Y axis) in px (may be negative)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+
+ "label-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __("Color", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"color" => $this->addColorSelection(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR),
"notice-color" => __("Empty color will use the default color defined by your current theme.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
@@ -326,8 +348,13 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-max-width" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, __("Max. width (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"max-width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, 0, 1280),
- "notice-max-width" => __("Set the max-width to 0px to disable this setting.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
- )
+ "notice-max-width" => __("Set the max-width to 0px to disable this setting.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+
+ "label-box-shadow-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR, __("Box shadow color", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
+ "box-shadow-color" => $this->addColorSelection(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR),
+ "notice-box-shadow-color" => __("Empty color will use the default box shadow defined by your current theme.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+
+ )
);
// display template with replaced placeholders
echo $l_obj_Template->getContent();
@@ -476,6 +503,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"information" => sprintf(__("For further information please check out our %ssupport forum%s on WordPress.org.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '')
)
);
+ // call wp_head function to get the Styling of the mouse-over box
+ $g_obj_MCI_Footnotes->a_obj_Task->wp_head();
// display template with replaced placeholders
echo $l_obj_Template->getContent();
}
diff --git a/class/hooks.php b/class/hooks.php
index 841c9e5..08aa338 100644
--- a/class/hooks.php
+++ b/class/hooks.php
@@ -22,9 +22,9 @@ class MCI_Footnotes_Hooks {
* @since 1.5.0
*/
public static function registerHooks() {
- register_activation_hook(dirname(__FILE__) . "/../index.php", array("MCI_Footnotes_Hooks", "activatePlugin"));
- register_deactivation_hook(dirname(__FILE__) . "/../index.php", array("MCI_Footnotes_Hooks", "deactivatePlugin"));
- register_uninstall_hook(dirname(__FILE__) . "/../index.php", array("MCI_Footnotes_Hooks", "uninstallPlugin"));
+ 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"));
}
/**
diff --git a/class/init.php b/class/init.php
index f42ee5f..7b83541 100644
--- a/class/init.php
+++ b/class/init.php
@@ -45,14 +45,10 @@ class MCI_Footnotes {
// initialize the Plugin Task
$this->initializeTask();
- // Register all Public Stylesheets
- add_action('init', array($this, 'registerPublicStyling'));
- // Register all Public Scripts
- add_action('init', array($this, 'registerPublicScripts'));
- // Enqueue all Public Stylesheets
- add_action('wp_enqueue_scripts', array($this, 'registerPublicStyling'));
- // Enqueue all Public Scripts
- add_action('wp_enqueue_scripts', array($this, 'registerPublicScripts'));
+ // Register all Public Stylesheets and Scripts
+ add_action('init', array($this, 'registerPublic'));
+ // Enqueue all Public Stylesheets and Scripts
+ add_action('wp_enqueue_scripts', array($this, 'registerPublic'));
}
/**
@@ -87,25 +83,15 @@ class MCI_Footnotes {
}
/**
- * Registers and enqueue scripts to the public pages.
+ * Registers and enqueue scripts and stylesheets to the public pages.
*
* @author Stefan Herndler
* @since 1.5.0
*/
- public function registerPublicScripts() {
+ public function registerPublic() {
+ wp_enqueue_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__));
// add the jQuery plugin (already registered by WordPress)
wp_enqueue_script('jquery');
- wp_enqueue_script('mci_footnotes_js_jquery_tools', plugins_url('../js/jquery.tools.min.js', __FILE__), array());
- }
-
- /**
- * Registers and enqueue stylesheets to the public pages.
- *
- * @author Stefan Herndler
- * @since 1.5.0
- */
- public function registerPublicStyling() {
- wp_register_style('mci_footnotes_css_public', plugins_url('../css/public.css', __FILE__));
- wp_enqueue_style('mci_footnotes_css_public');
+ wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__));
}
}
\ No newline at end of file
diff --git a/class/settings.php b/class/settings.php
index 7a61524..fa984d3 100644
--- a/class/settings.php
+++ b/class/settings.php
@@ -171,6 +171,33 @@ class MCI_Footnotes_Settings {
*/
const C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH = "footnote_inputfield_custom_mouse_over_box_excerpt_length";
+ /**
+ * Settings Container Key for the mouse-over box to define the positioning.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.7
+ * @var string
+ */
+ const C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION = "footnote_inputfield_custom_mouse_over_box_position";
+
+ /**
+ * Settings Container Key for the mouse-over box to define the offset (x).
+ *
+ * @author Stefan Herndler
+ * @since 1.5.7
+ * @var string
+ */
+ const C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X = "footnote_inputfield_custom_mouse_over_box_offset_x";
+
+ /**
+ * Settings Container Key for the mouse-over box to define the offset (y).
+ *
+ * @author Stefan Herndler
+ * @since 1.5.7
+ * @var string
+ */
+ const C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y = "footnote_inputfield_custom_mouse_over_box_offset_y";
+
/**
* Settings Container Key for the mouse-over box to define the color.
*
@@ -225,6 +252,15 @@ class MCI_Footnotes_Settings {
*/
const C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH = "footnote_inputfield_custom_mouse_over_box_max_width";
+ /**
+ * Settings Container Key for the mouse-over box to define the box-shadow color.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.8
+ * @var string
+ */
+ const C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR = "footnote_inputfield_custom_mouse_over_box_shadow_color";
+
/**
* Settings Container Key for the Hyperlink arrow.
*
@@ -352,12 +388,16 @@ class MCI_Footnotes_Settings {
self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED => 'yes',
self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED => 'no',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 150,
+ self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION => 'top right',
+ self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X => 10,
+ self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y => 10,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR => '',
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND => '#fff7a7',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH => 1,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR => '#cccc99',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS => 3,
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH => 0,
+ self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR => '#666666',
self::C_STR_HYPERLINK_ARROW => '↑',
self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '',
self::C_STR_CUSTOM_CSS => ''
diff --git a/class/task.php b/class/task.php
index c9ad80b..589d396 100644
--- a/class/task.php
+++ b/class/task.php
@@ -34,6 +34,15 @@ class MCI_Footnotes_Task {
*/
public static $a_bool_AllowLoveMe = true;
+ /**
+ * Prefix for the Footnote html element ID.
+ *
+ * @author Stefan Herndler
+ * @since 1.5.8
+ * @var string
+ */
+ public static $a_str_Prefix = "";
+
/**
* Register WordPress Hooks to replace Footnotes in the content of a public page.
*
@@ -83,29 +92,34 @@ class MCI_Footnotes_Task {
$l_str_BorderColor = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR);
$l_int_BorderRadius = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS);
$l_int_MaxWidth = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH);
+ $l_str_BoxShadowColor = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR);
?>