aboutsummaryrefslogtreecommitdiff
path: root/modules/video_ui/video_ui.module
blob: d2edb9e7919df0e97f5735ae43ecc7f1b23033e6 (plain)
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
<?php

/**
 *
 * @file video_ui.module
 * Administrative interface to Video. Without this module you cannot configure the video module.
 * @author : Heshan (heshan@heidisoft.com)
 *
 */

/**
 * Implementation of hook_menu().
 */
function video_ui_menu() {
  $items = array();
  // General settings
  $items['admin/config/media/video'] = array(
    'title' => 'Video',
    'description' => 'Configure different aspects of the video module and its plugins',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_general_admin_settings'),
    'file' => 'video.admin.inc',
    'access arguments' => array('administer site configuration'),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/config/media/video/general'] = array(
    'title' => 'General',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
  );
  // Player settings
  $items['admin/config/media/video/players'] = array(
    'title' => 'Players',
    'description' => 'Configure your player settings for each video extension.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_players_admin_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'video.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
  );
  // Transcoder settings
  $items['admin/config/media/video/transcoders'] = array(
    'title' => 'Transcoders',
    'description' => 'Configure your transcoder to convert your videos or extra thumbnails.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_transcoder_admin_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'video.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  // Preset settings
  $items['admin/config/media/video/presets'] = array(
    'title' => 'Manage Preset',
    'description' => 'Configure your transcoder presets to convert your videos.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_preset_admin_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'video.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
  );

//  $items['admin/structure/video'] = array(
//    'title' => 'Video Presets',
//    'file' => 'includes/video.preset.inc',
//    'description' => 'Manage and configure the presets for Video.',
//    'page callback' => 'video_presets_overview',
//    'access arguments' => array('administer video presets')
//  );
  $items['admin/config/media/video/presets/all'] = array(
    'title' => 'Presets',
    'description' => 'Configure your transcoder presets to convert your videos.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_preset_admin_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'video.admin.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/media/video/presets/list'] = array(
    'title' => 'List',
    'file' => 'video.preset.inc',
    'description' => 'Manage and configure the presets for Video.',
    'page callback' => 'video_presets_overview',
    'access arguments' => array('administer video presets'),
    'type' => MENU_LOCAL_TASK,
    'weight' => -9,
  );
  $items['admin/config/media/video/presets/add'] = array(
    'title' => 'Add preset',
    'file' => 'video.preset.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_preset_form'),
    'access arguments' => array('administer video presets'),
    'type' => MENU_LOCAL_TASK
  );
  $items['admin/config/media/video/presets/import'] = array(
    'title' => t('Import preset'),
    'file' => 'video.preset.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_preset_import_form'),
    'access arguments' => array('administer video presets'),
    'type' => MENU_LOCAL_TASK
  );

  $items['admin/config/media/video/presets/preset/%video_preset'] = array(
    'title' => 'Edit video preset',
    'title callback' => 'video_preset_page_title',
    'title arguments' => array(6),
    'file' => 'video.preset.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_preset_form', 6),
    'access arguments' => array('administer video presets')
  );
  $items['admin/config/media/video/presets/preset/%video_preset/edit'] = array(
    'title' => 'Edit',
    'file' => 'video.preset.inc',
    'page arguments' => array(6),
    'access arguments' => array('administer video presets'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/media/video/presets/preset/%video_preset/delete'] = array(
    'title' => 'Delete',
    'file' => 'video.preset.inc',
    'page arguments' => array('video_preset_delete_confirm', 6),
    'access arguments' => array('administer video presets'),
    'type' => MENU_CALLBACK
  );
  $items['admin/config/media/video/presets/preset/%video_preset/export'] = array(
    'title' => t('Export'),
    'file' => 'video.preset.inc',
    'title callback' => 'video_preset_page_title',
    'title arguments' => array(6),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_preset_export_form', 6),
    'access arguments' => array('administer video presets'),
    'type' => MENU_CALLBACK
  );
  // Metadata settings
  $items['admin/config/media/video/metadata'] = array(
    'title' => 'Metadata',
    'description' => 'Configure your metadata settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_metadata_admin_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'video.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  // Filesystem settings
  $items['admin/config/media/video/filesystem'] = array(
    'title' => 'Filesystem',
    'description' => 'Configure your filesystem settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_filesystem_admin_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'video.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
  );
  // Cron settings
  $items['admin/config/media/video/cron'] = array(
    'title' => 'Cron Settings',
    'description' => 'Configure your cron settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('video_cron_admin_settings'),
    'access arguments' => array('administer site configuration'),
    'file' => 'video.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 6,
  );


  return $items;
}

/**
 * Implementing the special "auto-loader" for menu %video_preset.
 *
 * @param <string> $preset_name
 * @return <object> $preset
 */
function video_preset_load($preset_name) {
  module_load_include('inc', 'video_ui', 'video.preset');
  return video_get_preset($preset_name);
}