Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -420,14 +420,16 @@ |
421 | 421 | global $wgShowIPinHeader; |
422 | 422 | $personal_urls = array(); |
423 | 423 | if ($this->loggedin) { |
424 | | - /* Logged in users personal toolbar */ |
425 | 424 | $personal_urls['userpage'] = array( |
426 | | - 'text' => wfMsg('mypage'), |
427 | | - 'href' => $this->makeSpecialUrl('Mypage') |
| 425 | + 'text' => $this->username, |
| 426 | + 'href' => &$this->userpageUrlDetails['href'], |
| 427 | + 'class' => $this->userpageUrlDetails['exists']?false:'new' |
428 | 428 | ); |
| 429 | + $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage); |
429 | 430 | $personal_urls['mytalk'] = array( |
430 | 431 | 'text' => wfMsg('mytalk'), |
431 | | - 'href' => $this->makeSpecialUrl('Mytalk') |
| 432 | + 'href' => &$usertalkUrlDetails['href'], |
| 433 | + 'class' => $usertalkUrlDetails['exists']?false:'new' |
432 | 434 | ); |
433 | 435 | $personal_urls['preferences'] = array( |
434 | 436 | 'text' => wfMsg('preferences'), |
— | — | @@ -439,7 +441,7 @@ |
440 | 442 | ); |
441 | 443 | $personal_urls['mycontris'] = array( |
442 | 444 | 'text' => wfMsg('mycontris'), |
443 | | - 'href' => $this->makeSpecialUrl('Mycontributions') |
| 445 | + 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username ) ) |
444 | 446 | ); |
445 | 447 | $personal_urls['logout'] = array( |
446 | 448 | 'text' => wfMsg('userlogout'), |
— | — | @@ -447,22 +449,23 @@ |
448 | 450 | ); |
449 | 451 | } else { |
450 | 452 | if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) { |
451 | | - /* Anonymous with session users personal toolbar */ |
452 | 453 | $personal_urls['anonuserpage'] = array( |
453 | | - 'text' => wfMsg('mypage'), |
454 | | - 'href' => $this->makeSpecialUrl('Mypage') |
| 454 | + 'text' => $this->username, |
| 455 | + 'href' => &$this->userpageUrlDetails['href'], |
| 456 | + 'class' => $this->userpageUrlDetails['exists']?false:'new' |
455 | 457 | ); |
456 | | - $personal_urls['mytalk'] = array( |
457 | | - 'text' => wfMsg('mytalk'), |
458 | | - 'href' => $this->makeSpecialUrl('Mytalk') |
| 458 | + $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage); |
| 459 | + $personal_urls['anontalk'] = array( |
| 460 | + 'text' => wfMsg('anontalk'), |
| 461 | + 'href' => &$usertalkUrlDetails['href'], |
| 462 | + 'class' => $usertalkUrlDetails['exists']?false:'new' |
459 | 463 | ); |
460 | | - |
461 | 464 | $personal_urls['anonlogin'] = array( |
462 | 465 | 'text' => wfMsg('userlogin'), |
463 | 466 | 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ) |
464 | 467 | ); |
465 | 468 | } else { |
466 | | - /* Anonymous users personal toolbar */ |
| 469 | + |
467 | 470 | $personal_urls['login'] = array( |
468 | 471 | 'text' => wfMsg('userlogin'), |
469 | 472 | 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ) |
— | — | @@ -487,7 +490,27 @@ |
488 | 491 | 'text' => wfMsg( $message ), |
489 | 492 | 'href' => $title->getLocalUrl( $query ) ); |
490 | 493 | } |
| 494 | + |
| 495 | + function makeTalkUrlDetails( $name, $urlaction='' ) { |
| 496 | + $title = Title::newFromText( $name ); |
| 497 | + $title = $title->getTalkPage(); |
| 498 | + $this->checkTitle($title, $name); |
| 499 | + return array( |
| 500 | + 'href' => $title->getLocalURL( $urlaction ), |
| 501 | + 'exists' => $title->getArticleID() != 0?true:false |
| 502 | + ); |
| 503 | + } |
491 | 504 | |
| 505 | + function makeArticleUrlDetails( $name, $urlaction='' ) { |
| 506 | + $title = Title::newFromText( $name ); |
| 507 | + $title= $title->getSubjectPage(); |
| 508 | + $this->checkTitle($title, $name); |
| 509 | + return array( |
| 510 | + 'href' => $title->getLocalURL( $urlaction ), |
| 511 | + 'exists' => $title->getArticleID() != 0?true:false |
| 512 | + ); |
| 513 | + } |
| 514 | + |
492 | 515 | /** |
493 | 516 | * an array of edit links by default used for the tabs |
494 | 517 | * @return array |