From f804c5913e46299bc52f97ce7905bc00c162db81 Mon Sep 17 00:00:00 2001 From: Heshan Date: Mon, 7 Mar 2011 14:40:10 +0530 Subject: Creating new module Video UI to manage Video module configurations ie. Preset management --- video.module | 222 +---------------------------------------------------------- 1 file changed, 2 insertions(+), 220 deletions(-) (limited to 'video.module') 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 $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 - * 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 -- cgit v1.2.3