-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.module
42 lines (34 loc) · 1.03 KB
/
custom.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
<?php
/********************************************************************************
* Exportable Views
*******************************************************************************/
function custom_views_api() {
return array('api' => '3.0');
}
function custom_views_default_views() {
$path = './' . drupal_get_path('module', 'custom') . '/views/*.inc';
$views = array();
foreach (glob($path) as $file) {
require_once($file);
}
return $views;
}
/********************************************************************************
* Custom Menu Callbacks
*******************************************************************************/
function custom_menu()
{
$items = array();
$items['custom/route'] = array(
'title' => 'My Custom Menu Item',
'description' => 'Custom menu item description',
'page callback' => 'custom_callback',
'access callback' => true,
'type' => MENU_CALLBACK
);
return $items;
}
function custom_callback()
{
// Do something
}