Changeset 21

Show
Ignore:
Timestamp:
11/23/06 21:37:52 (2 years ago)
Author:
misja
Message:

Community icons are now visible as well.

Files:

Legend:

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

    r11 r21  
    99 
    1010    function friendicon_pagesetup() { 
    11         global $CFG, $USER, $function
     11        global $CFG, $USER, $function, $page_owner
    1212 
    1313        // Replace the displaying of the friends and add the image element 
    1414        if (logged_on) { 
    15             $setting = user_flag_get('friendicon_sidebar', $USER->ident); 
     15            $setting = user_flag_get('friendicon_sidebar', $page_owner); 
    1616            if ($setting == 'true') { 
    1717                $i = 0; 
     
    2121                        $function['users:infobox'][$i] = $CFG->dirroot . 'mod/friendicon/user_info.php'; 
    2222                    } 
     23                     
    2324                    $i++; 
    2425                } 
     26                 
     27                // Replace community membership sidebar view 
     28                $i = 0; 
     29                foreach ($function['display:sidebar'] as $element) { 
     30 
     31 
     32                    if ($element == $CFG->dirroot . 'units/communities/community_memberships.php') { 
     33                        unset($function['display:sidebar'][$i]); 
     34 
     35                        $function['display:sidebar'][$i] = $CFG->dirroot . 'mod/friendicon/community_memberships.php'; 
     36                    } 
     37 
     38                    $i++; 
     39                } 
     40 
     41                // We've mangled the array, tidy up 
     42                ksort($function['display:sidebar']); 
    2543            } 
    2644        } 
     
    2846     
    2947    function friendicon_userdetails_edit_details($userid) { 
    30         $title = __gettext("Sidebar friend icon:"); 
    31         $blurb = __gettext("Choose if you would like your friends' user icons displayed in your sidebar friends list."); 
     48        $title = gettext("Sidebar friend icon:"); 
     49        $blurb = gettext("Choose if you would like your friends' user icons displayed in your sidebar friends list."); 
    3250 
    3351        $body = <<< END 
     
    3654END; 
    3755 
    38         $true = __gettext('Yes'); 
    39         $false = __gettext('No'); 
     56        $true = gettext('Yes'); 
     57        $false = gettext('No'); 
    4058 
    4159        $checked_true = ''; 
     
    6280        $body .= templates_draw( array( 
    6381                    'context' => 'databox', 
    64                     'name' => __gettext("Sidebar user icon: "), 
     82                    'name' => gettext("Sidebar user icon: "), 
    6583                    'column1' => $chooser 
    6684        ) 
     
    7694        $action = optional_param('action'); 
    7795        $id = optional_param('id',0,PARAM_INT); 
    78         $friendicon_sidebar = optional_param('friendicon_sidebar','false'); 
     96        $friendicon_sidebar = optional_param('friendicon_sidebar','false',TEXT); 
    7997        $friendicon_sidebar_db = user_flag_get('friendicon_sidebar', $id); 
    8098 
     
    83101                if ($friendicon_sidebar != $friendicon_sidebar_db) { 
    84102                    if(user_flag_set('friendicon_sidebar', $friendicon_sidebar, $id)) { 
    85                         $messages[] .= __gettext("Display of user icons") . " " . __gettext("saved") ."."; 
     103                        $messages[] .= gettext("Display of user icons") . " " . gettext("saved") ."."; 
    86104                    } else { 
    87                         $messages[] .= __gettext("Display of user icons") . " " . __gettext("not saved") ."."; 
     105                        $messages[] .= gettext("Display of user icons") . " " . gettext("not saved") ."."; 
    88106                    } 
    89107                }