Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'wip-MDL-35875-master' of git://github.com/phalacee/moodle

  • Loading branch information...
commit 02dcf9b501d613c077fa51f5f0a35a477ef81c48 2 parents 61cd506 + ae18db7
Aparup Banerjee authored March 12, 2013
11  theme/base/style/user.css
... ...
@@ -1,9 +1,11 @@
1 1
 /*$$$$$$$$$$$$$$$$$ User $$$$$$$$$$$$$$$$$$$$*/
2  
-
3 2
 .userprofile .fullprofilelink {text-align:center; margin:10px;}
4 3
 .userprofile .profilepicture {float:left; margin-right:20px;}
5 4
 .userprofile .description {margin-bottom:20px;}
6  
-.userprofile .label {font-weight:normal;text-align:left;}
  5
+.userprofile dl {margin-top:10px;  margin-left:0px;  width:100%;}
  6
+.userprofile dl dt, .userprofile dl dd {padding-top:3px;  padding-bottom:3px;}
  7
+.userprofile dl dt {margin:0px;  font-weight:bold;  display:block; float:left; width:110px; margin-right:10px;}
  8
+.userprofile dl dd {display:block; margin:0px; margin-left:120px;}
7 9
 
8 10
 .user-box {margin:8px;width:115px;height:160px;text-align:center;float:left;clear: none;}
9 11
 
@@ -31,7 +33,6 @@
31 33
 .userinfobox .list td {padding: 3px;}
32 34
 .userinfobox .username {padding-bottom: 20px;font-weight: bold;}
33 35
 .userinfobox td.label {text-align:right;white-space: nowrap;vertical-align: top;font-weight:bold;}
34  
-
35 36
 .groupinfobox {border:1px solid;}
36 37
 .groupinfobox .left {padding: 10px;width: 100px;vertical-align: top;}
37 38
 
@@ -57,9 +58,9 @@
57 58
 
58 59
 /** Overide for RTL layout **/
59 60
 .dir-rtl .userprofile .profilepicture {float:right; margin-left:20px;margin-right:0px;}
60  
-.dir-rtl .descriptionbox {margin-right: 110px;margin-left: 0px; }
61 61
 .dir-rtl .userlist table#participants td,
62 62
 .dir-rtl .userlist table#participants th {text-align: right;}
63 63
 .dir-rtl .userlist table#participants {margin: 0 auto;}
64  
-
  64
+.dir-rtl .userprofile dl dt {float:right; width:110px; margin-left:10px;}
  65
+.dir-rtl .userprofile dl dd {margin-right: 120px;}
65 66
 #page-my-index.dir-rtl .block h3.main { text-align: right;}
28  theme/canvas/style/core.css
@@ -268,6 +268,7 @@ input[type="radio"] {
268 268
     margin-left: 110px;
269 269
     border: 1px solid #ddd;
270 270
     padding: 10px;
  271
+    width: 80%;
271 272
 }
272 273
 
