? sitedoc-coding-standards-150629-1.patch
? sitedoc-css-id-150627-1.patch
? sitedoc-info-fixes-150611-1.patch
? sitedoc-install-fixes-150620-2.patch
Index: sitedoc.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/sitedoc/sitedoc.module,v
retrieving revision 1.9
diff -u -p -r1.9 sitedoc.module
--- sitedoc.module	8 Jun 2007 16:29:25 -0000	1.9
+++ sitedoc.module	9 Jun 2007 23:32:56 -0000
@@ -6,10 +6,9 @@
  */
 function sitedoc_help($section) {
   switch ($section) {
-
     case 'admin/help#sitedoc':
-      $output = '<p>'. t('The sitedoc module allows a site admin to gather extensive information about their site. It may be printed or archived for configuration/change management purposes. It may also be used to add &#8220;fancy&#8221; and up-to-date information to other site documentation, such as a succession plan') .'</p>';
-     return $output ."\n";
+      $output = '<p>'. t('The sitedoc module allows a site admin to gather extensive information about their site. It may be printed or archived for configuration/change management purposes. It may also be used to add "fancy" and up-to-date information to other site documentation, such as a succession plan') .'</p>';
+     return $output;
   }
 }
 
@@ -21,21 +20,10 @@ function sitedoc_perm() {
 }
 
 /**
- * Implementation of hook_access().
- */
-function sitedoc_access($op, $node) {
-  global $user;
-
-  if ($op == 'view') { return user_access('view site documentation'); }
-  else { return FALSE; }
-}
-
-/**
  * Implementation of hook_menu().
- *  add a menu item to the Administer >> Site configuration menu for displaying the sitedoc
  */
 function sitedoc_menu($may_cache) {
- $items = array();
+  $items = array();
 
   if ($may_cache) {
     drupal_add_css(drupal_get_path('module', 'sitedoc') .'/sitedoc.css');
@@ -45,7 +33,7 @@ function sitedoc_menu($may_cache) {
       'description' => t('Show site documentation'),
       'callback' => 'sitedoc_list',
       'access' => user_access('view site documentation'),
-      );
+    );
     $items[] = array(
       'path' => 'admin/settings/sitedoc',
       'title' => t('Site documentation settings'),
@@ -53,8 +41,8 @@ function sitedoc_menu($may_cache) {
       'callback' => 'drupal_get_form',
       'callback arguments' => array('sitedoc_settings_form'),
       'access' => user_access('view site documentation'),
-      );  
-   }
+    );  
+  }
   else {
     $items[] = array(
       'path' => 'admin/build/sitedoc_node_access_view',
@@ -64,54 +52,56 @@ function sitedoc_menu($may_cache) {
       'callback arguments' => array(arg(3)),
       'access' => user_access('view site documentation'),
       'type' => MENU_CALLBACK,
-      );
-   }
+    );
+  }
+
   return $items;
 }
 
