forked from Islandora/islandora_xml_forms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxml_forms.module
More file actions
41 lines (38 loc) · 790 Bytes
/
xml_forms.module
File metadata and controls
41 lines (38 loc) · 790 Bytes
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
<?php
/**
* @file
* XML Forms base module.
*/
/**
* Implements Hook Menu.
*
* @return array
* Array of menu items.
*/
function xml_forms_menu() {
$items['schema/%'] = array(
'title' => 'schema',
'description' => 'schema',
'page callback' => 'xml_forms_get_schema',
'page arguments' => array(1),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Get the schema if it exists.
*
* @param string $filename
* XSD to grab the schema from.
*/
function xml_forms_get_schema($filename) {
$path = drupal_get_path('module', 'xml_forms') . '/schema';
$full_filename = "$path/$filename";
if (file_exists($full_filename)) {
drupal_goto($full_filename);
}
else {
drupal_not_found();
}
}