Changeset 21
- Timestamp:
- 11/23/06 21:37:52 (2 years ago)
- Files:
-
- friendicon/mod/friendicon/community_memberships.php (added)
- friendicon/mod/friendicon/lib.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
friendicon/mod/friendicon/lib.php
r11 r21 9 9 10 10 function friendicon_pagesetup() { 11 global $CFG, $USER, $function ;11 global $CFG, $USER, $function, $page_owner; 12 12 13 13 // Replace the displaying of the friends and add the image element 14 14 if (logged_on) { 15 $setting = user_flag_get('friendicon_sidebar', $ USER->ident);15 $setting = user_flag_get('friendicon_sidebar', $page_owner); 16 16 if ($setting == 'true') { 17 17 $i = 0; … … 21 21 $function['users:infobox'][$i] = $CFG->dirroot . 'mod/friendicon/user_info.php'; 22 22 } 23 23 24 $i++; 24 25 } 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']); 25 43 } 26 44 } … … 28 46 29 47 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."); 32 50 33 51 $body = <<< END … … 36 54 END; 37 55 38 $true = __gettext('Yes');39 $false = __gettext('No');56 $true = gettext('Yes'); 57 $false = gettext('No'); 40 58 41 59 $checked_true = ''; … … 62 80 $body .= templates_draw( array( 63 81 'context' => 'databox', 64 'name' => __gettext("Sidebar user icon: "),82 'name' => gettext("Sidebar user icon: "), 65 83 'column1' => $chooser 66 84 ) … … 76 94 $action = optional_param('action'); 77 95 $id = optional_param('id',0,PARAM_INT); 78 $friendicon_sidebar = optional_param('friendicon_sidebar','false' );96 $friendicon_sidebar = optional_param('friendicon_sidebar','false',TEXT); 79 97 $friendicon_sidebar_db = user_flag_get('friendicon_sidebar', $id); 80 98 … … 83 101 if ($friendicon_sidebar != $friendicon_sidebar_db) { 84 102 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") ."."; 86 104 } else { 87 $messages[] .= __gettext("Display of user icons") . " " . __gettext("not saved") .".";105 $messages[] .= gettext("Display of user icons") . " " . gettext("not saved") ."."; 88 106 } 89 107 }
