Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/honeypot/honeypot.module | ||
---|---|---|
143 | 143 |
$version = $info['version']; |
144 | 144 |
|
145 | 145 |
// Library for Honeypot JS. |
146 |
$libraries['timestamp.js'] = [
|
|
146 |
$libraries['timestamp.js'] = array(
|
|
147 | 147 |
'title' => 'Javascript to support timelimit on cached pages.', |
148 | 148 |
'version' => $version, |
149 |
'js' => [
|
|
150 |
[
|
|
149 |
'js' => array(
|
|
150 |
array(
|
|
151 | 151 |
'type' => 'setting', |
152 |
'data' => [
|
|
153 |
'honeypot' => [
|
|
152 |
'data' => array(
|
|
153 |
'honeypot' => array(
|
|
154 | 154 |
'jsToken' => honeypot_get_signed_timestamp('js_token:' . mt_rand(0, 2147483647)), |
155 |
],
|
|
156 |
],
|
|
157 |
],
|
|
158 |
drupal_get_path('module', 'honeypot') . '/js/honeypot.js' => [
|
|
155 |
),
|
|
156 |
),
|
|
157 |
),
|
|
158 |
drupal_get_path('module', 'honeypot') . '/js/honeypot.js' => array(
|
|
159 | 159 |
'group' => JS_LIBRARY, |
160 | 160 |
'weight' => 3, |
161 |
],
|
|
162 |
],
|
|
163 |
];
|
|
161 |
),
|
|
162 |
),
|
|
163 |
);
|
|
164 | 164 |
|
165 | 165 |
return $libraries; |
166 | 166 |
} |
... | ... | |
503 | 503 |
* The path to the honeypot.css file. |
504 | 504 |
*/ |
505 | 505 |
function honeypot_get_css_file_path() { |
506 |
return variable_get('file_public_path', conf_path() . '/files') . '/honeypot/honeypot.css';
|
|
506 |
return file_default_scheme() . '://honeypot/honeypot.css';
|
|
507 | 507 |
} |
508 | 508 |
|
509 | 509 |
/** |
... | ... | |
513 | 513 |
* The honeypot element class name (e.g. 'url'). |
514 | 514 |
*/ |
515 | 515 |
function honeypot_create_css($element_name) { |
516 |
$path = 'public://honeypot';
|
|
516 |
$path = file_default_scheme() . '://honeypot';
|
|
517 | 517 |
|
518 | 518 |
if (!file_prepare_directory($path, FILE_CREATE_DIRECTORY)) { |
519 | 519 |
drupal_set_message(t('Unable to create Honeypot CSS directory, %path. Check the permissions on your files directory.', array('%path' => file_uri_target($path))), 'error'); |
Formats disponibles : Unified diff
Weekly update of contrib modules