Index: contributions/modules/sections/sections.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sections/sections.module,v
retrieving revision 1.16
diff -u -p -r1.16 sections.module
--- contributions/modules/sections/sections.module	8 Dec 2006 23:46:52 -0000	1.16
+++ contributions/modules/sections/sections.module	9 Mar 2007 01:12:42 -0000
@@ -7,16 +7,6 @@
  */
 
 /**
- * Implementation of hook_help().
- */
-function sections_help($section) {
-  switch ($section) {
-    case 'admin/modules#description':
-      return t('Allows you to define sections of your site and apply themes to those sections.');
-  }
-}
-
-/**
  * Declare administrative settings for a module.
  *
  * This hook provides an administrative interface for controlling various
@@ -47,22 +37,24 @@ function sections_list() {
   }
 
   $output = theme('table', $header, $rows);
-  return $output;}
+  return $output;
+}
 
 function sections_settings_form($edit = NULL, $section = NULL) {
   if ($section) {
     $edit = (array)$section;
+    drupal_set_title(t('Edit %name', array('%name' => $section->name)));
   }
   $access = user_access('use PHP for block visibility');
   $form = array();
 
-  $options = array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.'));
-  $description = t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => theme('placeholder', 'blog'), '%blog-wildcard' =>  theme('placeholder', 'blog/*'), '%front' => theme('placeholder', '<front>')));
+    $options = array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.'));
+    $description = t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
 
-  if ($access) {
-    $options[] = t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).');
-    $description .= ' '. t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => theme('placeholder', '<?php ?>')));
-  }
+    if ($access) {
+      $options[] = t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).');
+      $description .= ' '. t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '<?php ?>'));
+    }
 
   $form['section_settings'] = array(
     '#type' => 'fieldset',
@@ -125,11 +117,11 @@ function sections_settings_form($edit = 
     $form['submit'] = array('#type' => 'submit', '#value' => t('Add section'));
   }
 
-  print theme('page', drupal_get_form('section_settings', $form));
+  return $form;
 }
 
 
-function section_settings_submit($id, $edit) {
+function sections_settings_form_submit($id, $edit) {
   switch ($_POST['op']) {
     case t('Save section'):
       db_query("UPDATE {sections_data} SET name = '%s', status = '%d', visibility = '%d', template = '%s', path = '%s', weight = %d WHERE sid = '%d'", $edit['name'], $edit['status'], $edit['visibility'], $edit['template'], $edit['path'], $edit['weight'], $edit['sid']);
@@ -140,7 +132,7 @@ function section_settings_submit($id, $e
     case t('Add section'):
       $edit['sid'] = db_next_id('{sections_id}');
       db_query("INSERT INTO {sections_data} SET sid = '%d', name = '%s', status = '%d', visibility = '%d', path = '%s', template = '%s', weight = %d", $edit['sid'], $edit['name'], $edit['status'], $edit['visibility'], $edit['path'], $edit['template'], $edit['weight']);
-      drupal_set_message('The sections configuration has been saved.');
+      drupal_set_message(t('The section %name has been added.', array('%name' => $edit['name'])));
       cache_clear_all();
       menu_rebuild();
       drupal_goto('admin/settings/sections/');
@@ -149,31 +141,37 @@ function section_settings_submit($id, $e
 }
 
 function _sections_delete($section) {
+  
   $op = $_POST['op'];
 
   switch ($op) {
     case t('Delete'):
       db_query('DELETE FROM {sections_data} WHERE sid = %d', $section->sid);
-      drupal_set_message(t('The section %name has been deleted.', array('%name' => '<em>'. $section->name .'</em>')));
+      drupal_set_message(t('The section %name has been deleted.', array('%name' => $section->name)));
       cache_clear_all();
       drupal_goto('admin/settings/sections');
       break;
 
     default:
-      $output = confirm_form(
-                    'comment_confirm_delete',
-                    array(),
-                    t('Are you sure you want to delete the section %name?', array('%name' => '<em>'. $section->name .'</em>')),
-                    'admin/settings/sections/',
-                    '',
-                    t('Delete'),
-                    t('Cancel'));
+      $output = drupal_get_form('_sections_delete_confirm', $section);
       break;
   }
 
-  print theme('page', $output);
+  return $output;
+  
 }
 
+function _sections_delete_confirm($section) {
+  return confirm_form(
+    array(),
+    t('Delete section %name', array('%name' => $section->name)),
+    'admin/settings/sections/', 
+    t('<p>Are you sure you want to delete the section %name? This action cannot be undone.</p>', array('%name' => $section->name)),
+    t('Delete'),
+    t('Cancel'));
+}
+
+
 /**
  * Implementation of hook_perm().
  *
@@ -183,7 +181,7 @@ function _sections_delete($section) {
  * administration pages.
  */
 function sections_perm() {
-  return array('adminster sections');
+  return array('administer sections');
 }
 
 /**
@@ -201,29 +199,42 @@ function sections_menu($may_cache) {
   */
 
   if ($may_cache) {
-    $access = user_access('adminster sections');
+    $access = user_access('administer sections');
 
     // This is the minimum information you can provide for a menu item.
-    $items[] = array('path' => 'admin/settings/sections', 'title' => t('sections'),
+    $items[] = array(
+      'path' => 'admin/settings/sections',
+      'title' => t('Sections'),
+      'description' => t('Define sections of your site and apply themes to them.'),
       'callback' => 'sections_list',
       'access' => $access);
 
-    $items[] = array('path' => 'admin/settings/sections/list', 'title' => t('list'),
+    $items[] = array(
+      'path' => 'admin/settings/sections/list',
+      'title' => t('List'),
       'callback' => 'sections_list',
       'access' => $access,
       'type' => MENU_DEFAULT_LOCAL_TASK);
-    $items[] = array('path' => 'admin/settings/sections/add', 'title' => t('add'),
-      'callback' => 'sections_settings_form',
+      
+    $items[] = array(
+      'path' => 'admin/settings/sections/add',
+      'title' => t('Add'),
       'access' => $access,
-      'type' => MENU_LOCAL_TASK);
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('sections_settings_form'),
+      'type' => MENU_LOCAL_TASK);      
 
     foreach (_sections_load() as $section) {
-       $items[] = array('path' => 'admin/settings/sections/edit/'.$section->sid, 'title' => t('edit %name', array('%name'=>$section->name)),
-        'callback' => 'sections_settings_form',
-        'callback arguments' => array(NULL,$section),
+       $items[] = array(
+        'path' => 'admin/settings/sections/edit/'.$section->sid,
+        'callback' => 'drupal_get_form',
+        'callback arguments' => array('sections_settings_form', NULL, $section),
         'access' => $access,
         'type' => MENU_CALLBACK);
-       $items[] = array('path' => 'admin/settings/sections/delete/'.$section->sid, 'title' => t('edit %name', array('%name'=>$section->name)),
+        
+       $items[] = array(
+        'path' => 'admin/settings/sections/delete/'.$section->sid, 
+        'title' => t('Edit %name', array('%name'=>$section->name)),
         'callback' => '_sections_delete',
         'callback arguments' => array($section),
         'access' => $access,
