fixes #93 automatically hide the newsletter link when clicked

This commit is contained in:
plegall
2019-06-28 14:45:05 +02:00
parent 3999bff326
commit 0ef2193471
5 changed files with 24 additions and 1 deletions
+6
View File
@@ -25,6 +25,12 @@ check_status(ACCESS_ADMINISTRATOR);
// | tabs |
// +-----------------------------------------------------------------------+
if (isset($_GET['action']) and 'hide_newsletter_subscription' == $_GET['action'])
{
conf_update_param('show_newsletter_subscription', 'false', true);
exit();
}
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
$my_base_url = get_root_url().'admin.php?page=';
+14 -1
View File
@@ -32,6 +32,19 @@ jQuery().ready(function(){
jQuery(".warnings ul").append('<li>'+ext_need_update_msg+'</li>');
}
});
jQuery('.newsletter-subscription a').click(function() {
jQuery('.newsletter-subscription').hide();
jQuery.ajax({
type: 'GET',
url: 'admin.php?action=hide_newsletter_subscription'
});
if (jQuery(this).hasClass('newsletter-hide')) {
return false;
}
});
});
{/literal}
{/footer_script}
@@ -134,6 +147,6 @@ jQuery().ready(function(){
{if isset($SUBSCRIBE_BASE_URL)}
<br><a href="{$SUBSCRIBE_BASE_URL}{$EMAIL}" class="externalLink cluetip icon-mail-alt" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|@htmlspecialchars|@nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate:$EMAIL}</a>
<br><span class="newsletter-subscription"><a href="{$SUBSCRIBE_BASE_URL}{$EMAIL}" id="newsletterSubscribe" class="externalLink cluetip icon-mail-alt" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|@htmlspecialchars|@nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate:$EMAIL}</a> <a href="#" class="newsletter-hide">{'... or hide this link'|translate}</a></span>
{/if}
</p>