From fdb748c86f3dfea73e62907c1bc6e03ab27b3d1f Mon Sep 17 00:00:00 2001 From: Aricura Date: Tue, 7 Oct 2014 17:15:17 +0000 Subject: [PATCH] Prepare for release version 1.5.4 - Update: disable install button for other Plugins if Plugin is already installed git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@1003409 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/dashboard/init.php | 22 ++++++++++++++++++---- index.php | 2 +- readme.txt | 2 +- templates/dashboard/other-plugins.html | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/class/dashboard/init.php b/class/dashboard/init.php index c9ecd74..5c8678e 100644 --- a/class/dashboard/init.php +++ b/class/dashboard/init.php @@ -162,20 +162,34 @@ class MCI_Footnotes_Layout_Init { // convert the body to a json string $l_arr_Plugins = json_decode($l_str_Response, true); + $l_str_Server = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://" . $_SERVER["SERVER_NAME"]; + // load template file $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "other-plugins"); printf('
'); // iterate through each Plugin foreach($l_arr_Plugins as $l_arr_PluginInfo) { - // replace Plugin information + $l_str_InstallButton = ''.__("Install now", MCI_Footnotes_Config::C_STR_PLUGIN_NAME).''; + $l_str_AlreadyInstalled = ''.__("Installed", MCI_Footnotes_Config::C_STR_PLUGIN_NAME).''; + $l_bool_isPluginInstalled = false; + // iterate through each installed WordPress Plugin + foreach (get_plugins() as $l_arr_Plugin) { + if (strtolower($l_arr_PluginInfo["title"]) == strtolower($l_arr_Plugin["Name"])) { + $l_bool_isPluginInstalled = true; + break; + } + } + + // replace Plugin information $l_obj_Template->replace( array( - "server" => ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://" . $_SERVER["SERVER_NAME"], + "server" => $l_str_Server, "plugin-name" => $l_arr_PluginInfo["name"], "plugin-title" => $l_arr_PluginInfo["title"], - "plugin-icon" => "http://plugins.svn.wordpress.org/" . $l_arr_PluginInfo["name"] ."/assets/icon-256x256.png", - "install-label" => __("Install now", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "plugin-icon" => strlen($l_arr_PluginInfo["img"]) > 0 ? "http://plugins.svn.wordpress.org/" . $l_arr_PluginInfo["name"] ."/assets/" . $l_arr_PluginInfo["img"] : "", + + "install-link" => !$l_bool_isPluginInstalled ? $l_str_InstallButton : $l_str_AlreadyInstalled, "more-details-label" => __("More Details", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "last-updated-label" => __("Last Updated", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) ) diff --git a/index.php b/index.php index db637f2..d1a27d3 100755 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ 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. Author: ManFisher Medien ManuFaktur - Version: 1.5.3 + Version: 1.5.4 Author URI: http://manfisher.net/plugins/footnotes/ Text Domain: footnotes Domain Path: /languages diff --git a/readme.txt b/readme.txt index 1faf306..f3cc588 100755 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tested up to: 4.0 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html -Stable Tag: 1.5.3 +Stable Tag: 1.5.4 == Description == diff --git a/templates/dashboard/other-plugins.html b/templates/dashboard/other-plugins.html index 3076be7..fbc6687 100644 --- a/templates/dashboard/other-plugins.html +++ b/templates/dashboard/other-plugins.html @@ -11,7 +11,7 @@