-/***************************/
-/**   settings function   **/
-/***************************/
+/**
+ * Settings function.
+ */
 function sitedoc_settings_form() {
   drupal_add_css(drupal_get_path('module', 'sitedoc') .'/sitedoc.css');
   $_default_settings = array(
-                             'drupal_section' => TRUE,
-                               'kill_cron' => 0,                /* kill long-running cron */
-                             'table_section' => TRUE,
-                               'optimize_tables' => FALSE,      /* use OPTIMIZE to release overhead */
-                             'sequences_section' => FALSE,   /* not on because not much interest */
-                             'node_section' => FALSE,        /* not on because of expense */
-                               'include_comment_count' => FALSE,     /* comment count on nodes */
-                               'include_node_access' => FALSE,       /* node access summary */
-                               'node_show_size' => 99999,       /* show nodes exceeding x KB */
-                               'node_max_size' => 50,           /* warn if nodes exceeding x KB */
-                             'module_section' => TRUE,
-                               'module_suppress' => FALSE,      /* exclude disabled modules */
-                             'content_section' => TRUE,
-                             'vocabulary_section' => TRUE,
-                               'orphan_term_node' => FALSE,    /* not on to allow control */
-                               'delete_orphan_term_nodes' => FALSE,  /* do not delete orphans  */
-                             'theme_section' => TRUE,
-                             'variables_section' => FALSE,   /* not on because of expense */
-                             'block_section' => TRUE,
-                               'block_warn' => TRUE,        /* warn on missing theme */
-                               'block_delete' => FALSE,     /* delete those orphan blocks */
-                             'roles_section' => TRUE,
-                               'role_users' => TRUE,        /* list users in roles */
-                               'role_perms_list' => FALSE,  /* do role permissions as stream */
-                             'contacts_section' => TRUE,
-                             'profile_fields_section' => FALSE,  /* not on because of interest */
-                             'url_alias_section' => FALSE,    /* not on because of expense */
-    //                    Archive options
-                             'archive_frequency' => 0,        /* only run manually */
-                             'archive_directory' => 'sitedoc',  /* archive directory within file setting */ 
-                         );
-  // merge the defaults with the settings.
-  // if settings exist, they will replace the defaults.
-  // this is done in case new functions are added - it will merge in the new default values.
+    'drupal_section' => TRUE,
+    'kill_cron' => 0,                     // Kill long-running cron.
+    'table_section' => TRUE,
+    'optimize_tables' => FALSE,           // Use OPTIMIZE to reduce overhead.
+    'sequences_section' => FALSE,         // Not on because not much interest.
+    'node_section' => FALSE,              // Not on because of expense.
+    'include_comment_count' => FALSE,     // Comment count on nodes.
+    'include_node_access' => FALSE,       // Node access summary.
+    'node_show_size' => 99999,            // Show nodes exceeding x KB.
+    'node_max_size' => 50,                // Warn if nodes exceeding x KB.
+    'module_section' => TRUE,
+    'module_suppress' => FALSE,           // Exclude disabled modules.
+    'content_section' => TRUE,
+    'vocabulary_section' => TRUE,
+    'orphan_term_node' => FALSE,          // Not on to allow control.
+    'delete_orphan_term_nodes' => FALSE,  // Do not delete orphans.
+    'theme_section' => TRUE,
+    'variables_section' => FALSE,         // Not on because of expense.
+    'block_section' => TRUE,
+    'block_warn' => TRUE,                 // Warn on missing theme.
+    'block_delete' => FALSE,              // Delete those orphan blocks.
+    'roles_section' => TRUE,
+    'role_users' => TRUE,                 // List users in roles.
+    'role_perms_list' => FALSE,           // Do role permissions as stream.
+    'contacts_section' => TRUE,
+    'profile_fields_section' => FALSE,    // Not on because of interest.
+    'url_alias_section' => FALSE,         // Not on because of expense.
+    // Archive options.
+    'archive_frequency' => 0,             // Only run manually.
+    'archive_directory' => 'sitedoc',     // Archive directory within file setting.
+  );
+
+  // Merge the defaults with the settings.
+  // If settings exist, they will replace the defaults.
+  // This is done in case new functions are added - it will merge in the new default values.
   $sitedoc_settings = array_merge($_default_settings , variable_get('sitedoc_settings', array()));
 
-// ----------------------- Sections Fieldset -----------------------
+  // Sections Fieldset.
   $form['sections'] = array(
     '#type' => 'fieldset', 
     '#title' => t('Show Sections'), 
@@ -362,7 +352,7 @@ function sitedoc_settings_form() {
     );
    }
 
