';
+
+ 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
Pilgrimax
Mar, 08/29/2017 - 17:58
Collegamento permanente
Fuori bordo - Fino alla tela
Scusate la domanda forse ovvia/sciocca. Io capisco che se si scrive un racconto in cui il quadro viene dipinto "in itinere", ovvero incrementalmente nel corso della storia narrata e si conclude appunto con il quadro terminato, si rispettano comunque i vincoli imposti dal bando, giusto? Mi riferisco soprattutto dove si scrive "Se il quadro comparirà a metà racconto, smetteremo di leggere e ogni voto dato al racconto dai lettori verrà cancellato."
Ciao a tutti!
Bjorn
Mar, 08/29/2017 - 19:00
Collegamento permanente
Info
Ciao, sicuramente i Capitani ti risponderanno con qualcosa di inerente la domanda (comunque secondo me: puoi... anzi: lascia spazio a molti spunti interessanti); nel frattempo ti dico che domande ovvie/sciocche non ci stanno. Siamo qui per migliorare col confronto e con un pizzico di competizione, sicuramente ogni domanda può portare al miglioramento e alla crescita degli altri, oltrechè propria, anche solo offrendo un'idea curiosa e affascinante. Ciao.
LaPiccolaVolante
Gio, 09/07/2017 - 16:17
Collegamento permanente
Allora il ritratto non deve
Allora il ritratto non deve comparire fino alla fine.
Potete farlo dipingere "in itinere", ma attenzione a non nominarlo.
tenete i particolari in "cornice": un protagonista che lava i pennelli, che ragione sull'orario e sulla luce che gli occorre. Tutto quello che succede intorno a un pittore che lavora ne è condizionato. E il gioco diventa "tenere quanto più a lungo possibile l'attenzione del lettore lontano dal quadro".
È meglio se evitate di utilizzare terminologie troppo evidenti. Il gioco consiste nel tener tutto nel racconto, ma distrarre il lettore dall'oggetto "quadro", "ritratto" fino alla fine.
Stessa cosa vale per Cane e Gatto. La presenza di un animale in un racconto non è vincolata alla sua palese presentazione. Gli animali domestici hanno un nome proprio e atteggiamenti, comportamenti caratteristici. Utilizzate quelli.
Un gatto non ama esser bagnato, un cane sogna rumorosamente o fissa in maniera imbarazzante e snervante quando vuole qualcosa.
LaPiccolaVolante
Gio, 09/07/2017 - 16:18
Collegamento permanente
scusate il ritardo. Stavamo
scusate il ritardo. Stavamo facendo conti. hihih
Pilgrimax
Dom, 09/24/2017 - 07:14
Collegamento permanente
Grazie per le risposte
Grazie per le risposte chiarificatrici.
Un saluto a tutti i pirati ;-)
Pilgrimax
Dom, 10/01/2017 - 22:27
Collegamento permanente
Miei voti
Ciao a tutti i pirati! Non so se sia questo il posto dove votare. Spero che i capitani non mi diano in pasto agli squali...
Su, nella soffitta ***
Nella salute e nella malattia **
Il Fattorino *
masmas
Lun, 10/02/2017 - 20:45
Collegamento permanente
Voto
Ebe e Ada ***
Nella salute e nella malattia **
Il fattorino *
Kriash
Mar, 10/03/2017 - 17:18
Collegamento permanente
Voti
*** Su, nella soffitta
** Il Fattorino
* Ebe e Ada
Gana Mala
Gio, 10/05/2017 - 16:55
Collegamento permanente
Voti
*** Ebe e Ada
** Su, nella soffitta
* Il fattorino
Robypey
Gio, 10/05/2017 - 21:57
Collegamento permanente
Voti
Su,nella soffitta ***
Ebe e Ada **
Nella salute e nella malatia *
ansia e cedrata
Lun, 10/09/2017 - 20:13
Collegamento permanente
premettendo che trovo tutti i
premettendo che trovo tutti i racconti adorabili, lascio le mie stellette a:
Ebe e Ada * * *
Su, nella soffitta * *
Nella salute e nella malattia *