### Eclipse Workspace Patch 1.0
#P drupal-contrib-cvs
Index: modules/sections/sections.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sections/sections.module,v
retrieving revision 1.16
diff -u -r1.16 sections.module
--- modules/sections/sections.module	8 Dec 2006 23:46:52 -0000	1.16
+++ modules/sections/sections.module	1 May 2007 10:58:38 -0000
@@ -42,8 +42,7 @@
         $section->status ?  t('enabled') : t('disabled'),
         $section->template,
         $section->weight,
-        l(t('edit'),'admin/settings/sections/edit/'.$section->sid) ." ".
-        l(t('delete'),'admin/settings/sections/delete/'.$section->sid));
+        l(t('edit'),'admin/settings/sections/edit/'.$section->sid) ." | ". l(t('delete'),'admin/settings/sections/delete/'.$section->sid));
   }
 
   $output = theme('table', $header, $rows);
@@ -133,14 +132,14 @@
   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']);
-      drupal_set_message('The sections configuration has been saved.');
+      drupal_set_message(t('The sections configuration has been saved.'));
       cache_clear_all();
       menu_rebuild();
       drupal_goto('admin/settings/sections/');
     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 sections configuration has been saved.'));
       cache_clear_all();
       menu_rebuild();
       drupal_goto('admin/settings/sections/');
@@ -153,7 +152,7 @@
 
   switch ($op) {
     case t('Delete'):
-      db_query('DELETE FROM {sections_data} WHERE sid = %d', $section->sid);
+      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>')));
       cache_clear_all();
       drupal_goto('admin/settings/sections');
@@ -183,7 +182,7 @@
  * administration pages.
  */
 function sections_perm() {
-  return array('adminster sections');
+  return array('administer sections');
 }
 
 /**
@@ -201,33 +200,48 @@
   */
 
   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'),
       'callback' => 'sections_list',
-      'access' => $access);
+      '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'),
+      'type' => MENU_DEFAULT_LOCAL_TASK
+    );
+    $items[] = array(
+      'path' => 'admin/settings/sections/add', 
+      'title' => t('add'),
       'callback' => 'sections_settings_form',
       'access' => $access,
-      'type' => MENU_LOCAL_TASK);
+      '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),
-        'access' => $access,
-        'type' => MENU_CALLBACK);
-       $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,
-        'type' => MENU_CALLBACK);
+       $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),
+         'access' => $access,
+         'type' => MENU_CALLBACK
+       );
+       $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,
+         'type' => MENU_CALLBACK
+       );
     }
   }
   else if ($section = sections_in_section()) {
@@ -240,7 +254,7 @@
 function _sections_load() {
   $sections = array();
 
-  $res = db_query('SELECT * FROM {sections_data}');
+  $res = db_query("SELECT * FROM {sections_data}");
 
   while ($row = db_fetch_object($res)) {
     $sections[] = $row;
@@ -253,7 +267,7 @@
  */
 
 function _section_load($section_name) {
-  return db_fetch_object(db_query('SELECT * FROM {sections_data} WHERE n.name = %s ORDER BY weight', $section_name));
+  return db_fetch_object(db_query("SELECT * FROM {sections_data} WHERE n.name = '%s' ORDER BY weight", $section_name));
 }
 
 /**
@@ -288,7 +302,7 @@
   if (is_string($section)) {
     //caller wants to know if shes in the section she provided.
     if($section == sections_in_section()) {
-     return TRUE;
+      return TRUE;
     }
   }
   else {
