';
+
+ return $jsource;
+ /*}*/
}
/**
@@ -146,14 +161,7 @@ function cookiecontrol_onacceptance() {
$cookiecontrol_acceptancecallback = "function cookiecontrol_accepted(cc) {\n" . implode("\n", $callbacks) . "\n}";
- drupal_add_js($cookiecontrol_acceptancecallback, array(
- 'type' => 'inline',
- 'preprocess' => TRUE,
- 'scope' => 'footer',
- 'group' => JS_DEFAULT,
- 'every_page' => TRUE,
- 'cache' => TRUE,
- ));
+ drupal_add_js($cookiecontrol_acceptancecallback, 'inline', 'footer', FALSE, TRUE, TRUE);
}
/**
@@ -167,14 +175,7 @@ function cookiecontrol_cookiesallowed() {
$cookiecontrol_cookiesallowedcallback = "function cookiecontrol_cookiesallowed(cc) {\n" . implode("\n", $callbacks) . "\n}";
- drupal_add_js($cookiecontrol_cookiesallowedcallback, array(
- 'type' => 'inline',
- 'preprocess' => TRUE,
- 'scope' => 'footer',
- 'group' => JS_DEFAULT,
- 'every_page' => TRUE,
- 'cache' => TRUE,
- ));
+ drupal_add_js($cookiecontrol_cookiesallowedcallback, 'inline', 'footer', FALSE, TRUE, TRUE);
}
/**
@@ -188,27 +189,32 @@ function cookiecontrol_cookiesnotallowed() {
$cookiecontrol_cookiesnotallowedcallback = "function cookiecontrol_cookiesnotallowed(cc) {\n" . implode("\n", $callbacks) . "\n}";
- drupal_add_js($cookiecontrol_cookiesnotallowedcallback, array(
- 'type' => 'inline',
- 'preprocess' => TRUE,
- 'scope' => 'footer',
- 'group' => JS_DEFAULT,
- 'every_page' => TRUE,
- 'cache' => TRUE,
- ));
+ drupal_add_js($cookiecontrol_cookiesnotallowedcallback, 'inline', 'footer', FALSE, TRUE, TRUE);
+}
+
+/**
+ * Implements hook_init().
+ */
+function cookiecontrol_init() {
+ $path = drupal_get_path('module', 'cookiecontrol');
+ drupal_add_css($path . '/css/eu_cookie_compliance.css');
+ drupal_add_js($path . '/js/cookieControl-4.1.min.js', 'module', 'footer');
}
/**
* If cookie consent has not yet been given add a validation callback to tell the user and disable any submission callbacks
*/
-function cookiecontrol_form_user_login_block_alter(&$form, &$form_state, $form_id) {
- if ($s = cookiecontrol_userinrestrictedcountry()) {
- if (!isset($_COOKIE[cookiecontrol_generatesitecookie()]) || $_COOKIE[cookiecontrol_generatesitecookie()] != 'yes') {
- // Repalce all validation callbacks with just one telling the visitor they cannot log in yet
- $form['#validate'] = array('cookiecontrol_user_login_ban');
+//function cookiecontrol_form_user_login_block_alter(&$form, &$form_state, $form_id) {
+function cookiecontrol_form_alter($form_id, &$form) {
+ if ($form_id == 'user_login_block' || $form_id == 'user_login') {
+ if ($s = cookiecontrol_userinrestrictedcountry()) {
+ if (!isset($_COOKIE[cookiecontrol_generatesitecookie()]) || $_COOKIE[cookiecontrol_generatesitecookie()] != 'yes') {
+ // Repalce all validation callbacks with just one telling the visitor they cannot log in yet
+ $form['#validate'] = array('cookiecontrol_user_login_ban');
- // Remove any existing submit handlers to prevent any authentication taking place
- unset($form['#submit']);
+ // Remove any existing submit handlers to prevent any authentication taking place
+ unset($form['#submit']);
+ }
}
}
}
@@ -237,8 +243,29 @@ function cookiecontrol_userinrestrictedcountry() {
if ($request->code == 200) {
$geo_info = unserialize($request->data);
return stripos($cookiecontrol_countries, $geo_info['geoplugin_countryName']) !== FALSE ? TRUE : FALSE;
- } else {
+ }
+ else {
watchdog('Cookie Control', 'A visitors IP address could not be matched to a location so they were not blocked from logging in. Geoplugin returned the error [@code] @message', array('@code' => $request->code, '@message' => $request->status_message), WATCHDOG_ERROR);
return TRUE;
}
+}
+
+/**
+ * Drupal 7 Backported functions
+ */
+ function cookiecontrol_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')) {
+ // By default, we filter using Drupal's coding standards.
+ $identifier = strtr($identifier, $filter);
+
+ // Valid characters in a CSS identifier are:
+ // - the hyphen (U+002D)
+ // - a-z (U+0030 - U+0039)
+ // - A-Z (U+0041 - U+005A)
+ // - the underscore (U+005F)
+ // - 0-9 (U+0061 - U+007A)
+ // - ISO 10646 characters U+00A1 and higher
+ // We strip out any character not in the above list.
+ $identifier = preg_replace('/[^\x{002D}\x{0030}-\x{0039}\x{0041}-\x{005A}\x{005F}\x{0061}-\x{007A}\x{00A1}-\x{FFFF}]/u', '', $identifier);
+
+ return $identifier;
}
\ No newline at end of file
diff --git a/js/cookieControl-4.1.min.js b/js/cookieControl-4.1.min.js
old mode 100644
new mode 100755
diff --git a/modules/cookie_googleanalytics/cookie_googleanalytics.info b/modules/cookie_googleanalytics/cookie_googleanalytics.info
deleted file mode 100644
index 859389f..0000000
--- a/modules/cookie_googleanalytics/cookie_googleanalytics.info
+++ /dev/null
@@ -1,6 +0,0 @@
-; $Id$
-name = "Cookie Control for Google Analytics"
-description = "Disabled Google Analytics form tracking until visitor consents"
-dependencies[] = "cookiecontrol"
-dependencies[] = "googleanalytics"
-core = 7.x
diff --git a/modules/cookie_googleanalytics/cookie_googleanalytics.module b/modules/cookie_googleanalytics/cookie_googleanalytics.module
deleted file mode 100644
index 44aee30..0000000
--- a/modules/cookie_googleanalytics/cookie_googleanalytics.module
+++ /dev/null
@@ -1,40 +0,0 @@
-
- */
-
-/**
- * Add the analytics javascript callback to the list for on acceptance
- */
-function cookie_googleanalytics_cookieaccept_alter(&$callbacks) {
- $callbacks[] = 'ccAddAnalytics();';
-}
-
-/**
- * Add the analytics javascript callback to the list for already consenting visitors
- */
-function cookie_googleanalytics_cookiesallowed_alter(&$callbacks) {
- $callbacks[] = 'ccAddAnalytics();';
-}
-
-/**
- * Remove the standard Google Analytics code from the header and place in
- * a function which can be called manually when appropriate
- */
-function cookie_googleanalytics_js_alter(&$javascript) {
- // Find the Google Analytics code. Wish there was a better keyed way to find the code :-(
- foreach($javascript as $key => $script) {
- if (is_string($script['data']) && strpos($script['data'], '/ga.js') > 0) {
-
- // Wrap code in a callback function
- $script = "function ccAddAnalytics() {\n" . $script['data'] . "\n}";
-
- // Substitue the original script snippet with our function wrapped version
- $javascript[$key]['data'] = $script;
- }
- }
-}
cc.setCookie('ccShowCookieIcon', 'no');jQuery('#ccc-icon').hide();
ccAddHtmlClass();
}
//-->
Commenti
Creattività
Dom, 01/25/2015 - 21:30
Collegamento permanente
parimerito
posso votarne più di tre due volte parimerito?
Elvira
LaPiccolaVolante
Dom, 01/25/2015 - 22:09
Collegamento permanente
No Elvira, solo 3 senza
No Elvira, solo 3 senza parimerito. Puoi comunque commentarli tutti le impressioni di lettura sono importanti al di là del voto!
quatipua
Dom, 01/25/2015 - 23:34
Collegamento permanente
commentaci tutto, Elvi'!
commentali tutti, credo sia la cosa più importante, almeno a me piacciono di più i commenti degli asterischi ;)
Creattività
Lun, 01/26/2015 - 08:31
Collegamento permanente
no.. è che me ne piacciono quattro...
anzi cinque più di tutti
Creattività
Lun, 01/26/2015 - 08:52
Collegamento permanente
scelti tre
Ne ho scelti tre e cercherò di commentarne il più possibile ma magari se anche voi lo fate col mio posso imparare qualcosa.
grazie
Elvira
quatipua
Mar, 01/27/2015 - 17:23
Collegamento permanente
io li leggo in ordine
appena ho tempo ne leggo e commento uno, fino a commentarli tutti :)
Elvira arriverò anche al tuo, giuro!
Krypto
Mar, 02/03/2015 - 23:27
Collegamento permanente
si vabbé, pure se non c'entra
si vabbé, pure se non c'entra un cazzo coi racconti, ma il captcha numerico per il riconoscimento??? parliamone... che poi a cosa serve che pure se uno ti ruba id e pass non è che non riesce a fare un'addizione... installateci i microchip di riconoscimento che sono più sicuri a questo punto...
LaPiccolaVolante
Mar, 02/03/2015 - 19:44
Collegamento permanente
siamo contro i metodi
siamo contro i metodi rettiliani. e comunque a quanto pare molti bot non sanno fare le addizioni, ora dobbiamo provare con i radicali e i derivati così non puoi commentare più neanche tu ahahah
Krypto
Mar, 02/03/2015 - 21:03
Collegamento permanente
fino alle disequazioni di
fino alle disequazioni di secondo grado ci arrivo... oltre potrei avere dei problemi...
masmas
Sab, 02/07/2015 - 07:39
Collegamento permanente
Votazione
Chiedo scusa a che giustamente si aspetta un commento e gentilmente ha commentato pure il mio ma non credo che risucirò a leggerli tutti, tra influenze e malanni finirei per far votare più il mio mal di testa, che è un tipo poco raccomandabile, ve lo assicuro.
quatipua
Lun, 02/16/2015 - 18:39
Collegamento permanente
Voti
ll ritorno degli improbabili ***
Profumo. Storia di cane **
Malo *
ma ne avrei sparse almeno un'altra bella manata, di stelline-asterischi!
grazie a chi ha partecipato, è una fiqata leggere così tante storie
Kriash
Gio, 02/19/2015 - 10:40
Collegamento permanente
Voti!
*** - Il ritorno degli improbabili
** - Anninnìa
* - Sei la mia bambola di porcellana
Bravissimi a tutti i partecipanti!!! CLAP CLAP CLAP
Beki Road
Gio, 02/19/2015 - 11:50
Collegamento permanente
Mi tolgo il pensiero
*** Sei la mia bambola di porcellana
** Malo
* Anninia
Mi piange il cuore non poter votare altri titoli! Complimenti a tutti perché ogni racconto é più bello deldell'altro!!!
Polveredighiaccio
Sab, 02/21/2015 - 19:36
Collegamento permanente
Per un pugno di denti * * *
Per un pugno di denti * * *
Lo strano caso del Commissario Gyoun Jon * *
Profumo. Storia di cane *
ambrous
Lun, 02/23/2015 - 15:13
Collegamento permanente
Voto
Io non ho abbondanza di stelline, queste quelle che alargisco:
*** Malo
** On the Last Legs
* Incantesimo per un Incubo a Quattro Mani
Alla prossima :)
Antio
Lun, 02/23/2015 - 22:55
Collegamento permanente
I voti
Ripromettendomi di commentare tutti i racconti nei prossimi giorni, ecco i miei voti :
Malo ***
Incantesimo per un incubo a quattro mani **
Profumo. Storia di cane *
Complimenti a tutti!
Ali
Mar, 02/24/2015 - 21:06
Collegamento permanente
I miei voti:
I miei voti:
*** Annina
** Profumo. Storia di cane
* Tutto il resto...