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
This commit is contained in:
Aricura 2014-10-07 17:15:17 +00:00
parent e054849b1e
commit fdb748c86f
4 changed files with 21 additions and 7 deletions

View file

@ -162,20 +162,34 @@ class MCI_Footnotes_Layout_Init {
// convert the body to a json string // convert the body to a json string
$l_arr_Plugins = json_decode($l_str_Response, true); $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 // load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "other-plugins"); $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "other-plugins");
printf('<div id="the-list">'); printf('<div id="the-list">');
// iterate through each Plugin // iterate through each Plugin
foreach($l_arr_Plugins as $l_arr_PluginInfo) { foreach($l_arr_Plugins as $l_arr_PluginInfo) {
// replace Plugin information $l_str_InstallButton = '<a class="install-now button" href="'.$l_str_Server.'/wp-admin/update.php?action=install-plugin&plugin='.$l_arr_PluginInfo["name"].'&_wpnonce=e7a5c90faf" aria-label="Install '.$l_arr_PluginInfo["title"].' now">'.__("Install now", MCI_Footnotes_Config::C_STR_PLUGIN_NAME).'</a>';
$l_str_AlreadyInstalled = '<span class="button button-disabled" title="'.__("This Plugin is already installed and up to date.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME).'">'.__("Installed", MCI_Footnotes_Config::C_STR_PLUGIN_NAME).'</span>';
$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( $l_obj_Template->replace(
array( 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-name" => $l_arr_PluginInfo["name"],
"plugin-title" => $l_arr_PluginInfo["title"], "plugin-title" => $l_arr_PluginInfo["title"],
"plugin-icon" => "http://plugins.svn.wordpress.org/" . $l_arr_PluginInfo["name"] ."/assets/icon-256x256.png", "plugin-icon" => strlen($l_arr_PluginInfo["img"]) > 0 ? "http://plugins.svn.wordpress.org/" . $l_arr_PluginInfo["name"] ."/assets/" . $l_arr_PluginInfo["img"] : "",
"install-label" => __("Install now", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"install-link" => !$l_bool_isPluginInstalled ? $l_str_InstallButton : $l_str_AlreadyInstalled,
"more-details-label" => __("More Details", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "more-details-label" => __("More Details", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"last-updated-label" => __("Last Updated", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) "last-updated-label" => __("Last Updated", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
) )

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: ManFisher Medien ManuFaktur Author: ManFisher Medien ManuFaktur
Version: 1.5.3 Version: 1.5.4
Author URI: http://manfisher.net/plugins/footnotes/ Author URI: http://manfisher.net/plugins/footnotes/
Text Domain: footnotes Text Domain: footnotes
Domain Path: /languages Domain Path: /languages

View file

@ -6,7 +6,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tested up to: 4.0 Tested up to: 4.0
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.5.3 Stable Tag: 1.5.4
== Description == == Description ==

View file

@ -11,7 +11,7 @@
<div class="action-links"> <div class="action-links">
<ul class="plugin-action-buttons"> <ul class="plugin-action-buttons">
<li> <li>
<a class="install-now button" href="[[server]]/wp-admin/update.php?action=install-plugin&plugin=[[plugin-name]]&_wpnonce=e7a5c90faf" aria-label="Install [[plugin-title]] now">[[install-label]]</a> [[install-link]]
</li> </li>
<li> <li>
<a href="[[server]]/wp-admin/plugin-install.php?tab=plugin-information&plugin=[[plugin-name]]&TB_iframe=true&width=600&height=550" class="thickbox" aria-label="More information about [[plugin-title]]" data-title="[[plugin-title]]">[[more-details-label]]</a> <a href="[[server]]/wp-admin/plugin-install.php?tab=plugin-information&plugin=[[plugin-name]]&TB_iframe=true&width=600&height=550" class="thickbox" aria-label="More information about [[plugin-title]]" data-title="[[plugin-title]]">[[more-details-label]]</a>