273 274
 .path-user .description {
@@ -275,18 +276,39 @@ input[type="radio"] {
275 276
     border-bottom: 1px solid #eee;
276 277
 }
277 278
 
278  
-.userprofile .list {
  279
+.userprofile dl {
279 280
     margin-top: 10px;
280 281
 }
281 282
 
282  
-.userprofile .list td {
  283
+.userprofile dl dt, .userprofile dl dd {
283 284
     padding-top: 3px;
284 285
     padding-bottom: 3px;
  286
+    float: left;
  287
+}
  288
+
  289
+.dir-rtl .userprofile dl dt, .dir-rtl  .userprofile dl dd {
  290
+    float: right;
285 291
 }
286 292
 
287  
-.userprofile .list .c0 {
  293
+.userprofile dl dt {
288 294
     padding-left: 0;
289 295
     font-weight: bold;
  296
+    display: inline-block;
  297
+    padding-right: 2%;
  298
+    min-width: 100px;
  299
+    width: 15%;
  300
+    clear: both;
  301
+}
  302
+
  303
+.dir-rtl .userprofile dl dt {
  304
+    padding-left: 2%;
  305
+    padding-right: 0;
  306
+}
  307
+
  308
+.userprofile dl dd {
  309
+    display: inline-block;
  310
+    margin: 0px;
  311
+    width: 75%;
290 312
 }
291 313
 
292 314
 #page-user-view .buttons {
1  theme/upgrade.txt
@@ -5,6 +5,7 @@ information provided here is intended especially for theme designer.
5 5
 
6 6
 DOM changes:
7 7
 * changed the h1 title in the help popup to a h2.
  8
+* Re-wrote the user profile views to definition lists.
8 9
 
9 10
 === 2.4 ===
10 11
 
90  user/profile.php
@@ -243,45 +243,53 @@
243 243
 
244 244
 // Print all the little details in a list
245 245
 
246  
-echo '<table class="list" summary="">';
247  
-
248  
-if (! isset($hiddenfields['country']) && $user->country) {
249  
-    print_row(get_string('country') . ':', get_string($user->country, 'countries'));
  246
+echo html_writer::start_tag('dl', array('class'=>'list'));
  247
+if (!isset($hiddenfields['country']) && $user->country) {
  248
+    echo html_writer::tag('dt', get_string('country'));
  249
+    echo html_writer::tag('dd', get_string($user->country, 'countries'));
250 250
 }
251 251
 
252  
-if (! isset($hiddenfields['city']) && $user->city) {
253  
-    print_row(get_string('city') . ':', $user->city);
  252
+if (!isset($hiddenfields['city']) && $user->city) {
  253
+    echo html_writer::tag('dt', get_string('city'));
  254
+    echo html_writer::tag('dd', $user->city);
254 255
 }
255 256
 
256 257
 if (isset($identityfields['address']) && $user->address) {
257  
-    print_row(get_string("address").":", "$user->address");
  258
+    echo html_writer::tag('dt', get_string('address'));
  259
+    echo html_writer::tag('dd', $user->address);
258 260
 }
259 261
 
260 262
 if (isset($identityfields['phone1']) && $user->phone1) {
261  
-    print_row(get_string("phone").":", "$user->phone1");
  263
+    echo html_writer::tag('dt', get_string('phone'));
  264
+    echo html_writer::tag('dd', $user->phone1);
262 265
 }
263 266
 
264 267
 if (isset($identityfields['phone2']) && $user->phone2) {
265  
-    print_row(get_string("phone2").":", "$user->phone2");
  268
+    echo html_writer::tag('dt', get_string('phone2'));
  269
+    echo html_writer::tag('dd', $user->phone2);
266 270
 }
267 271
 
268 272
 if (isset($identityfields['institution']) && $user->institution) {
269  
-    print_row(get_string("institution").":", "$user->institution");
  273
+    echo html_writer::tag('dt', get_string('institution'));
  274
+    echo html_writer::tag('dd', $user->institution);
270 275
 }
271 276
 
272 277
 if (isset($identityfields['department']) && $user->department) {
273  
-    print_row(get_string("department").":", "$user->department");
  278
+    echo html_writer::tag('dt', get_string('department'));
  279
+    echo html_writer::tag('dd', $user->department);
274 280
 }
275 281
 
276 282
 if (isset($identityfields['idnumber']) && $user->idnumber) {
277  
-    print_row(get_string("idnumber").":", "$user->idnumber");
  283
+    echo html_writer::tag('dt', get_string('idnumber'));
  284
+    echo html_writer::tag('dd', $user->idnumber);
278 285
 }
279 286
 
280 287
 if (isset($identityfields['email']) and ($currentuser
281 288
   or $user->maildisplay == 1
282 289
   or has_capability('moodle/course:useremail', $context)
283 290
   or ($user->maildisplay == 2 and enrol_sharing_course($user, $USER)))) {
284  
-    print_row(get_string("email").":", obfuscate_mailto($user->email, ''));
  291
+    echo html_writer::tag('dt', get_string('email'));
  292
+    echo html_writer::tag('dd', obfuscate_mailto($user->email, ''));
285 293
 }
286 294
 
287 295
 if ($user->url && !isset($hiddenfields['webpage'])) {
@@ -289,30 +297,46 @@
289 297
     if (strpos($user->url, '://') === false) {
290 298
         $url = 'http://'. $url;
291 299
     }
292  
-    print_row(get_string("webpage") .":", '<a href="'.s($url).'">'.s($user->url).'</a>');
  300
+    $webpageurl = new moodle_url($url);
  301
+    echo html_writer::tag('dt', get_string('webpage'));
  302
+    echo html_writer::tag('dd', html_writer::link($webpageurl, s($user->url)));
293 303
 }
294 304
 
295 305
 if ($user->icq && !isset($hiddenfields['icqnumber'])) {
296  
-    print_row(get_string('icqnumber').':',"<a href=\"http://web.icq.com/wwp?uin=".urlencode($user->icq)."\">".s($user->icq)." <img src=\"http://web.icq.com/whitepages/online?icq=".urlencode($user->icq)."&amp;img=5\" alt=\"\" /></a>");
  306
+    $imurl = new moodle_url('http://web.icq.com/wwp', array('uin'=>$user->icq) );
  307
+    $iconurl = new moodle_url('http://web.icq.com/whitepages/online', array('icq'=>$user->icq, 'img'=>'5'));
  308
+    $statusicon = html_writer::tag('img', '', array('src'=>$iconurl, 'class'=>'icon icon-post', 'alt'=>get_string('status')));
  309
+    echo html_writer::tag('dt', get_string('icqnumber'));
  310
+    echo html_writer::tag('dd', html_writer::link($imurl, s($user->icq) . $statusicon));
297 311
 }
298 312
 
299 313
 if ($user->skype && !isset($hiddenfields['skypeid'])) {
  314
+    $imurl = 'skype:'.urlencode($user->skype).'?call';
  315
+    $iconurl = new moodle_url('http://mystatus.skype.com/smallicon/'.$user->skype);
300 316
     if (strpos($CFG->httpswwwroot, 'https:') === 0) {
301 317
         // Bad luck, skype devs are lazy to set up SSL on their servers - see MDL-37233.
302 318
         $statusicon = '';
303 319
     } else {
304  
-        $statusicon = ' '.html_writer::empty_tag('img', array('src'=>'http://mystatus.skype.com/smallicon/'.urlencode($user->skype), 'alt'=>get_string('status')));
  320
+        $statusicon = html_writer::empty_tag('img', array('src'=>$iconurl, 'class'=>'icon icon-post', 'alt'=>get_string('status')));
305 321
     }
306  
-    print_row(get_string('skypeid').':','<a href="skype:'.urlencode($user->skype).'?call">'.s($user->skype).$statusicon.'</a>');
  322
+    echo html_writer::tag('dt', get_string('skypeid'));
  323
+    echo html_writer::tag('dd', html_writer::link($imurl, s($user->skype) . $statusicon));
307 324
 }
308 325
 if ($user->yahoo && !isset($hiddenfields['yahooid'])) {
309  
-    print_row(get_string('yahooid').':', '<a href="http://edit.yahoo.com/config/send_webmesg?.target='.urlencode($user->yahoo).'&amp;.src=pg">'.s($user->yahoo)." <img src=\"http://opi.yahoo.com/online?u=".urlencode($user->yahoo)."&m=g&t=0\" alt=\"\"></a>");
  326
+    $imurl = new moodle_url('http://edit.yahoo.com/config/send_webmesg', array('.target'=>$user->yahoo, '.src'=>'pg'));
  327
+    $iconurl = new moodle_url('http://opi.yahoo.com/online', array('u'=>$user->yahoo, 'm'=>'g', 't'=>'0'));
  328
+    $statusicon = html_writer::tag('img', '', array('src'=>$iconurl, 'class'=>'iconsmall icon-post', 'alt'=>get_string('status')));
  329
+    echo html_writer::tag('dt', get_string('yahooid'));
  330
+    echo html_writer::tag('dd', html_writer::link($imurl, s($user->yahoo) . $statusicon));
310 331
 }
311 332
 if ($user->aim && !isset($hiddenfields['aimid'])) {
312  
-    print_row(get_string('aimid').':', '<a href="aim:goim?screenname='.urlencode($user->aim).'">'.s($user->aim).'</a>');
  333
+    $imurl = 'aim:goim?screenname='.urlencode($user->aim);
  334
+    echo html_writer::tag('dt', get_string('aimid'));
  335
+    echo html_writer::tag('dd', html_writer::link($imurl, s($user->aim)));
313 336
 }
314 337
 if ($user->msn && !isset($hiddenfields['msnid'])) {
315  
-    print_row(get_string('msnid').':', s($user->msn));
  338
+    echo html_writer::tag('dt', get_string('msnid'));
  339
+    echo html_writer::tag('dd', s($user->msn));
316 340
 }
317 341
 
318 342
 /// Print the Custom User Fields
@@ -342,7 +366,8 @@
342 366
                 break;
343 367
             }
344 368
         }
345  
-        print_row(get_string('courseprofiles').':', rtrim($courselisting,', '));
  369
+        echo html_writer::tag('dt', get_string('courseprofiles'));
  370
+        echo html_writer::tag('dd', rtrim($courselisting,', '));
346 371
     }
347 372
 }
348 373
 if (!isset($hiddenfields['firstaccess'])) {
@@ -351,7 +376,8 @@
351 376
     } else {
352 377
         $datestring = get_string("never");
353 378
     }
354  
-    print_row(get_string("firstaccess").":", $datestring);
  379
+    echo html_writer::tag('dt', get_string('firstaccess'));
  380
+    echo html_writer::tag('dd', $datestring);
355 381
 }
356 382
 if (!isset($hiddenfields['lastaccess'])) {
357 383
     if ($user->lastaccess) {
@@ -359,24 +385,27 @@
359 385
     } else {
360 386
         $datestring = get_string("never");
361 387
     }
362  
-    print_row(get_string("lastaccess").":", $datestring);
  388
+    echo html_writer::tag('dt', get_string('lastaccess'));
  389
+    echo html_writer::tag('dd', $datestring);
363 390
 }
364 391
 
365 392
 /// Printing tagged interests
366 393
 if (!empty($CFG->usetags)) {
367 394
     if ($interests = tag_get_tags_csv('user', $user->id) ) {
368  
-        print_row(get_string('interests') .": ", $interests);
  395
+        echo html_writer::tag('dt', get_string('interests'));
  396
+        echo html_writer::tag('dd', $interests);
369 397
     }
370 398
 }
371 399
 
372 400
 if (!isset($hiddenfields['suspended'])) {
373 401
     if ($user->suspended) {
374  
-        print_row('', get_string('suspended', 'auth'));
  402
+        echo html_writer::tag('dt', '&nbsp;');
  403
+        echo html_writer::tag('dd', get_string('suspended', 'auth'));
375 404
     }
376 405
 }
377 406
 
378  
-echo "</table></div></div>";
379  
-
  407
+echo html_writer::end_tag('dl');
  408
+echo "</div></div>"; // Closing desriptionbox and userprofilebox.
380 409
 echo '<div id="region-content" class="block-region"><div class="region-content">';
381 410
 echo $OUTPUT->blocks_for_region('content');
382 411
 echo '</div></div>';
@@ -396,9 +425,4 @@
396 425
 }
