Permalink
Browse files

Only display non-empty categories

  • Loading branch information...
1 parent d0c3388 commit ebc2df8a41da1f7d249315b8abbec31906e45a5d ikawhero committed Jan 12, 2007
Showing with 3 additions and 2 deletions.
  1. +3 −2 user/edit_form.php
View
@@ -320,9 +320,10 @@ function definition () {
/// Next the customisable categories
if ($categories = get_records_select('user_info_category', '1', 'sortorder ASC')) {
foreach ($categories as $category) {
- $mform->addElement('header', 'category_'.$category->id, $category->name);
-
if ($fields = get_records_select('user_info_field', "categoryid=$category->id", 'sortorder ASC')) {
+
+ $mform->addElement('header', 'category_'.$category->id, $category->name);
+
foreach ($fields as $field) {
require_once($CFG->dirroot.'/user/profile/field/'.$field->datatype.'/field.class.php');

0 comments on commit ebc2df8

Please sign in to comment.