-// ----------------------- Archive Fieldset -----------------------
+  // Archive Fieldset.
   $form['archive'] = array(
     '#type' => 'fieldset', 
     '#title' => t('Archive Options'), 
@@ -397,7 +387,7 @@ function sitedoc_settings_form() {
     '#description' => t('This is directory within \'!filepath\' where the Site Documentation module will place the archive file. The current date will be appended to the file name.', array('!filepath' => variable_get('file_directory_path', 'files'))),
   );
 
-// ----------------------- Update Button -----------------------
+  // Update Button.
   $form['update']['attach'] = array(
     '#type' => 'submit',
     '#value' => t('Update'),
@@ -410,61 +400,59 @@ function sitedoc_settings_form() {
 
 /**
  * Validate the submission.
- *
  */
 function sitedoc_settings_form_validate($form_id, $form_values) {
   $archive_path = variable_get('file_directory_path', 'files') .'/'. $form_values['archive_directory'];
   if (!file_check_directory($archive_path, TRUE, 'archive_directory')) {
     form_set_error('archive_directory', t('The archive path could not be found or could not be created.'));
-   }  /* end path not found */
+   }
 }
 
 /**
  * Save the settings values.
  */
 function sitedoc_settings_form_submit($form_id, $form_values) {
-// update the settings array and save it
+  // Update the settings array and save it.
   $sitedoc_settings = array(
-                            'drupal_section' => $form_values['drupal_section'],
-                              'kill_cron' => $form_values['kill_cron'],
-                            'table_section' => $form_values['table_section'],
-                               'optimize_tables' => $form_values['optimize_tables'],
-                            'sequences_section' => $form_values['sequences_section'],
-                            'node_section' => $form_values['node_section'],
-                              'include_comment_count' => $form_values['include_comment_count'],
-                              'include_node_access' => $form_values['include_node_access'],
-                              'node_show_size' => $form_values['node_show_size'],
-                              'node_max_size' => $form_values['node_max_size'],
-                            'module_section' => $form_values['module_section'],
-                              'module_suppress' => $form_values['module_suppress'],
-                            'content_section' => $form_values['content_section'],
-                            'vocabulary_section' => $form_values['vocabulary_section'],
-                              'orphan_term_node' => $form_values['orphan_term_node'],
-                              'delete_orphan_term_nodes' => $form_values['delete_orphan_term_nodes'],
-                            'theme_section' => $form_values['theme_section'],
-                            'variables_section' => $form_values['variables_section'],
-                            'block_section' => $form_values['block_section'],
-                              'block_warn' => $form_values['block_warn'],
-                              'block_delete' => $form_values['block_delete'],
-                            'roles_section' => $form_values['roles_section'],
-                              'role_users' => $form_values['role_users'],
-                              'role_perms_list' => $form_values['role_perms_list'],
-                            'contacts_section' => $form_values['contacts_section'],
-                            'profile_fields_section' => $form_values['profile_fields_section'],
-                            'url_alias_section' => $form_values['url_alias_section'],
-
-                            'archive_frequency' => $form_values['archive_frequency'],
-                            'archive_directory' => $form_values['archive_directory'],
-                        );
+    'drupal_section' => $form_values['drupal_section'],
+    'kill_cron' => $form_values['kill_cron'],
+    'table_section' => $form_values['table_section'],
+    'optimize_tables' => $form_values['optimize_tables'],
+    'sequences_section' => $form_values['sequences_section'],
+    'node_section' => $form_values['node_section'],
+    'include_comment_count' => $form_values['include_comment_count'],
+    'include_node_access' => $form_values['include_node_access'],
+    'node_show_size' => $form_values['node_show_size'],
+    'node_max_size' => $form_values['node_max_size'],
+    'module_section' => $form_values['module_section'],
+    'module_suppress' => $form_values['module_suppress'],
+    'content_section' => $form_values['content_section'],
+    'vocabulary_section' => $form_values['vocabulary_section'],
+    'orphan_term_node' => $form_values['orphan_term_node'],
+    'delete_orphan_term_nodes' => $form_values['delete_orphan_term_nodes'],
+    'theme_section' => $form_values['theme_section'],
+    'variables_section' => $form_values['variables_section'],
+    'block_section' => $form_values['block_section'],
+    'block_warn' => $form_values['block_warn'],
+    'block_delete' => $form_values['block_delete'],
+    'roles_section' => $form_values['roles_section'],
+    'role_users' => $form_values['role_users'],
+    'role_perms_list' => $form_values['role_perms_list'],
+    'contacts_section' => $form_values['contacts_section'],
+    'profile_fields_section' => $form_values['profile_fields_section'],
+    'url_alias_section' => $form_values['url_alias_section'],
+    'archive_frequency' => $form_values['archive_frequency'],
+    'archive_directory' => $form_values['archive_directory'],
+  );
   variable_set('sitedoc_settings', $sitedoc_settings);
 
   drupal_set_message(t('Configuration has been updated.'), 'notice'); 
 }
 
 
-/***********************/
-/**   main function   **/
-/***********************/
+/**
+ * Main function.
+ */
 function sitedoc_list() {
   drupal_add_css(drupal_get_path('module', 'sitedoc') .'/sitedoc.css');
 
@@ -475,26 +463,26 @@ function sitedoc_list() {
   $output = '<div class="site-documentation">';
 //  drupal_set_title(t('Site Documentation - ') . format_date(time()));
 
-  // get basic Drupal info
+  // Get basic Drupal info.
   if ($sitedoc_settings['drupal_section']) {
     $output .= '<div class="sitedoc_drupal">';
     $output .= sitedoc_drupal($sitedoc_settings['kill_cron']);
     $output .= "</div>\n";
-   }
+  }
 
   // get database info
   if ($sitedoc_settings['table_section']) {
     $output .= '<div class="sitedoc_database_overview">';
     $output .= sitedoc_database_overview($sitedoc_settings['optimize_tables']);
     $output .= "</div>\n";
-   }
+  }
  
-   // get info from the sequences table (last used item number)
+  // get info from the sequences table (last used item number)
   if ($sitedoc_settings['sequences_section']) {
     $output .= '<div class="sitedoc_sequences">';
     $output .= sitedoc_sequences();
     $output .= "</div>\n";
-   }
+  }
  
   // get summary of all nodes (this is VERY expensive!)
   if ($sitedoc_settings['node_section']) {
@@ -502,7 +490,7 @@ function sitedoc_list() {
     $output .= sitedoc_node_summary($sitedoc_settings['include_comment_count'],
                                     $sitedoc_settings['node_show_size'],
                                     $sitedoc_settings['node_max_size']
-                  );
+    );
     $output .= "</div>\n";
  
     // get node access summary  (this is expensive!)
@@ -554,12 +542,12 @@ function sitedoc_list() {
     $output .= '<div class="sitedoc_variables">';
     $output .= sitedoc_get_variables();
     $output .= "</div>\n";
-   }
+  }
 
   // get blocks info from Blocks table
   if ($sitedoc_settings['block_section']) {  /* controls block and boxes */
     $output .= '<div class="sitedoc_blocks">';
-      // use the setting to decide on a warning for missing themes
+    // use the setting to decide on a warning for missing themes
     $output .= sitedoc_get_blocks($sitedoc_settings['block_warn'], $sitedoc_settings['block_delete']);
     $output .= "</div>\n";
 
@@ -766,7 +754,7 @@ function sitedoc_drupal($kill_cron=0) {
   $rows[] = array(t('Zip support'), $_abled[extension_loaded('zip')]);
   $rows[] = array(t('Zlib support'), $_abled[extension_loaded('zlib')]);
 
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
 
   return $output ."\n";
 }
@@ -810,7 +798,7 @@ function sitedoc_database_overview($opti
   $privileges = trim(str_replace('GRANT', ' ', substr($grants, 0, strpos($grants, ' ON'))));
   $rows[] = array(t('Privileges'), $privileges);
 
-  $output .= theme_table($header, $rows) ."\n";
+  $output .= theme('table', $header, $rows) ."\n";
   $output .= '<h3>'. t('Table Status') ."</h3>\n";
 
  // I used a class to align fields rather than 'align' because the Garland theme overrides my 'align' in headers.
@@ -870,7 +858,7 @@ function sitedoc_database_overview($opti
              array('data' => number_format($indexlen), 'class' => 'sitedoc_right'),
              array('data' => number_format($overhead), 'class' => 'sitedoc_right'),
             );
-  $output .= theme_table($header, $rows) ."\n<p>";
+  $output .= theme('table', $header, $rows) ."\n<p>";
 
   $totsize = $datalen + $indexlen;
   $kb = $totsize / 1024;
@@ -976,7 +964,7 @@ function sitedoc_get_modules($exclude_di
    else { $disabled_count ++; }
    } /* end foreach module */
   
-  $output .= '<h3>'. t('Modules') .'</h3>'. theme_table($header, $rows);
+  $output .= '<h3>'. t('Modules') .'</h3>'. theme('table', $header, $rows);
   if ($exclude_disabled) { $output .= '<p>'. $disabled_count . t(' disabled modules exluded.') .'</p>'; }
   return $output;
 }
@@ -1013,7 +1001,7 @@ function sitedoc_get_system($type=null) 
                  $mod['description']
          );
      } /* end while */
