forked from kalamuna/hot_primary_tout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hot_primary_tout.module
49 lines (45 loc) · 1.67 KB
/
hot_primary_tout.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* @file
* Code for the Kalamuna Picture Pane for responsive images across multiple pages
*/
include_once 'hot_primary_tout.features.inc';
/**
* Implementation of hook_entity_info_alter()
*/
function hot_primary_tout_entity_info_alter(&$entity_info) {
// Fieldable panel pane bundle to support call-to-action
$entity_info['fieldable_panels_pane']['bundles']['hot_primary_tout_third'] = array(
'label' => t('Primary Tout'),
'pane category' => t('HotWidgets!'),
'pane top level' => FALSE,
'pane icon' => drupal_get_path('module', 'panopoly_widgets') . '/images/icon_image.png',
'admin' => array(
'path' => 'admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type',
'bundle argument' => 4,
'real path' => 'admin/structure/fieldable-panels-panes/manage/hot_primary_tout_third',
'access arguments' => array('administer fieldable panels panes'),
),
);
}
/**
* Implements hook_preprocess_panels_pane().
*/
function hot_primary_tout_preprocess_panels_pane(&$variables){
if(isset($variables['content']['#bundle'])){
$bundle = $variables['content']['#bundle'];
if(strpos($bundle, 'hot_primary_tout') === 0){
$variables['theme_hook_suggestions'][] = 'fieldable_panels_panes__hot_primary_tout';
}
}
}
/**
* Implements hook_theme_registry_alter().
*/
function hot_primary_tout_theme_registry_alter(&$theme_registry) {
$theme_registry['fieldable_panels_panes__hot_primary_tout'] = array(
'template' => drupal_get_path('module', 'hot_primary_tout') . '/templates/fieldable-panels-panes--hot-primary-tout',
'theme path' => drupal_get_path('module', 'hot_primary_tout'),
'type' => 'module',
);
}