Index: amazon_s3.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/amazon_s3/amazon_s3.info,v
retrieving revision 1.1
diff -u -p -r1.1 amazon_s3.info
--- amazon_s3.info	18 Jun 2009 00:38:27 -0000	1.1
+++ amazon_s3.info	31 May 2010 19:58:37 -0000
@@ -1,3 +1,5 @@
 name = Amazon S3
 description = Provides an API for Amazon's Simple Storage Service
-core = 6.x
\ No newline at end of file
+core = 7.x
+files[] = amazon_s3.module
+files[] = amazon_s3.css
Index: amazon_s3.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/amazon_s3/amazon_s3.module,v
retrieving revision 1.1
diff -u -p -r1.1 amazon_s3.module
--- amazon_s3.module	18 Jun 2009 00:38:27 -0000	1.1
+++ amazon_s3.module	31 May 2010 19:58:37 -0000
@@ -14,7 +14,7 @@ function amazon_s3_init() {
  */
 function amazon_s3_menu() {
   
-  $items['admin/settings/amazon-s3'] = array(
+  $items['admin/config/amazon-s3'] = array(
     'title' => 'Amazon S3 Configuration',
     'description' => t('Authentication settings for Amazon S3'),
     'page callback' => 'drupal_get_form',
@@ -23,7 +23,7 @@ function amazon_s3_menu() {
     'type' => MENU_NORMAL_ITEM,
   );
   
-  $items['admin/build/amazon-s3'] = array(
+  $items['admin/structure/amazon-s3'] = array(
     'title' => 'Amazon S3 Buckets',
     'description' => t('View the buckets on your Amazon S3 account.'),
     'page callback' => 'amazon_s3_view_buckets',
@@ -31,7 +31,7 @@ function amazon_s3_menu() {
     'type' => MENU_NORMAL_ITEM,
   );
   
-  $items['admin/build/amazon-s3/bucket/%'] = array(
+  $items['admin/structure/amazon-s3/bucket/%'] = array(
     'title' => 'Bucket Contents',
     'description' => t('View the objects in a bucket on your Amazon S3 account.'),
     'page callback' => 'amazon_s3_view_objects',
@@ -40,7 +40,7 @@ function amazon_s3_menu() {
     'type' => MENU_CALLBACK,
   );
   
-  $items['admin/build/amazon-s3/bucket/%/delete'] = array(
+  $items['admin/structure/amazon-s3/bucket/%/delete'] = array(
     'title' => 'Delete Bucket',
     'description' => t('Delete a bucket.'),
     'page callback' => 'drupal_get_form',
@@ -49,7 +49,7 @@ function amazon_s3_menu() {
     'type' => MENU_CALLBACK, 
   );
   
-  $items['admin/build/amazon-s3/bucket/%/%/delete'] = array(
+  $items['admin/structure/amazon-s3/bucket/%/%/delete'] = array(
     'title' => 'Delete Object in Bucket',
     'description' => t('Delete an object in a bucket.'),
     'page callback' => 'drupal_get_form',
@@ -64,11 +64,20 @@ function amazon_s3_menu() {
 /**
  * Implementation of hook_perm()
  */
-function amazon_s3_perm() {
-  return array('administer amazon s3');
+function amazon_s3_permission() {
+  return array(
+    'administer amazon s3' => array(
+      'title' => t('Administer Amazon S3'),
+      'description' => t('Configuration for Amazon S3.'),
+      'restrict access' => TRUE,
+    ),
+  );
 }
 
-/*Amazon S3 API Functions*/
+/**
+ * Amazon S3 API Functions
+ */
+
 /**
  * Get the instance of the s3 object.
  *
@@ -82,7 +91,7 @@ function amazon_s3_get_instance() {
     $aws_secret_key = variable_get('aws_secret_key', '');
     
     if (empty($aws_access_key) OR empty($aws_secret_key)) {
-      drupal_set_message('You must ' . l('set your aws access key and secret key', 'admin/settings/amazon-s3') . '.', 'error');
+      drupal_set_message('You must ' . l('set your aws access key and secret key', 'admin/config/amazon-s3') . '.', 'error');
     }
     
     $s3 = new S3($aws_access_key, $aws_secret_key);
@@ -124,7 +133,10 @@ function amazon_s3_acl_options() {
   );
 }
 
-/*Forms*/
+/**
+ * Forms
+ */
+
 function amazon_s3_bucket_create_form() {
   $form['bucket'] = array(
     '#type' => 'textfield',
@@ -148,12 +160,12 @@ function amazon_s3_bucket_create_form_su
   return amazon_s3_bucket_create($bucket_name, $access_control);
 }
 
-function amazon_s3_bucket_delete_confirm_form($form, $bucket) {
+function amazon_s3_bucket_delete_confirm_form($form, &$form_state, $bucket) {
   $form = array(
     'bucket' => array('#type' => 'value', '#value' => $bucket),
   );
   $confirmation_message = t('Are you sure you want to delete the bucket %bucket?', array('%bucket' => $bucket));
-  $cancel_path = 'admin/build/amazon-s3/buckets';
+  $cancel_path = 'admin/structure/amazon-s3/buckets';
   return confirm_form($form, $confirmation_message, $cancel_path);
 }
 
@@ -170,16 +182,16 @@ function amazon_s3_bucket_delete_confirm
     drupal_set_message($message, 'error');
   }
   
-  $form_state['redirect'] = "admin/build/amazon-s3/buckets";
+  $form_state['redirect'] = "admin/structure/amazon-s3/buckets";
 }
 
-function amazon_s3_object_delete_confirm_form($form, $bucket, $object) {
+function amazon_s3_object_delete_confirm_form($form, &$form_state, $bucket, $object) {
   $form = array(
     'bucket' => array('#type' => 'value', '#value' => $bucket),
     'object' => array('#type' => 'value', '#value' => $object),
   );
   $confirmation_message = t("Are you sure you want to delete the object %object from the bucket %bucket?", array('%object' => $object, '%bucket' => $bucket));
-  $cancel_path = "admin/build/amazon-s3/bucket/$bucket";
+  $cancel_path = "admin/structure/amazon-s3/bucket/$bucket";
   $form = confirm_form($form, $confirmation_message, $cancel_path);
   return $form;
 }
@@ -198,10 +210,10 @@ function amazon_s3_object_delete_confirm
     drupal_set_message($message, 'error');
   }
   
-  $form_state['redirect'] = "admin/build/amazon-s3/bucket/$bucket";
+  $form_state['redirect'] = "admin/structure/amazon-s3/bucket/$bucket";
 }
 
-function amazon_s3_file_upload_form($form, $bucket) {
+function amazon_s3_file_upload_form($form, &$form_state, $bucket) {
   $form = array();
   $form['#attributes'] = array('enctype' => 'multipart/form-data');
   $form['box'] = array(
@@ -244,7 +256,7 @@ function amazon_s3_file_upload_form_subm
     drupal_set_message($message, 'error');
   }
   
-  $form_state['redirect'] = "admin/build/amazon-s3/bucket/$bucket";
+  $form_state['redirect'] = "admin/structure/amazon-s3/bucket/$bucket";
 }
 
 function amazon_s3_config_form() {
@@ -273,21 +285,22 @@ function amazon_s3_config_form_submit($f
   drupal_set_message('Successfully saved changes.');
 }
 
-/*Page Callbacks for hook_menu*/
+/**
+ * Page Callbacks for hook_menu
+*/
+
 function amazon_s3_view_buckets() {
   $bucket_names = amazon_s3_get_buckets();
   $buckets = array();
   foreach ($bucket_names as $bucket_name) {
     $buckets[] = array(
       'name' => $bucket_name,
-      'view_objects' => l('View Objects', "admin/build/amazon-s3/bucket/$bucket_name"),
-      'delete' => l('Delete', "admin/build/amazon-s3/bucket/$bucket_name/delete"),
+      'view_objects' => l('View Objects', "admin/structure/amazon-s3/bucket/$bucket_name"),
+      'delete' => l('Delete', "admin/structure/amazon-s3/bucket/$bucket_name/delete"),
     );
   }
-  
-  $table = theme('table', array('Name', 'View Objects', 'Delete'), $buckets);
-  $bucket_create_form = drupal_get_form('amazon_s3_bucket_create_form');
-  
+  $table = theme('table', array('header' => array('Name', 'View Objects', 'Delete'), 'rows' => $buckets));
+  $bucket_create_form = drupal_render(drupal_get_form('amazon_s3_bucket_create_form'));
   return $bucket_create_form . $table;
 }
 
@@ -295,17 +308,13 @@ function amazon_s3_view_objects($bucket)
   $s3 = amazon_s3_get_instance();
   $objects = $s3->getBucket($bucket, NULL, NULL, 100);
   foreach ($objects as &$object) {
-    $object['time'] = date("F j, Y, g:i a", $object['time']);
+    $object['time'] = format_date($object['time'], 'custom', "F j, Y, g:i a");
     $object['size'] = format_size($object['size']);
     $object['download'] = l('Download', amazon_s3_get_object_url($bucket, $object['name']));
-    $object['delete'] = l('Delete', "admin/build/amazon-s3/bucket/$bucket/{$object['name']}/delete");
+    $object['delete'] = l('Delete', "admin/structure/amazon-s3/bucket/$bucket/{$object['name']}/delete");
   }
-  
-  $table = theme('table', array(
-    'Name', 'Time', 'Size', 'Hash', 'Download', 'Delete',
-  ), $objects);
-  
-  $file_upload_form = drupal_get_form('amazon_s3_file_upload_form', $bucket);
-  
+  $header = array('Name', 'Time', 'Size', 'Hash', 'Download', 'Delete');
+  $table = theme('table', array('header' => $header, 'rows' => $objects));
+  $file_upload_form = drupal_render(drupal_get_form('amazon_s3_file_upload_form', $bucket));
   return $file_upload_form . $table;
 }
