commit eb780365f2e7a7676763e68c9afbc68a70e64e87
Author: root <root@srv-xen-moodle08.tauntons.ac.uk>
Date:   Mon Jun 22 11:53:39 2009 +0100

    Sorted out the layout of the create parent search list

diff --git a/blocks/createparent/block_createparent.php b/blocks/createparent/block_createparent.php
index c23fa64..0380f24 100644
--- a/blocks/createparent/block_createparent.php
+++ b/blocks/createparent/block_createparent.php
@@ -31,21 +31,23 @@ class block_createparent extends block_base {
                 //any valid user can have a parent created as long as they are not themselves a parent TODO: what if there is student(s) with parent prefix at beginning of username (or no parentrefix)?
                 $users=get_records_select('user','deleted=0 AND username not like \''.$cfg_createparent->parentprefix.'%\'');
                 foreach($users as $user){
-                    $this->content->text .= '<div><h5>'.$user->firstname.' '.$user->lastname.'</h5>';
+                    $this->content->text .= '<div><h5 style="margin:5px;">'.$user->firstname.' '.$user->lastname;
+                    if ( has_capability('block/createparent:addany', $context)or ($USER==$user and has_capability('block/createparent:addown', $context))){
+                        $this->content->text.=' - <a target=_blank href="'.$CFG->wwwroot.'/blocks/createparent/add.php?studentid='.$user->id.'">'.get_string('addparent','block_createparent').'</a>';
+                    }
+                    $this->content->text .= '</h5>';
                     $studentcontext = get_context_instance(CONTEXT_USER, $user->id);
                     if($parentsassignments=get_records_select('role_assignments','contextid='.$studentcontext->id.' AND roleid='.$cfg_createparent->parentrole)){
                         foreach($parentsassignments as $parentsassignment){
                             $parent=get_record('user','id',$parentsassignment->userid);
-                            $this->content->text.= '<p>'.$parent->email;
+                            $this->content->text.= '<p style="margin-top:0px;margin-bottom:0px;margin-left:10px;">'.$parent->email;
                             if ( has_capability('block/createparent:editany', $context)or ($USER==$user and has_capability('block/createparent:editown', $context))){
                                 $this->content->text.='<br><a target=_blank href="'.$CFG->wwwroot.'/blocks/createparent/del.php?studentid='.$user->id.'&id='.$parent->id.'">'.get_string('delete').'</a>';
                             }
-                        $this->content->text.='</p>';
+                            $this->content->text.='</p>';
                         }
                     }
-                    if ( has_capability('block/createparent:addany', $context)or ($USER==$user and has_capability('block/createparent:addown', $context))){
-                        $this->content->text.='<a target=_blank href="'.$CFG->wwwroot.'/blocks/createparent/add.php?studentid='.$user->id.'">'.get_string('addparent','block_createparent').'</a>';
-                    }
+
 
                     $this->content->text.='</div>';
 
diff --git a/blocks/createparent/userfind.js b/blocks/createparent/userfind.js
index 12e33e8..3b8a406 100644
--- a/blocks/createparent/userfind.js
+++ b/blocks/createparent/userfind.js
@@ -8,7 +8,7 @@ function block_createparent_usersearch(){
         if((person.firstChild.innerHTML.search(searchstring) == -1)||(searchbox.value =='')){
             person.style.display="none";
         }else{
-            person.style.display="list-item";
+            person.style.display="block";
         }
     }
 }
\ No newline at end of file

