diff options
author | Heshan <heshan@heidisoft.com> | 2011-03-07 14:40:10 +0530 |
---|---|---|
committer | Heshan <heshan@heidisoft.com> | 2011-03-07 14:40:10 +0530 |
commit | f804c5913e46299bc52f97ce7905bc00c162db81 (patch) | |
tree | 9c887491b2e99ebd3ba013d2712fc2d927efc2bb | |
parent | 7235ebc06e881ebefe1d2c45a3b0f5304e26b936 (diff) | |
download | video-f804c5913e46299bc52f97ce7905bc00c162db81.tar.gz video-f804c5913e46299bc52f97ce7905bc00c162db81.tar.bz2 |
Creating new module Video UI to manage Video module configurations ie. Preset management
-rw-r--r-- | includes/preset.inc | 1 | ||||
-rw-r--r-- | modules/video_ui/video.admin.inc (renamed from video.admin.inc) | 0 | ||||
-rw-r--r-- | modules/video_ui/video.preset.inc (renamed from includes/video.preset.inc) | 0 | ||||
-rw-r--r-- | modules/video_ui/video_ui.info | 7 | ||||
-rw-r--r-- | modules/video_ui/video_ui.module | 188 | ||||
-rw-r--r-- | video.css | 0 | ||||
-rw-r--r-- | video.features.inc (renamed from includes/video.features.inc) | 0 | ||||
-rw-r--r-- | video.field.inc (renamed from includes/video.field.inc) | 0 | ||||
-rw-r--r-- | video.info | 10 | ||||
-rw-r--r-- | video.module | 222 |
10 files changed, 199 insertions, 229 deletions
diff --git a/includes/preset.inc b/includes/preset.inc index 52d814b..f1c14b8 100644 --- a/includes/preset.inc +++ b/includes/preset.inc @@ -22,6 +22,7 @@ class video_preset { */ public function admin_settings() { $form = array(); + module_load_include('inc', 'video_ui', 'video.preset'); $presets = video_preset_get_presets(); if (count($presets) == 0) { $form['video_preset'] = array( diff --git a/video.admin.inc b/modules/video_ui/video.admin.inc index 0f55dea..0f55dea 100644 --- a/video.admin.inc +++ b/modules/video_ui/video.admin.inc diff --git a/includes/video.preset.inc b/modules/video_ui/video.preset.inc index 4036c82..4036c82 100644 --- a/includes/video.preset.inc +++ b/modules/video_ui/video.preset.inc diff --git a/modules/video_ui/video_ui.info b/modules/video_ui/video_ui.info new file mode 100644 index 0000000..a03febd --- /dev/null +++ b/modules/video_ui/video_ui.info @@ -0,0 +1,7 @@ +name = Video UI +description = Administrative interface to Video. Without this module you cannot configure the video module. +package = Video +core = 7.x +configure = admin/config/media/video +dependencies[] = video +files[] = video_ui.module
\ No newline at end of file diff --git a/modules/video_ui/video_ui.module b/modules/video_ui/video_ui.module new file mode 100644 index 0000000..d2edb9e --- /dev/null +++ b/modules/video_ui/video_ui.module @@ -0,0 +1,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); +} diff --git a/video.css b/video.css deleted file mode 100644 index e69de29..0000000 --- a/video.css +++ /dev/null diff --git a/includes/video.features.inc b/video.features.inc index 10fbc9d..10fbc9d 100644 --- a/includes/video.features.inc +++ b/video.features.inc diff --git a/includes/video.field.inc b/video.field.inc index a342bc4..a342bc4 100644 --- a/includes/video.field.inc +++ b/video.field.inc @@ -1,18 +1,10 @@ name = Video -description = Implementation of a video field +description = Upload and manage video content with Drupal package = Video core = 7.x -configure = admin/config/media/video dependencies[] = file dependencies[] = image files[] = video.module -files[] = video.admin.inc -files[] = video.drush.inc -files[] = video.theme.inc -files[] = video_formatter.inc -files[] = video_schedular.inc -files[] = video.field.inc -files[] = includes/video.preset.inc # Including class files to lazyload files[] = includes/conversion.inc files[] = includes/filesystem.inc diff --git a/video.module b/video.module index 9c59ecf..92a362d 100644 --- a/video.module +++ b/video.module @@ -6,8 +6,8 @@ * */ // include the field element -module_load_include('inc', 'video', 'includes/video.field'); -module_load_include('inc', 'video', 'includes/video.features'); +module_load_include('inc', 'video', 'video.field'); +module_load_include('inc', 'video', 'video.features'); /* * Implementation of hook_init(). @@ -46,183 +46,6 @@ function video_permission() { return $perms; } -/** - * Implementation of hook_menu(). - */ -function video_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' => 'includes/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' => 'includes/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' => 'includes/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' => 'includes/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' => 'includes/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' => 'includes/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' => 'includes/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; -} - -/** - * Used for the menu item to load a preset. - * - * @param <type> $preset_name - */ -function video_preset_load($preset_name) { - module_load_include('inc', 'video', 'includes/video.preset'); - return video_get_preset($preset_name); -} /** * Implementation of hook_theme(). @@ -993,45 +816,4 @@ function rmdirr($dir) { } } @rmdir($dir); -} - -/** - * The hook that tells the preset module that your module should be added to the Preset Management. - * - * @return <array> - * title - The title that you would like to show in the preset manager. - * - * description - The description of your preset when it is shown in the preset manager. - * - * permissions - The permission that you would like to add for the management of your preset. - * - * default_settings - The default settings for your preset. This can also be passed in as a string, - * which is then interpreted as a function callback that has the following signature... - * - * function mymodule_default_settings( $preset ) { - * return array( - * 'param1' => 1, - * 'param2' => 2 - * ); - * } - * - * file - The external file that will hold the form hooks (seen below) for your preset. - */ -function video_preset_info() { - return array( - 'title' => t('Video Preset'), - 'description' => t('Video module transcoding presets.'), - 'permissions' => array( - 'name' => 'administer video preset', - 'title' => t('Administer Video Preset'), - 'description' => t('Administer video preset settings for the video conversions.') - ), - 'default_settings' => array( - 'param1' => 0, - 'param2' => 1, - 'param3' => 3, - 'param4' => 4 - ), - 'file' => drupal_get_path('module', 'video') . '/includes/video.preset.inc' - ); }
\ No newline at end of file |