-    $output .=  theme_table($header, $rows);
+    $output .=  theme('table', $header, $rows);
    } /* end if */
   else { $output .= t('No entries found! Very curious.'); }
   return $output ."\n";
@@ -1114,7 +1102,7 @@ function sitedoc_get_blocks($warn=TRUE, 
       else { $del .= $delsql; }
      }
    } /* end while */
-  $output .=  theme_table($header, $rows);
+  $output .=  theme('table', $header, $rows);
   if ($missing_theme && $warn) { drupal_set_message(t('Blocks defined for non-existent theme(s)'), 'warning'); }
 
   if ($missing_theme && !$delete) { $output .= '<p>'. $del .'</p>'; }
@@ -1149,7 +1137,7 @@ function sitedoc_get_boxes() {
                     highlight_string($box['body'], TRUE),
                 );
    }
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
   return $output ."\n";
 }
 
@@ -1212,7 +1200,7 @@ function sitedoc_content_types() {  
   if ($missing) { drupal_set_message($num_contents . t(' content types found. Missing modules identified.'), 'warning'); }
   else { drupal_set_message($num_contents . t(' content types found.'), 'notice'); }
 
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
 
   return $output ."\n";
 }
@@ -1254,7 +1242,7 @@ function sitedoc_get_vocabularies() {
                  $vocabulary->weight,
     );
    }  /* end foreach vocab */
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
   return $output ."\n";
 }
 
