This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmediamosa_ck.module
192 lines (181 loc) · 5.27 KB
/
mediamosa_ck.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php
/**
* @file
* The MediaMosa Construction Kit module.
*/
/**
* Implements hook_permission().
*/
function mediamosa_ck_permission() {
return array(
mediamosa_ck::PERMISSION_ADMIN_CONFIGURATION => array(
'title' => t('Change MediaMosa construction kit configuration'),
'description' => t('Users with this permission can change the MediaMosa Construction Kit configuration.'),
),
mediamosa_ck::PERMISSION_ADD_MEDIA => array(
'title' => t('Add media to mediamosa'),
'description' => t('Users with this permission can add media to mediamosa.'),
),
);
}
/**
* Implements hook_menu().
*/
function mediamosa_ck_menu() {
$items = array();
$items['admin/config/media/mediamosa_ck/config'] = array(
'title' => 'MediaMosa construction kit',
'description' => 'Configuration settings of the MediaMosa Construction Kit.',
'page callback' => 'drupal_get_form',
'page arguments' => array('mediamosa_ck_configuration_form'),
'access arguments' => array(mediamosa_ck::PERMISSION_ADMIN_CONFIGURATION),
'file' => 'mediamosa_ck.admin.inc',
);
$items['asset/detail/%/%/download'] = array(
'title' => 'Download',
'page callback' => '_mediamosa_ck_mediafile_download',
'page arguments' => array(2, 3),
'access arguments' => array('access content'),
'file' => 'mediamosa_ck.inc',
);
$items['mediamosa/ck/json/uploadticket/create'] = array(
'title' => 'Create the upload ticket for a file',
'page callback' => '_mediamosa_ck_json_create_upload_ticket',
'page arguments' => array(),
'access arguments' => array(mediamosa_ck::PERMISSION_ADD_MEDIA),
'type' => MENU_CALLBACK,
'file' => 'mediamosa_ck.inc',
);
$items['mediamosa/ck/json/connector/status'] = array(
'title' => 'Check if the connector',
'page callback' => '_mediamosa_ck_json_connector_status',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'mediamosa_ck.inc',
);
return $items;
}
/**
* Implements hook_date_formats().
*/
function mediamosa_ck_date_format_types() {
// Define the MediaMosa CK date format types.
return array(
'mediamosa_ck_normal' => t('MediaMosa Site Builder - Normal'),
'mediamosa_ck_mf_duration' => t('MediaMosa Site Builder - Mediafile duration'),
);
}
/**
* Implements hook_date_formats().
*/
function mediamosa_ck_date_formats() {
return array(
array(
'type' => 'mediamosa_ck_normal',
'format' => 'd-m-Y',
'locales' => array(),
),
array(
'type' => 'mediamosa_ck_normal',
'format' => 'm-d-Y',
'locales' => array('en', 'en-us'),
),
array(
'type' => 'mediamosa_ck_mf_duration',
'format' => 'i:s',
'locales' => array('en', 'en-us'),
),
array(
'type' => 'mediamosa_ck_mf_duration',
'format' => 'H:i:s',
'locales' => array('en', 'en-us'),
),
);
}
/**
* Implements hook_theme().
*/
function mediamosa_ck_theme() {
return array(
'mediamosa_ck_table' => array(
'variables' => array(
// Table.
'header' => NULL,
'rows' => NULL,
'attributes' => array(),
'caption' => NULL,
'colgroups' => array(),
'sticky' => TRUE,
'empty' => '',
// Selection box (optional).
'selection' => NULL,
'selection checkbox class' => 'mm-ck-mm-checkbox',
// Make rows dragable.
'draggable' => FALSE,
// Pager (optional).
'page' => 0,
'item_count_total' => 0,
'item_limit' => 25,
'element' => 0,
'quantity' => 10,
'pager top' => TRUE,
'pager bottom' => TRUE,
'pager normal top' => FALSE,
// Add normal Drupal theme_pager() at top. Expect usage of
// ->extend('Pagerdefault') on used query.
'pager normal bottom' => FALSE,
// Add normal Drupal theme_pager() at bottom. Expect usage of
// ->extend('Pagerdefault') on used query.
// Note (small font, bottom right).
'note' => NULL,
// Caption bottom, right.
'caption_bottom' => NULL,
// Title, description (top).
'title' => NULL,
'description' => NULL,
// Summary.
'summary' => NULL,
),
'file' => 'mediamosa_ck.theme.inc',
),
'mediamosa_ck_pager' => array(
'variables' => array(
'page' => 0,
'item_count_total' => 0,
'item_limit' => 25,
'element' => 0,
'quantity' => 10,
),
'file' => 'mediamosa_ck.theme.inc',
),
'mediamosa_ck_two_column_page' => array(
'variables' => array(
'left' => 'left column',
'right' => 'right column',
),
'file' => 'mediamosa_ck.theme.inc',
),
'mediamosa_ck_three_column_page' => array(
'variables' => array(
'left' => 'left column',
'middle' => 'middle column',
'right' => 'right column',
),
'file' => 'mediamosa_ck.theme.inc',
),
'mediamosa_ck_tabs' => array(
'variables' => array(
'tabs' => array(),
'tab-overlay' => '',
),
'file' => 'mediamosa_ck.theme.inc',
),
'mediamosa_ck_popup' => array(
'variables' => array(
'title' => '',
'markup' => '',
),
'file' => 'mediamosa_ck.theme.inc',
),
);
}