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 @@ ...@@ -2,4 +2,9 @@
July 2009 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). * Untested rough sync up with D6 branch (jmstacey).
\ No newline at end of file
...@@ -7,4 +7,6 @@ core = 7.x ...@@ -7,4 +7,6 @@ core = 7.x
php = 5.2 php = 5.2
files[] = media.install files[] = media.install
files[] = media.module files[] = media.module
files[] = media_ahah.inc files[] = media_ahah.inc
\ No newline at end of file files[] = media_settings.inc
files[] = media_theme.inc
\ No newline at end of file
...@@ -33,12 +33,10 @@ function media_menu() { ...@@ -33,12 +33,10 @@ function media_menu() {
$items['media/js'] = array( $items['media/js'] = array(
'page callback' => 'media_ahah_formatter_load', 'page callback' => 'media_ahah_formatter_load',
'access arguments' => array('access content'), 'access arguments' => array('access content'),
'file' => 'media_ahah.inc',
); );
$items['media/metadata/js'] = array( $items['media/metadata/js'] = array(
'page callback' => 'media_ahah_metadata_ahah', 'page callback' => 'media_ahah_metadata_ahah',
'access arguments' => array('access content'), 'access arguments' => array('access content'),
'file' => 'media_ahah.inc',
); );
// Default settings, for content types that do not have their own. // Default settings, for content types that do not have their own.
...@@ -46,9 +44,8 @@ function media_menu() { ...@@ -46,9 +44,8 @@ function media_menu() {
'title' => 'Media settings', 'title' => 'Media settings',
'description' => 'Configure Global Media settings, including default content type settings.', 'description' => 'Configure Global Media settings, including default content type settings.',
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('media_settings_global', 'global'), 'page arguments' => array('media_settings_global'),
'access arguments' => array('administer media'), 'access arguments' => array('administer media'),
'file' => 'media_settings.inc',
'weight' => 3, 'weight' => 3,
); );
...@@ -107,19 +104,16 @@ function media_theme() { ...@@ -107,19 +104,16 @@ function media_theme() {
return array( return array(
// The media file browser form. // The media file browser form.
'media_file_browser' => array( 'media_file_browser' => array(
'file' => 'media_theme.inc',
'arguments' => array('element' => NULL), 'arguments' => array('element' => NULL),
), ),
// The default media file list form element. // The default media file list form element.
'media_file_list' => array( 'media_file_list' => array(
'file' => 'media_theme.inc',
'arguments' => array('element' => NULL), 'arguments' => array('element' => NULL),
), ),
// The media browser pane. // The media browser pane.
'media_browser_pane' => array( 'media_browser_pane' => array(
'file' => 'media_theme.inc',
'arguments' => array('form' => array()), 'arguments' => array('form' => array()),
), ),
); );
......
...@@ -77,27 +77,23 @@ function media_settings_content_type(&$form, $type_name = NULL) { ...@@ -77,27 +77,23 @@ function media_settings_content_type(&$form, $type_name = NULL) {
/** /**
* Provide global settings. * Provide global settings.
*
* Global settings are currently just defaults for content types.
* *
* @param array $form * @param $form
* A form structure.
* @param string $type_name
* Content type name.
* @return array
* A form structure. * A form structure.
* @return
* A form structured array.
*/ */
function media_settings_global($form = array(), $type_name = NULL) { function media_settings_global($form) {
// Create global options form structure. $settings_form = array();
$form = array();
// Global settings are currently just defaults for content types $settings_form['media_global_enabled'] = array(
if ($type_name == 'global') { '#title' => t('Media resource browser'),
$form['media_global_enabled'] = array( '#type' => 'checkbox',
'#title' => t('Media resource browser'), '#description' => t('Enable or Disable the Media resource browser for all types, unless specifically set for a given type.'),
'#type' => 'checkbox', '#default_value' => variable_get('media_global_enabled', 1),
'#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