Skip to content

Commit

Permalink
Added Cookie Consent (feature #866)
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Aug 18, 2019
1 parent 4afe012 commit cc7e861
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 3 deletions.
3 changes: 2 additions & 1 deletion language/english.php
Expand Up @@ -2498,7 +2498,8 @@
'filemanager_videos_player_width' => 'Video player width (px)',
'filemanager_videos_player_height' => 'Video player height (px)',
'filemanager_show_audio_player' => 'Show audio player?',
'filemanager_audios_ext' => 'Audio file extensions'
'filemanager_audios_ext' => 'Audio file extensions',
'cookie_consent' => 'Enable Cookie Consent'
);

$LANG_configsubgroups['Core'] = array(
Expand Down
3 changes: 2 additions & 1 deletion language/english_utf-8.php
Expand Up @@ -2498,7 +2498,8 @@
'filemanager_videos_player_width' => 'Video player width (px)',
'filemanager_videos_player_height' => 'Video player height (px)',
'filemanager_show_audio_player' => 'Show audio player?',
'filemanager_audios_ext' => 'Audio file extensions'
'filemanager_audios_ext' => 'Audio file extensions',
'cookie_consent' => 'Enable Cookie Consent'
);

$LANG_configsubgroups['Core'] = array(
Expand Down
3 changes: 2 additions & 1 deletion language/japanese_utf-8.php
Expand Up @@ -2496,7 +2496,8 @@
'filemanager_videos_player_width' => '動画プレーヤーの幅',
'filemanager_videos_player_height' => '動画プレーヤーの高さ',
'filemanager_show_audio_player' => 'オーディオプレーヤーを表示する',
'filemanager_audios_ext' => 'オーディオファイルの拡張子'
'filemanager_audios_ext' => 'オーディオファイルの拡張子',
'cookie_consent' => 'Cookie Consent(クッキー使用通知)を有効にする'
);

$LANG_configsubgroups['Core'] = array(
Expand Down
6 changes: 6 additions & 0 deletions public_html/admin/install/config-install.php
Expand Up @@ -35,6 +35,11 @@
die('This file can not be used on its own!');
}

/**
* Install configuration values
*
* @param ConfigInterface $c
*/
function install_config(ConfigInterface $c)
{
global $_CONF, $_TABLES;
Expand All @@ -61,6 +66,7 @@ function install_config(ConfigInterface $c)
$c->add('meta_tags',0,'select',0,0,23,2000,TRUE, $me, 0);
$c->add('meta_description','Geeklog - The secure Content Management System.','textarea',0,0,NULL,2010,TRUE, $me, 0);
$c->add('meta_keywords','Geeklog, Content Management System, CMS, Open Source, Secure, Security, Blog, Weblog','textarea',0,0,NULL,2020,TRUE, $me, 0);
$c->add('cookie_consent',true,'select',0,0,1,2030,true, $me, 0);

$c->add('tab_mail', NULL, 'tab', 0, 1, NULL, 0, TRUE, $me, 1);
$c->add('fs_mail', NULL, 'fieldset', 0, 1, NULL, 0, TRUE, $me, 1);
Expand Down
20 changes: 20 additions & 0 deletions public_html/javascript/cookie_consent.js
@@ -0,0 +1,20 @@
/**
* Cookie consent v3.1.1
*/

// To customize appearance and behavior, please visit https://cookieconsent.osano.com/download/
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
}
},
"content": {
"message": "This website uses cookies to ensure you get the best experience on our website.",
"dismiss": "Got it!",
"link": "Learn more"
}
});
18 changes: 18 additions & 0 deletions public_html/lib-common.php
Expand Up @@ -1293,6 +1293,24 @@ function COM_createHTMLDocument(&$content = '', $information = array())

$header->set_var('breadcrumb_trail', $breadcrumbs);

// Add Cookie Consent ( https://cookieconsent.osano.com )
if (isset($_CONF['cookie_consent']) && $_CONF['cookie_consent']) {
$_SCRIPTS->setCssFile(
'cookiconsent', 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css',
true, array(), 100
);
$_SCRIPTS->setJavaScriptFile(
'cookie_consent', 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js',
true, 100
);

// To customize appearance and behavior, edit the following file
$_SCRIPTS->setJavaScriptFile(
'cookie_consent_config', '/javascript/cookie_consent.js',
true, 110
);
}

COM_hit();

// Set template directory
Expand Down
3 changes: 3 additions & 0 deletions sql/updates/mysql_2.2.0_to_2.2.1.php
Expand Up @@ -123,6 +123,9 @@ function update_ConfValuesFor221()
$c->del('cookie_password', $me);
$c->del('cookie_ip', $me);

// Add cookie consent
$c->add('cookie_consent',true,'select',0,0,1,2030,true, $me, 0);

return true;
}

Expand Down
3 changes: 3 additions & 0 deletions sql/updates/pgsql_2.2.0_to_2.2.1.php
Expand Up @@ -125,6 +125,9 @@ function update_ConfValuesFor221()
$c->del('cookie_password', $me);
$c->del('cookie_ip', $me);

// Add cookie consent
$c->add('cookie_consent',true,'select',0,0,1,2030,true, $me, 0);

return true;
}

Expand Down

0 comments on commit cc7e861

Please sign in to comment.