397 426
 
398 427
 echo '</div>';  // userprofile class
399  
-echo $OUTPUT->footer();
400  
-
401  
-
402  
-function print_row($left, $right) {
403  
-    echo "\n<tr><th class=\"label c0\">$left</th><td class=\"info c1\">$right</td></tr>\n";
404  
-}
  428
+echo $OUTPUT->footer();
3  user/profile/lib.php
@@ -452,7 +452,8 @@ function profile_display_fields($userid) {
452 452
                     $newfield = 'profile_field_'.$field->datatype;
453 453
                     $formfield = new $newfield($field->id, $userid);
454 454
                     if ($formfield->is_visible() and !$formfield->is_empty()) {
455  
-                        print_row(format_string($formfield->field->name.':'), $formfield->display_data());
  455
+                        echo html_writer::tag('dt', format_string($formfield->field->name));
  456
+                        echo html_writer::tag('dd', $formfield->display_data());
456 457
                     }
457 458
                 }
458 459
             }
34  user/view.php
@@ -237,8 +237,7 @@
237 237
 
238 238
 // Print all the little details in a list
239 239
 
240  
-echo '<table class="list" summary="">';
241  
-
  240
+echo html_writer::start_tag('dl', array('class'=>'list'));
242 241
 // Show email if any of the following conditions match.
