Show
Ignore:
Timestamp:
03/26/07 12:27:53 (2 years ago)
Author:
sven
Message:

fixes for profile stuff: whitespace, html validation, php notices, cache-unfriendly queries, missing functions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/profile_photo/lib.php

    r1036 r1046  
    3535            } 
    3636            if (!empty($parameter[1])) { 
    37                 $html .= "<img src=\"{$CFG->wwwroot}mod/profile_photo/img.php?id={$parameter[4]}&constraint1=w&size1=250&constraint2=h&size2=200\" /><br />"; 
    38                 $html .= "<input name=\"".$parameter[0]."\" type=\"checkbox\" id=\"$cleanid\" value=\"photo\" />"; 
     37                $html .= "<img src=\"{$CFG->wwwroot}mod/profile_photo/img.php?id={$parameter[4]}&amp;constraint1=w&amp;size1=250&amp;constraint2=h&amp;size2=200\" alt=\"Profile photo\" /><br />"; 
     38                $html .= "<label for=\"$cleanid\"><input name=\"".$parameter[0]."\" type=\"checkbox\" id=\"$cleanid\" value=\"photo\" />"; 
    3939                $html .= __gettext("Click here to remove this photo."); 
     40                $html .= "</label>"; 
    4041            } else { 
    4142                $html .= "<input name=\"profile_photo_".$parameter[3]."\" type=\"file\" /><br />"; 
    42                 $html .= "<input name=\"".$parameter[0]."\" type=\"checkbox\" id=\"$cleanid\" value=\"photo\" />"; 
     43                $html .= "<label for=\"$cleanid\"><input name=\"".$parameter[0]."\" type=\"checkbox\" id=\"$cleanid\" value=\"photo\" />"; 
    4344                $html .= __gettext("Click here to verify that this is a photo of you and that it is not obscene or abusive."); 
     45                $html .= "</label>"; 
    4446            } 
    4547        } 
     
    4951    function profile_photo_display_output_field($parameter) { 
    5052        global $CFG, $profile_id; 
     53        $html = ''; 
    5154        if ($parameter[1] == "profile_photo") { 
    52             if (!empty($parameter[4]) 
    53                 && $parameter[0] != "photo") { 
    54                 $html .= "<img class=\"profile-photo\" src=\"{$CFG->wwwroot}mod/profile_photo/img.php?id={$parameter[4]}&constraint1=w&size1=250\" />"; 
     55            if (!empty($parameter[4]) && $parameter[0] != "photo") { 
     56                $html .= "<img class=\"profile-photo\" src=\"{$CFG->wwwroot}mod/profile_photo/img.php?id={$parameter[4]}&amp;constraint1=w&amp;size1=250\" alt=\"Profile photo\" />"; 
    5557            } else { 
    5658                $pictureglyph = __gettext("Click here to upload a photo"); 
    5759                $html = <<< END 
    5860</p> 
    59 <style
     61<style type="text/css"
    6062div#default-profile-icon { 
    6163    width:250px; 
     
    8284<div id="default-profile-icon"> 
    8385<p><a href="{$CFG->wwwroot}profile/edit.php?profile_id={$profile_id}">{$pictureglyph}</a></p> 
    84 </div>                 
     86</div> 
    8587<p> 
    8688END;