Changeset 312

Show
Ignore:
Timestamp:
05/08/06 08:41:06 (3 years ago)
Author:
carmartin
Message:

profile.class: fixed a ton of distracting warnings

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/profile/profile.class.php

    r302 r312  
    4343        $url = url; 
    4444     
     45        $run_result = ''; 
     46 
    4547        if (run("permissions:check", "profile")) { 
    4648         
     
    8082 
    8183        global $data; 
     84 
     85        $run_result = ''; 
    8286 
    8387        $body = "<p>\n" . gettext("    This screen allows you to edit your profile. Blank fields will not show up on your profile screen in any view; you can change the access level for each piece of information in order to prevent it from falling into the wrong hands. For example, we strongly recommend you keep your address to yourself or a few trusted parties.") . "</p>\n"; 
     
    143147 
    144148        global $data; 
     149        $run_result = ''; 
    145150        // Initial profile data 
    146151 
     
    255260    // the field parameter seems to be an array of unknown structure...  
    256261    function editfield_display ($field) { 
    257         $flabel = $field[0]; 
    258         $fname  = $field[1]; 
    259         $ftype  = $field[2]; 
    260         $fblurb = $field[3]; 
     262 
     263        // copy array element with default to '' 
     264        $flabel = !empty($field[0]) ? $field[0] : ''; 
     265        $fname  = !empty($field[1]) ? $field[1] : ''; 
     266        $ftype  = !empty($field[2]) ? $field[2] : ''; 
     267        $fblurb = !empty($field[3]) ? $field[3] : ''; 
    261268 
    262269        global $page_owner; 
    263270        global $data; 
     271 
     272        $run_result = ''; 
    264273 
    265274        if (empty($flabel) && empty($fname)) { 
     
    306315 
    307316        global $data; 
     317 
     318        $run_result = ''; 
    308319 
    309320        if (sizeof($field) >= 2) { 
     
    346357        $url = url; 
    347358        $handle = 0; 
     359        $run_result = ''; 
     360 
    348361        foreach($data['profile:details'] as $profiletype) { 
    349362            if ($profiletype[1] == $tagtype && $profiletype[2] == "keywords") { 
     
    420433            } 
    421434        } 
    422         return $run_result
     435        return true
    423436    } 
    424437 
     
    432445            } 
    433446        } 
    434         return $run_result
     447        return true
    435448    } 
    436449 
     
    440453     
    441454        $handle = 0; 
     455        $run_result = ''; 
     456 
    442457        foreach($data['profile:details'] as $profiletype) { 
    443458            if ($profiletype[1] == $tagtype && $profiletype[2] == "keywords") { 
     
    482497     
    483498        $handle = 0; 
     499        $run_result = ''; 
     500 
    484501        foreach($data['profile:details'] as $profiletype) { 
    485502            if ($profiletype[1] == $tagtype && $profiletype[2] == "keywords") { 
     
    607624         
    608625        } 
    609         return $run_result
     626        return true
    610627    } 
    611628 
     
    613630 
    614631        global $data; 
     632        $run_result = ''; 
    615633 
    616634        // Cycle through all defined profile detail fields and display them 
     
    631649 
    632650        global $data; 
     651        $run_result = ''; 
    633652        // If $data['foaf:profile'] is set and has elements in it ... 
    634653     
     
    716735 
    717736        global $data; 
     737        $run_results = ''; 
    718738        // If $data['vcard:profile:adr'] is set and has elements in it ... 
    719739     
     
    810830            // Update profile_data table, setting access to $access  
    811831            // where the owner is the current user and access = 'group$group_id' 
    812             set_field('profile_data','access',$access,'access','group'.$group_id,'owner',$USER->ident); 
    813  
    814         } 
    815         return $run_result
     832            return set_field('profile_data','access',$access,'access','group'.$group_id,'owner',$USER->ident); 
     833 
     834        } 
     835        return true
    816836    } 
    817837 
     
    880900     
    881901        // If this is someone else's portfolio, display the user's icon 
    882         $run_result .= "<div class=\"box_user\">"; 
     902        $run_result = "<div class=\"box_user\">"; 
    883903         
    884904        $info = get_record('users','ident',$page_owner);