-
Notifications
You must be signed in to change notification settings - Fork 0
/
ca_gallery.module
executable file
·63 lines (57 loc) · 1.88 KB
/
ca_gallery.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* @file
* Code for the CA Gallery feature.
*/
include_once('ca_gallery.features.inc');
/**
* Implements hook_menu()
*/
function ca_gallery_menu() {
$items['admin/config/worx_features/gallery'] = array(
'title' => 'Gallery Configuration',
'description' => 'Override settings for ca_gallery',
'page callback' => 'drupal_get_form',
'page arguments' => array('ca_gallery_settings_form'),
'access arguments' => array('worx features admin'),
'file' => 'ca_gallery.admin.inc',
'file path' => drupal_get_path('module', 'ca_gallery'),
'type' => MENU_NORMAL_ITEM,
);
$items['admin/config/worx_features/gallery/general'] = array(
'title' => 'General Settings',
'description' => 'Override settings for ca_gallery',
'page callback' => 'drupal_get_form',
'page arguments' => array('ca_gallery_settings_form'),
'access arguments' => array('worx features admin'),
'file' => 'ca_gallery.admin.inc',
'file path' => drupal_get_path('module', 'ca_gallery'),
'type' => MENU_DEFAULT_LOCAL_TASK,
);
return $items;
}
/**
* implements hook_menu_alter().
*/
function ca_gallery_menu_alter(&$items) {
$items['gallery']['title'] = variable_get('ca_gallery_menu_title', 'Gallery');
}
/**
* Implements hook_panels_pre_render().
*/
function ca_gallery_panels_pre_render($panel, $renderer) {
if (isset($panel->content['new-9']) && $panel->content['new-9']->subtype == 'ca_gallery-ca_gallery_list_1') {
$panel->title = variable_get('ca_gallery_panel_title', 'Gallery');
}
}
/**
* Implements hook_views_pre_render().
*/
function ca_gallery_views_pre_view(&$view, &$display_id, &$args) {
if ($display_id == 'ca_gallery_list_1') {
$view->set_items_per_page(variable_get('ca_gallery_list_count', 16));
}
elseif ($display_id == 'ca_gallery_image_list_1') {
$view->set_items_per_page(variable_get('ca_gallery_image_list_count', 16));
}
}