@@ -1279,7 +1267,7 @@ function _terms_list($vid) {
        }
    } /* end foreach */
 
-  return "\n". theme_table($thead, $items);
+  return "\n". theme('table', $thead, $items);
 }
 
 /**
@@ -1314,7 +1302,7 @@ function sitedoc_check_orphan_term_node(
      else { $del .= $delsql; }
      $rows[] = array($tn['nid'], $tn['tid'], $term->name, $vocab->name, $del);
    } /* end while */
-  $output = theme_table($header, $rows);
+  $output = theme('table', $header, $rows);
   if (!$delete_orphans) { $output .= $del; }
   return $output ."\n";
 }
@@ -1342,7 +1330,7 @@ function sitedoc_sequences() {
                 );
    } /* end while */
 
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
   return $output ."\n";
 }
 
@@ -1445,7 +1433,7 @@ function sitedoc_node_summary($comment=F
                   $comment ? array('data' => $com, 'class' => 'sitedoc_right') : NULL,
               );
   $output = '<h3>'. t('Node Summary') ."</h3>\n";
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
 
   if ($toobig) {
     $output .= '<p><img src="/misc/watchdog-warning.png" width="17" height="17"> '
@@ -1460,7 +1448,7 @@ function sitedoc_node_summary($comment=F
                     t('Length (KB)'),
                 );
     $output .= '<h5>'. t('Large Nodes') ."</h5>\n"
-               . theme_table($big_head, $biggies);
+               . theme('table', $big_head, $biggies);
    } /* end biggie check */
 
   return $output ."\n";
