Skip to content

Commit 748b044

Browse files
committed
Correctif insertion public
1 parent 587b536 commit 748b044

6 files changed

Lines changed: 52 additions & 40 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
Version 2.1.2 (2020-04-07)
5+
--------------------------
6+
7+
* Correctif insertion cote public
8+
* Sauvegarde settings
9+
410
Version 2.1.1 (2020-04-04)
511
--------------------------
612

dcScript/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
Version 2.1.2 (2020-04-07)
5+
--------------------------
6+
7+
* Correctif insertion cote public
8+
* Sauvegarde settings
9+
410
Version 2.1.1 (2020-04-04)
511
--------------------------
612

dcScript/_config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
if (isset($_POST['save'])) {
1313
try {
1414
$core->dcScript->settings('enabled', !empty($_POST['enabled']), true);
15-
$core->dcScript->settings('header_code_enabled', !empty($_POST['header_code_enabled']), true);
16-
$core->dcScript->settings('footer_code_enabled', !empty($_POST['footer_code_enabled']), true);
17-
$core->dcScript->settings('backup_ext', html::escapeHTML($_POST['backup']), true);
15+
$core->dcScript->settings('header_code_enabled', !empty($_POST['header_code_enabled']), false);
16+
$core->dcScript->settings('footer_code_enabled', !empty($_POST['footer_code_enabled']), false);
17+
$core->dcScript->settings('backup_ext', html::escapeHTML($_POST['backup']), false);
1818
$core->blog->triggerBlog();
1919
dcPage::addSuccessNotice(__('Configuration successfully updated.'));
2020
} catch(exception $e) {

dcScript/_define.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/* Name */ 'dcScript',
1212
/* Description*/ 'Add script for DC 2.8+',
1313
/* Author */ 'Gvx',
14-
/* Version */ '2.1.1',
14+
/* Version */ '2.1.2',
1515
array(
1616
/* standard plugin options dotclear */
1717
'permissions' => 'dcScript.edit'

dcScript/inc/class.dcScript.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ class dcScript extends dcPluginHelper024b {
1919

2020
public static function publicHeadContent($core, $_ctx) {
2121
if(version_compare(PHP_VERSION, '7.2', '>=') && ($core->dcScript->settings('crypt_lib') != self::OPENSSL)) { return; }
22-
$html = self::decrypt($core->dcScript->settings('header_code'), $core->dcScript->getCryptKey());
22+
$html = self::decrypt($core->dcScript->settings('header_code'), $core->dcScript->getCryptKey(), $core->dcScript->settings('crypt_lib'));
2323
if($core->dcScript->settings('enabled') && $core->dcScript->settings('header_code_enabled') && !empty($html)) {
2424
echo "<!-- dcScript header begin -->\n".$html."\n<!-- dcScript header end -->\n";
2525
}
2626
}
2727

2828
public static function publicFooterContent($core, $_ctx) {
2929
if(version_compare(PHP_VERSION, '7.2', '>=') && ($core->dcScript->settings('crypt_lib') != self::OPENSSL)) { return; }
30-
$html = self::decrypt($core->dcScript->settings('footer_code'), $core->dcScript->getCryptKey());
30+
$html = self::decrypt($core->dcScript->settings('footer_code'), $core->dcScript->getCryptKey(), $core->dcScript->settings('crypt_lib'));
3131
if($core->dcScript->settings('enabled') && $core->dcScript->settings('footer_code_enabled') && !empty($html)) {
3232
echo "<!-- dcScript footer begin -->\n".$html."\n<!-- dcScript footer end -->\n";
3333
}

dcScript/inc/index_warning.js

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,40 @@
55
* (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
66
* -- END LICENSE BLOCK -----------------------------------------------------*/
77

8-
(function (undefined) {
9-
'use strict';
10-
// -- INFORMATIONS BLOCK BEGIN ----------------------------------------------------
11-
var informations = {
12-
name: 'dcScriptIndexWarning',
13-
description: 'dcScript for dotclear version 2.7+',
14-
version: '0.1.0',
15-
author: 'Gvx',
16-
copyright: '© 2020 Gvx',
17-
support: '',
18-
license: 'http://www.gnu.org/licenses/old-licenses/gpl-2.0.html'
19-
};
20-
// -- INFORMATIONS BLOCK END ------------------------------------------------------
8+
(function(undefined) {
9+
'use strict';
10+
// -- INFORMATIONS BLOCK BEGIN ----------------------------------------------------
11+
var informations = {
12+
name: 'dcScriptIndexWarning',
13+
description: 'dcScript for dotclear version 2.7+',
14+
version: '0.1.0',
15+
author: 'Gvx',
16+
copyright: '© 2020 Gvx',
17+
support: '',
18+
license: 'http://www.gnu.org/licenses/old-licenses/gpl-2.0.html'
19+
};
20+
// -- INFORMATIONS BLOCK END ------------------------------------------------------
2121

22-
function copy(element, button) {
23-
if (element) {
24-
var range = document.createRange();
25-
var selection = window.getSelection();
26-
range.selectNode(element);
27-
selection.removeAllRanges();
28-
selection.addRange(range);
29-
if (button) { button.classList.remove('copy_done'); }
30-
if (document.execCommand('copy')) {
31-
if (button) { button.classList.add('copy_done'); }
32-
} else {
33-
console.log('Erreur de copie de "' + element.id + '"');
34-
}
35-
}
36-
}
22+
function copy(element, button) {
23+
if (element) {
24+
var range = document.createRange();
25+
var selection = window.getSelection();
26+
range.selectNode(element);
27+
selection.removeAllRanges();
28+
selection.addRange(range);
29+
if (button) { button.classList.remove('copy_done'); }
30+
if (document.execCommand('copy')) {
31+
if (button) { button.classList.add('copy_done'); }
32+
} else {
33+
console.log('Erreur de copie de "' + element.id + '"');
34+
}
35+
}
36+
}
3737

38-
document.addEventListener('DOMContentLoaded', function() {
39-
document.getElementById('copy_key_crypt').addEventListener('click', function() { copy(document.getElementById('key_crypt'), this); });
40-
document.getElementById('copy_header_code').addEventListener('click', function() { copy(document.getElementById('header_code'), this); });
41-
document.getElementById('copy_footer_code').addEventListener('click', function() { copy(document.getElementById('footer_code'), this); });
42-
});
38+
document.addEventListener('DOMContentLoaded', function() {
39+
document.getElementById('copy_key_crypt').addEventListener('click', function() { copy(document.getElementById('key_crypt'), this); });
40+
document.getElementById('copy_header_code').addEventListener('click', function() { copy(document.getElementById('header_code'), this); });
41+
document.getElementById('copy_footer_code').addEventListener('click', function() { copy(document.getElementById('footer_code'), this); });
42+
});
4343

44-
}());
44+
}());

0 commit comments

Comments
 (0)