Révision 8be7bf84
Ajouté par Assos Assos il y a plus de 5 ans
drupal7/sites/all/modules/views/views.module | ||
---|---|---|
752 | 752 |
return $items; |
753 | 753 |
} |
754 | 754 |
|
755 |
/** |
|
756 |
* Implements hook_block_configure(). |
|
757 |
*/ |
|
758 |
function views_block_configure($delta = '') { |
|
759 |
// If there's no Views UI module there's nothing to link to. |
|
760 |
if (!module_exists('views_ui')) { |
|
761 |
return array(); |
|
762 |
} |
|
763 |
|
|
764 |
// If the user doesn't have access to edit the view then don't bother with |
|
765 |
// anything else. |
|
766 |
if (!user_access('administer views')) { |
|
767 |
return array(); |
|
768 |
} |
|
769 |
|
|
770 |
// If this is 32, this should be an md5 hash. |
|
771 |
if (strlen($delta) == 32) { |
|
772 |
$hashes = variable_get('views_block_hashes', array()); |
|
773 |
if (!empty($hashes[$delta])) { |
|
774 |
$delta = $hashes[$delta]; |
|
775 |
} |
|
776 |
} |
|
777 |
|
|
778 |
// Some added precaution in case the delta is missing values. |
|
779 |
list($view_name, $display_id) = explode('-', $delta, 2) + array('', ''); |
|
780 |
|
|
781 |
// If the view name or display ID can't be found, there's something wrong. |
|
782 |
if ($view_name === '' || $display_id === '') { |
|
783 |
return array(); |
|
784 |
} |
|
785 |
|
|
786 |
$view = views_get_view($view_name); |
|
787 |
if (empty($view)) { |
|
788 |
return array(); |
|
789 |
} |
|
790 |
|
|
791 |
if (!isset($view->display[$display_id])) { |
|
792 |
return array(); |
|
793 |
} |
|
794 |
|
|
795 |
/** @var \views_display $display */ |
|
796 |
$display = $view->display[$display_id]; |
|
797 |
|
|
798 |
$view_label = $view->get_human_name(); |
|
799 |
$display_label = $display->display_title; |
|
800 |
|
|
801 |
$path = "admin/structure/views/view/$view_name/edit/$display_id"; |
|
802 |
|
|
803 |
return array( |
|
804 |
'fieldset' => array( |
|
805 |
'#type' => 'fieldset', |
|
806 |
'#title' => t('Configure this views display'), |
|
807 |
'content' => array( |
|
808 |
'#markup' => l($view_label . ' - ' . $display_label, $path), |
|
809 |
), |
|
810 |
), |
|
811 |
); |
|
812 |
} |
|
813 |
|
|
755 | 814 |
/** |
756 | 815 |
* Implements hook_block_view(). |
757 | 816 |
*/ |
... | ... | |
1231 | 1290 |
* Include views .js files. |
1232 | 1291 |
*/ |
1233 | 1292 |
function views_add_js($file) { |
1234 |
// If javascript has been disabled by the user, never add js files.
|
|
1293 |
// If JavaScript has been disabled by the user, never add js files.
|
|
1235 | 1294 |
if (variable_get('views_no_javascript', FALSE)) { |
1236 | 1295 |
return; |
1237 | 1296 |
} |
... | ... | |
2586 | 2645 |
); |
2587 | 2646 |
} |
2588 | 2647 |
|
2648 |
/** |
|
2649 |
* Implements hook_admin_menu_cache_info(). |
|
2650 |
*/ |
|
2651 |
function views_admin_menu_cache_info() { |
|
2652 |
$caches['views'] = array( |
|
2653 |
'title' => t('Views'), |
|
2654 |
'callback' => 'views_invalidate_cache', |
|
2655 |
); |
|
2656 |
return $caches; |
|
2657 |
} |
|
2658 |
|
|
2589 | 2659 |
if (!function_exists('aggregator_views_api')) { |
2590 | 2660 |
/** |
2591 | 2661 |
* Provide Views integration for the Aggregator module. |
Formats disponibles : Unified diff
Weekly update of contrib modules