Révision e4c061ad
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/ctools/ctools.module | ||
---|---|---|
9 | 9 |
* must be implemented in the module file. |
10 | 10 |
*/ |
11 | 11 |
|
12 |
define('CTOOLS_API_VERSION', '2.0.7'); |
|
12 |
define('CTOOLS_API_VERSION', '2.0.8'); |
|
13 |
|
|
14 |
/** |
|
15 |
* The current working ctools version. |
|
16 |
* |
|
17 |
* In a release, it should be 7.x-1.x, which should match what drush make will |
|
18 |
* create. In a dev format, it should be 7.x-1.(x+1)-dev, which will allow |
|
19 |
* modules depending on new features in ctools to depend on ctools > 7.x-1.x. |
|
20 |
* |
|
21 |
* To define a specific version of CTools as a dependency for another module, |
|
22 |
* simply include a dependency line in that module's info file, e.g.: |
|
23 |
* ; Requires CTools v7.x-1.4 or newer. |
|
24 |
* dependencies[] = ctools (>=1.4) |
|
25 |
*/ |
|
26 |
define('CTOOLS_MODULE_VERSION', '7.x-1.6'); |
|
13 | 27 |
|
14 | 28 |
/** |
15 | 29 |
* Test the CTools API version. |
... | ... | |
536 | 550 |
return $items; |
537 | 551 |
} |
538 | 552 |
|
553 |
/** |
|
554 |
* Implements hook_permission(). |
|
555 |
*/ |
|
556 |
function ctools_permission() { |
|
557 |
return array( |
|
558 |
'use ctools import' => array( |
|
559 |
'title' => t('Use CTools importer'), |
|
560 |
'description' => t('The import functionality allows users to execute arbitrary PHP code, so extreme caution must be taken.'), |
|
561 |
'restrict access' => TRUE, |
|
562 |
), |
|
563 |
); |
|
564 |
} |
|
565 |
|
|
539 | 566 |
/** |
540 | 567 |
* Implementation of hook_cron. Clean up old caches. |
541 | 568 |
*/ |
... | ... | |
546 | 573 |
} |
547 | 574 |
|
548 | 575 |
/** |
549 |
* Ensure the CTools CSS cache is flushed whenever hook_flush_caches is invoked.
|
|
576 |
* Implements hook_flush_caches().
|
|
550 | 577 |
*/ |
551 | 578 |
function ctools_flush_caches() { |
552 |
// Do not actually flush caches if running on cron. Drupal uses this hook |
|
553 |
// in an inconsistent fashion and it does not necessarily mean to *flush* |
|
554 |
// caches when running from cron. Instead it's just getting a list of cache |
|
555 |
// tables and may not do any flushing. |
|
556 |
if (!empty($GLOBALS['locks']['cron'])) { |
|
557 |
return; |
|
558 |
} |
|
559 |
|
|
560 |
ctools_include('css'); |
|
561 |
ctools_css_flush_caches(); |
|
579 |
// Only return the CSS cache bin if it has been activated, to avoid |
|
580 |
// drupal_flush_all_caches() from trying to truncate a non-existing table. |
|
581 |
return variable_get('cache_class_cache_ctools_css', FALSE) ? array('cache_ctools_css') : array(); |
|
562 | 582 |
} |
563 | 583 |
|
564 | 584 |
/** |
... | ... | |
638 | 658 |
} |
639 | 659 |
} |
640 | 660 |
|
661 |
|
|
662 |
/** |
|
663 |
* Implements hook_page_alter(). |
|
664 |
* |
|
665 |
* Last ditch attempt to remove sidebar regions if the "no blocks" |
|
666 |
* functionality has been activated. |
|
667 |
* |
|
668 |
* @see ctools_block_list_alter(). |
|
669 |
*/ |
|
641 | 670 |
function ctools_page_alter(&$page) { |
671 |
$check = drupal_static('ctools_set_no_blocks', TRUE); |
|
672 |
if (!$check) { |
|
673 |
foreach ($page as $region_id => $region) { |
|
674 |
// @todo -- possibly we can set configuration for this so that users can |
|
675 |
// specify which blocks will not get rendered. |
|
676 |
if (strpos($region_id, 'sidebar') !== FALSE) { |
|
677 |
unset($page[$region_id]); |
|
678 |
} |
|
679 |
} |
|
680 |
} |
|
642 | 681 |
$page['#post_render'][] = 'ctools_page_token_processing'; |
643 | 682 |
} |
644 | 683 |
|
... | ... | |
786 | 825 |
return 0; |
787 | 826 |
} |
788 | 827 |
|
828 |
/** |
|
829 |
* Provides the default value for %ctools_js. |
|
830 |
* |
|
831 |
* This allows drupal_valid_path() to work with %ctools_js. |
|
832 |
*/ |
|
833 |
function ctools_js_to_arg($arg) { |
|
834 |
return empty($arg) || $arg == '%' ? 'nojs' : $arg; |
|
835 |
} |
|
836 |
|
|
789 | 837 |
/** |
790 | 838 |
* Menu _load hook. |
791 | 839 |
* |
... | ... | |
905 | 953 |
} |
906 | 954 |
|
907 | 955 |
/** |
908 |
* Implement hook_modules_enabled to clear static caches for detecting new plugins |
|
956 |
* Implements hook_modules_enabled(). |
|
957 |
* |
|
958 |
* Clear caches for detecting new plugins. |
|
909 | 959 |
*/ |
910 | 960 |
function ctools_modules_enabled($modules) { |
911 | 961 |
ctools_include('plugins'); |
912 | 962 |
ctools_get_plugins_reset(); |
963 |
cache_clear_all('ctools_plugin_files:', 'cache', TRUE); |
|
964 |
} |
|
965 |
|
|
966 |
/** |
|
967 |
* Implements hook_modules_disabled(). |
|
968 |
* |
|
969 |
* Clear caches for removing disabled plugins. |
|
970 |
*/ |
|
971 |
function ctools_modules_disabled($modules) { |
|
972 |
ctools_include('plugins'); |
|
973 |
ctools_get_plugins_reset(); |
|
974 |
cache_clear_all('ctools_plugin_files:', 'cache', TRUE); |
|
913 | 975 |
} |
914 | 976 |
|
915 | 977 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules