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

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=';

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>

View File

@@ -428,6 +428,8 @@ INSERT INTO '.$prefixeTable.'config (param,value,comment)
array(),
array('origin' => 'installation')
);
conf_update_param('show_newsletter_subscription', 'false');
}
}
}

View File

@@ -85,6 +85,7 @@ $lang['(this tag will be deleted)'] = '(this tag will be deleted)';
$lang['+ Add an upload box'] = '+ Add an upload box';
$lang[', click on'] = ", click on";
$lang['... or '] = '... or ';
$lang['... or hide this link'] = '... or hide this link';
$lang['<em>Piwigo for iOS</em> application empowers you to connect to your Piwigo gallery from your iPhone, iPad or iPod Touch, create some albums and upload several photos at once.'] = '<em>Piwigo for iOS</em> application empowers you to connect to your Piwigo gallery from your iPhone, iPad or iPod Touch, create some albums and upload several photos at once.';
$lang['A locked gallery is only visible to administrators'] = 'A locked gallery is only visible to administrators';
$lang['A new version of Piwigo is available.'] = "A new version of Piwigo is available.";

View File

@@ -748,6 +748,7 @@ $lang['You can\'t define a default photo order because you have a custom setting
$lang['You have specified <i>$conf[\'order_by\']</i> in your local configuration file, this parameter in deprecated, please remove it or rename it into <i>$conf[\'order_by_custom\']</i> !'] = 'Vous avez spécifié <i>$conf[\'order_by\']</i> dans votre fichier de configuration, ce paramètre est obsolète, veuillez le supprimer ou le renommer en <i>$conf[\'order_by_custom\']</i> !';
$lang['Add a criteria'] = 'Ajouter un critère';
$lang['... or '] = '... ou bien ';
$lang['... or hide this link'] = '... ou bien cacher ce lien';
$lang['Create'] = 'Créer';
$lang['Start Upload'] = 'Démarrer le transfert';
$lang['You are using the Flash uploader. Problems? Try the <a href="%s">Browser uploader</a> instead.'] = 'Vous utilisez le formulaire Flash. Des problèmes ? Essayez le <a href="%s">formulaire HTML</a> à la place.';