Commit e31059e9 authored by Jon Stacey's avatar Jon Stacey

Some Drupal 7 compatability stuff

- Added necessary files to module registry.
- Removed 'file' keys from hook_menu().
- Global media settings page fixed.
parent f2528256
......@@ -2,4 +2,9 @@
July 2009
---------
* Drupal 7 compatability
* Update .info files.
* Added necessary files to new registry.
* Removed 'file' keys from hook_menu().
* Global media settings page fixed.
* Untested rough sync up with D6 branch (jmstacey).
\ No newline at end of file
......@@ -7,4 +7,6 @@ core = 7.x
php = 5.2
files[] = media.install
files[] = media.module
files[] = media_ahah.inc
\ No newline at end of file
files[] = media_ahah.inc
files[] = media_settings.inc
files[] = media_theme.inc
\ No newline at end of file
......@@ -33,12 +33,10 @@ function media_menu() {
$items['media/js'] = array(
'page callback' => 'media_ahah_formatter_load',
'access arguments' => array('access content'),
'file' => 'media_ahah.inc',
);
$items['media/metadata/js'] = array(
'page callback' => 'media_ahah_metadata_ahah',
'access arguments' => array('access content'),
'file' => 'media_ahah.inc',
);
// Default settings, for content types that do not have their own.
......@@ -46,9 +44,8 @@ function media_menu() {
'title' => 'Media settings',
'description' => 'Configure Global Media settings, including default content type settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array('media_settings_global', 'global'),
'page arguments' => array('media_settings_global'),
'access arguments' => array('administer media'),
'file' => 'media_settings.inc',
'weight' => 3,
);
......@@ -107,19 +104,16 @@ function media_theme() {
return array(
// The media file browser form.
'media_file_browser' => array(
'file' => 'media_theme.inc',
'arguments' => array('element' => NULL),
),
// The default media file list form element.
'media_file_list' => array(
'file' => 'media_theme.inc',
'arguments' => array('element' => NULL),
),
// The media browser pane.
'media_browser_pane' => array(
'file' => 'media_theme.inc',
'arguments' => array('form' => array()),
),
);
......
......@@ -77,27 +77,23 @@ function media_settings_content_type(&$form, $type_name = NULL) {
/**
* Provide global settings.
*
* Global settings are currently just defaults for content types.
*
* @param array $form
* A form structure.
* @param string $type_name
* Content type name.
* @return array
* @param $form
* A form structure.
* @return
* A form structured array.
*/
function media_settings_global($form = array(), $type_name = NULL) {
// Create global options form structure.
$form = array();
function media_settings_global($form) {
$settings_form = array();
// Global settings are currently just defaults for content types
if ($type_name == 'global') {
$form['media_global_enabled'] = array(
'#title' => t('Media resource browser'),
'#type' => 'checkbox',
'#description' => t('Enable or Disable the Media resource browser for all types, unless specifically set for a given type.'),
'#default_value' => variable_get('media_global_enabled', 1),
);
}
$settings_form['media_global_enabled'] = array(
'#title' => t('Media resource browser'),
'#type' => 'checkbox',
'#description' => t('Enable or Disable the Media resource browser for all types, unless specifically set for a given type.'),
'#default_value' => variable_get('media_global_enabled', 1),
);
return system_settings_form($form);
return system_settings_form($settings_form);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment