Révision a6e869e4
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/twitter_block/twitter_block.module | ||
---|---|---|
10 | 10 |
*/ |
11 | 11 |
function twitter_block_cron() { |
12 | 12 |
// Regenerate the JavaScript file every day. |
13 |
if (REQUEST_TIME - variable_get('twitter_block_last_cache', 0) >= 86400 && variable_get('twitter_block_cache', TRUE)) {
|
|
13 |
if (REQUEST_TIME - variable_get('twitter_block_last_cache', 0) >= 86400 && variable_get('twitter_block_cache', 0)) {
|
|
14 | 14 |
// Synchronize the widget code and update it if remote file have changed. |
15 | 15 |
twitter_block_cache(TRUE); |
16 | 16 |
|
... | ... | |
26 | 26 |
switch ($path) { |
27 | 27 |
case 'admin/structure/block/add-twitter-block': |
28 | 28 |
return '<p>' . t('Use this page to create a new custom Twitter block.') . '</p>'; |
29 |
case 'admin/config/system/twitter-block': |
|
30 |
return '<p>' . t('Configure global settings for Twitter blocks.') . '</p>'; |
|
29 | 31 |
} |
30 | 32 |
} |
31 | 33 |
|
34 |
/** |
|
35 |
* Implements hook_permission(). |
|
36 |
*/ |
|
37 |
function twitter_block_permission() { |
|
38 |
return array( |
|
39 |
'administer twitter block' => array( |
|
40 |
'title' => t('Administer Twitter Block'), |
|
41 |
'description' => t('Perform maintenance tasks for Twitter Block.'), |
|
42 |
), |
|
43 |
); |
|
44 |
} |
|
45 |
|
|
32 | 46 |
/** |
33 | 47 |
* Implements hook_menu(). |
34 | 48 |
*/ |
... | ... | |
69 | 83 |
'type' => MENU_CALLBACK, |
70 | 84 |
'file' => 'twitter_block.admin.inc', |
71 | 85 |
); |
86 |
|
|
87 |
$items['admin/config/system/twitter-block'] = array( |
|
88 |
'title' => 'Twitter Block', |
|
89 |
'description' => 'Configure cache settings for Twitter blocks.', |
|
90 |
'page callback' => 'drupal_get_form', |
|
91 |
'page arguments' => array('twitter_block_admin_settings_form'), |
|
92 |
'access arguments' => array('administer twitter block'), |
|
93 |
'type' => MENU_NORMAL_ITEM, |
|
94 |
'file' => 'twitter_block.admin.inc', |
|
95 |
); |
|
96 |
|
|
72 | 97 |
return $items; |
73 | 98 |
} |
74 | 99 |
|
... | ... | |
406 | 431 |
); |
407 | 432 |
|
408 | 433 |
// Use a locally cached copy of widgets.js by default. |
409 |
if (variable_get('twitter_block_cache', TRUE) && $url = twitter_block_cache()) {
|
|
434 |
if (variable_get('twitter_block_cache', 0) && $url = twitter_block_cache()) {
|
|
410 | 435 |
$block['content']['#attached']['js'] = array( |
411 | 436 |
array( |
412 | 437 |
'data' => $url, |
Formats disponibles : Unified diff
Weekly update of contrib modules