243 242
 // 1. User is viewing his own profile.
244 243
 // 2. Has allowed everyone to see email
@@ -249,7 +248,8 @@
249 248
    or ($user->maildisplay == 2 && is_enrolled($coursecontext, $USER))
250 249
    or has_capability('moodle/course:viewhiddenuserfields', $coursecontext)
251 250
    or has_capability('moodle/site:viewuseridentity', $coursecontext)) {
252  
-    print_row(get_string("email").":", obfuscate_mailto($user->email, ''));
  251
+    echo html_writer::tag('dt', get_string('email'));
  252
+    echo html_writer::tag('dd', obfuscate_mailto($user->email, ''));
253 253
 }
254 254
 
255 255
 // Show last time this user accessed this course
@@ -259,12 +259,14 @@
259 259
     } else {
260 260
         $datestring = get_string("never");
261 261
     }
262  
-    print_row(get_string("lastaccess").":", $datestring);
  262
+    echo html_writer::tag('dt', get_string('lastaccess'));
  263
+    echo html_writer::tag('dd', $datestring);
263 264
 }
264 265
 
265 266
 // Show roles in this course
266 267
 if ($rolestring = get_user_roles_in_course($id, $course->id)) {
267  
-    print_row(get_string('roles').':', $rolestring);
  268
+    echo html_writer::tag('dt', get_string('roles'));
  269
+    echo html_writer::tag('dd', $rolestring);
268 270
 }