@@ -1515,7 +1503,7 @@ function sitedoc_node_access() {
     while ($row = db_fetch_object($result)) {
       $rows[] = array($row->realm);
      } /* end while */
-    $output .= theme_table($headers, $rows);
+    $output .= theme('table', $headers, $rows);
    } /* end all nodes */
 
     $headers = array(t('Realm'),
@@ -1541,7 +1529,7 @@ function sitedoc_node_access() {
        }
       $rows[] = array($row->realm, l($row->node_count, 'admin/build/sitedoc_node_access_view/'. $row->realm) .' '. $realm_type, $caption);
      } /* end while */
-   if ($all && count($rows) > 1) { $output .= theme_table($headers, $rows); }
+   if ($all && count($rows) > 1) { $output .= theme('table', $headers, $rows); }
   }
 
   return $output ."\n";
@@ -1580,7 +1568,7 @@ function sitedoc_node_access_view($realm
                     l($node->title, 'node/'. $node->nid .'/edit'),
                 );
    } /* end while node */
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
   $output .= theme('pager', array(), 50);
 
   return $output ."\n";
@@ -1645,7 +1633,7 @@ function sitedoc_get_roles() {
                  );
    } /* end while role */
   
-  $output = '<h3>'. t('Roles and Permissions') .'</h3>'. theme_table($header, $rows);
+  $output = '<h3>'. t('Roles and Permissions') .'</h3>'. theme('table', $header, $rows);
   return $output ."\n";
 }
 
@@ -1676,7 +1664,7 @@ function sitedoc_get_variables() {
     $rows[] = array($name, $value);
    } /* end foreach */
 
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
   return $output ."\n";
 }
 
@@ -1714,7 +1702,7 @@ function _handle_array(&$array) {
     $rows[] = array($name, $value);
    } /* end foreach */
 
-  return theme_table($header, $rows);
+  return theme('table', $header, $rows);
 }
 
 /**
@@ -1749,7 +1737,7 @@ function sitedoc_get_contacts() {
                  );
    } /* end while role */
   
-  $output = '<h3>'. t('Contacts') .'</h3>'. theme_table($header, $rows);
+  $output = '<h3>'. t('Contacts') .'</h3>'. theme('table', $header, $rows);
   return $output ."\n";
 }
 
@@ -1804,7 +1792,7 @@ function sitedoc_profile_fields() {
   while ($field = db_fetch_object($result)) {
     if ($field->category <> $save_cat) {
       if (!empty($save_cat)) { /* flush previous rows, if any */
-        $output .= theme_table($header, $rows);
+        $output .= theme('table', $header, $rows);
        } /* end flush rows */
       $output .= '<h4>'. t('Category: ') . $field->category .'</h4>';
       $save_cat = $field->category;
@@ -1826,7 +1814,7 @@ function sitedoc_profile_fields() {
                 );
    } /* end while field */
   
-  if (count($rows)) { $output .= theme_table($header, $rows); }
+  if (count($rows)) { $output .= theme('table', $header, $rows); }
   return $output ."\n";
 }
 
@@ -1917,7 +1905,7 @@ function sitedoc_url_alias() {
                 );
    } /* end while path */
   
-  $output .= theme_table($header, $rows);
+  $output .= theme('table', $header, $rows);
 
 //  now run through the nodes to see if they have an alias 
   $rows = array();
@@ -1944,4 +1932,3 @@ function sitedoc_url_alias() {
 
   return $output ."\n";
 }
-?>
\ No newline at end of file
