Index: mysite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mysite/mysite.module,v
retrieving revision 1.60.2.10
diff -u -p -r1.60.2.10 mysite.module
--- mysite.module	25 Oct 2007 00:52:11 -0000	1.60.2.10
+++ mysite.module	27 Oct 2007 00:14:18 -0000
@@ -1841,101 +1841,103 @@ function mysite_get_content_element($own
  *
  * @ingroup forms
  */
-function mysite_content_settings_form($data) {
+function mysite_content_settings_form($edit) {
   // the default elements are simply the title and format, other plugins may add elements
   $form['data']['title'] = array(
     '#type' => 'textfield',
     '#title' => t('Content title'),
     '#size' => '40',
     '#maxsize' => '240',
-    '#default_value' => $data['title']
+    '#default_value' => $edit['title']
   );
   $form['data']['original'] = array(
     '#type' => 'value',
-    '#value' => $data['title']
+    '#value' => $edit['title']
   );   
   $form['data']['uid'] = array(
     '#type' => 'value',
-    '#value' => $data['uid']
+    '#value' => $edit['uid']
   );   
   // let the administrator lock this item
-  if (user_access('administer mysite') && $data['uid'] == 0) {
+  if (user_access('administer mysite') && $edit['uid'] == 0) {
     $form['data']['locked'] = array(
       '#type' => 'checkbox',
       '#title' => t('Lock item'),
       '#description' => t('Check this option to display this content to all users at all times.'),
-      '#default_value' => $data['locked'],
+      '#default_value' => $edit['locked'],
     );
   }
   // let the user change region (see http://drupal.org/node/155172)
-  $layout = mysite_get_layout($data['uid']);
+  $layout = mysite_get_layout($edit['uid']);
   $options = ($layout['regions']);
   $form['data']['position'] = array(
     '#type' => 'select',
     '#title' => t('Page region'),
     '#options' => $options,
-    '#default_value' => $data['position']
+    '#default_value' => $edit['position']
   );  
   $form['data']['position_original'] = array(
     '#type' => 'value',
-    '#value' => $data['position']
+    '#value' => $edit['position']
   );     
   // formats for the item -- test the data for format options
-  $func = 'mysite_type_'. $data['type'] .'_data';
-  mysite_load_includes('types', $data['type']);
-  $content = $func($data['type_id']);
+  $func = 'mysite_type_'. $edit['type'] .'_data';
+  mysite_load_includes('types', $edit['type']);
+  $content = $func($edit['type_id']);
   // if the content item returns a 'content' element, it cannot be formatted
   if (empty($content['items'][0]['content'])) {
     $options = array();
     $formats = mysite_load_includes('formats');   // these, too
     foreach ($formats as $format) {
-      $options[$format] = module_invoke('mysite_theme', $format);
+      $data = module_invoke('mysite_theme', $format);
+      $options[$format] = $data['format'];
+      $desc[$format] = $data['sample'];
     }
     if ($options != array('default')) {
       $form['data']['format'] = array(
         '#type' => 'radios',
         '#title' => t('Content format'),
-        '#default_value' => $data['format'],
+        '#default_value' => $edit['format'],
         '#options' => $options,
-        '#description' => t("Select a format")
-      );
+        '#description' => array('desc' => t('Select a format.'), 'samples' => $desc)
+      );      
     }
   }
   else {
     $form['data']['format'] = array(
       '#type' => 'value',
-      '#value' => $data['format']
+      '#value' => $edit['format']
     );     
   }
   $form['data']['format_original'] = array(
     '#type' => 'value',
-    '#value' => $data['format']
+    '#value' => $edit['format']
   );    
   $form['data']['sort_original'] = array(
     '#type' => 'value',
-    '#value' => $data['sort']
+    '#value' => $edit['sort']
   );      
   // get elements from plugins, in needed
-  mysite_load_includes('types', $data['type']);
-  if (function_exists('mysite_type_'. $data['type'] .'_content_form')) {
-    $extra = module_invoke('mysite_type', $data['type'] .'_content_form', $data);
+  mysite_load_includes('types', $edit['type']);
+  if (function_exists('mysite_type_'. $edit['type'] .'_content_form')) {
+    $extra = module_invoke('mysite_type', $edit['type'] .'_content_form', $edit);
     $form['data'] = array_merge($form['data'], $extra);
   }
   $form['data']['mid'] = array(
     '#type' => 'value',
-    '#value' => $data['mid']
+    '#value' => $edit['mid']
   );   
   $form['data']['type'] = array(
     '#type' => 'value',
-    '#value' => $data['type']
+    '#value' => $edit['type']
   );   
   $form['data']['type_id'] = array(
     '#type' => 'value',
-    '#value' => $data['type_id']
+    '#value' => $edit['type_id']
   );     
   $form['data']['uid'] = array(
     '#type' => 'value',
-    '#value' => $data['uid']
+    '#value' => $edit['uid']
   );   
   // take the user back where they came from
   $return = 'view';
@@ -1944,8 +1946,8 @@ function mysite_content_settings_form($d
     $return = 'content';
   }
   // take the admin user to the admin screen
-  $uid = $data['uid'];
-  if ($data['uid'] == 0) {
+  $uid = $edit['uid'];
+  if ($edit['uid'] == 0) {
     $uid = 'admin';
     $return = 'content';
   }  
@@ -3571,4 +3573,27 @@ function theme_mysite_edit_format($form)
   $top = drupal_render($form);
   $output = $top . $table . $buttons;
   return $output;
-} 
\ No newline at end of file
+} 
+
+/**
+ * Theme the element configuration form
+ *
+ * @ingroup themes
+ */
+function theme_mysite_content_settings_form($form) {
+  $rows = array();
+  $samples = $form['data']['format']['#description']['samples'];
+  $form['data']['format']['#description'] = $form['data']['format']['#description']['desc'];
+  foreach (element_children($form['data']['format']) as $key) {
+    $row = array();
+    $row[] = drupal_render($form['data']['format'][$key]);
+    $row[] = $samples[$key];
+    $rows[] = $row;
+  }
+  $table = theme('table', array(), $rows);
+  $table .= drupal_render($form['data']['format_update']);
+  $buttons = drupal_render($form['data']['submit']);
+  $top = drupal_render($form);
+  $output = $top . $table . $buttons;
+  return $output;  
+}
\ No newline at end of file