269 271
 
270 272
 // Show groups this user is in
@@ -286,7 +288,8 @@
286 288
             }
287 289
         }
288 290
         if ($groupstr !== '') {
289  
-            print_row(get_string("group").":", rtrim($groupstr, ', '));
  291
+            echo html_writer::tag('dt', get_string('group'));
  292
+            echo html_writer::tag('dd', rtrim($groupstr, ', '));
290 293
         }
291 294
     }
292 295
 }
@@ -322,18 +325,19 @@
322 325
                 break;
323 326
             }
324 327
         }
325  
-        print_row(get_string('courseprofiles').':', rtrim($courselisting,', '));
  328
+        echo html_writer::tag('dt', get_string('courseprofiles'));
  329
+        echo html_writer::tag('dd', rtrim($courselisting,', '));
326 330
     }
327 331
 }
328 332
 
329 333
 if (!isset($hiddenfields['suspended'])) {
330 334
     if ($user->suspended) {
331  
-        print_row('', get_string('suspended', 'auth'));
  335
+        echo html_writer::tag('dt', "&nbsp;");
  336
+        echo html_writer::tag('dd', get_string('suspended', 'auth'));
332 337
     }
333 338
 }
334  
-
335  
-echo "</table></div></div>";
336  
-
  339
+echo html_writer::end_tag('dl');
  340
+echo "</div></div>"; // Closing desriptionbox and userprofilebox.
337 341
 // Print messaging link if allowed
338 342
 if (isloggedin() && has_capability('moodle/site:sendmessage', $usercontext)
339 343
     && !empty($CFG->messaging) && !isguestuser() && !isguestuser($user) && ($USER->id != $user->id)) {
@@ -361,11 +365,3 @@
361 365
 echo '</div>';  // userprofile class
362 366
 
363 367
 echo $OUTPUT->footer();
364  
-
365  
-/// Functions ///////
366  
-
367  
-function print_row($left, $right) {
368  
-    echo "\n<tr><th class=\"label c0\">$left</th><td class=\"info c1\">$right</td></tr>\n";
369  
-}
370  
-
371  
-

0 notes on commit 02dcf9b

Please sign in to comment.
Something went wrong with that request. Please try again.