Index: sections.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/sections/sections.module,v retrieving revision 1.16.2.8 diff -r1.16.2.8 sections.module 333c333 < $res = db_query("SELECT path, status, visibility, theme, weight FROM {sections_data} WHERE status=1 ORDER BY weight"); --- > $res = db_query("SELECT name, path, status, visibility, theme, weight FROM {sections_data} WHERE status=1 ORDER BY weight"); 351a352,397 > > > /** > * API to allow you to get a text string back with the > * name of the current section, or returns TRUE/FALSE if > * the section name passed in is the current section > * > * This is the functionality I thought sections_insection should > * provide, rather than returning an object with everything but the > * section name. I wrote this function leveraging rather than rewriting > * sections_in_section. > * > * @param > * Optional $section_to_match a string containing the section name > * you want to test against > * > * @return > * Depends on the parameter. > * If you do not give $section, it will return the section name, if found. > * If you give $section, it will return TRUE if you are in that section > * Otherwise it will return FALSE > */ > function sections_check_section($section_to_match = NULL){ > > //get section object > $section_row = sections_in_section(); > > //get section from object > $section = $section_row->name; > > if (is_string($section_to_match)) { > // caller wants to know if shes in the section she provided. > if($section == $section_to_match) { > $return_value = TRUE; > } > else { > $return_value = FALSE; > } > } > else { > //else return the section name > $return_value = $section; > } > > return $return_value; > }