r48332 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48331‎ | r48332 | r48333 >
Date:21:22, 11 March 2009
Author:ashley
Status:ok
Tags:
Comment:
SocialProfile: make Special:SystemGiftManager valid XHTML
Modified paths:
  • /trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php (modified) (history)
  • /trunk/extensions/SocialProfile/SystemGifts/SystemGift.css (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
@@ -15,7 +15,7 @@
1616 * @param $par Mixed: parameter passed to the page or null
1717 */
1818 public function execute( $par ){
19 - global $wgUser, $wgOut, $wgRequest, $wgScriptPath;
 19+ global $wgUser, $wgOut, $wgRequest, $wgScriptPath, $wgSystemGiftsScripts;
2020 wfLoadExtensionMessages( 'SystemGifts' );
2121
2222 $wgOut->setPageTitle( wfMsg( 'systemgiftmanager' ) );
@@ -38,11 +38,8 @@
3939 return;
4040 }
4141
42 - $css = "<style>
43 - .view-form { font-weight:800; font-size:12px; font-color:#666666; }
44 - .view-status { font-weight:800; font-size:12px; background-color:#FFFB9B; color:#666666; padding:5px; margin-bottom:5px; }
45 - </style>";
46 - $wgOut->addHTML( $css );
 42+ // Add CSS
 43+ $wgOut->addStyle( $wgSystemGiftsScripts . '/SystemGift.css' );
4744
4845 if( $wgRequest->wasPosted() ){
4946 $g = new SystemGifts();
@@ -68,7 +65,7 @@
6966 if( $gift_id || $wgRequest->getVal( 'method' ) == 'edit' ){
7067 $wgOut->addHTML( $this->displayForm( $gift_id ) );
7168 } else {
72 - $wgOut->addHTML( '<div><b><a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManager&method=edit">'.wfMsg( 'ga-addnew' ).'</a></b></div><p>' );
 69+ $wgOut->addHTML( '<div><b><a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManager&amp;method=edit">'.wfMsg( 'ga-addnew' ).'</a></b></div>' );
7370 $wgOut->addHTML( $this->displayGiftList() );
7471 }
7572 }
@@ -92,41 +89,41 @@
9390 function displayForm( $gift_id ){
9491 global $wgUploadPath, $wgScriptPath;
9592
96 - $form = '<div><b><a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManager">'.wfMsg( 'ga-viewlist' ).'</a></b></div><p>';
 93+ $form = '<div><b><a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManager">'.wfMsg( 'ga-viewlist' ).'</a></b></div>';
9794
9895 if( $gift_id ) $gift = SystemGifts::getGift( $gift_id );
9996
100 - $form .= '<form action="" method="post" enctype="multipart/form-data" name="gift">';
101 - $form .= '<table border="0" cellpadding="5" cellspacing="0" width="500">';
102 - $form .= '<tr>
103 - <td width="200" class="view-form">'.wfMsg( 'ga-giftname' ).'</td>
104 - <td width="695"><input type="text" size="45" class="createbox" name="gift_name" value="'. $gift['gift_name'] . '"/></td>
105 - </tr>
106 - <tr>
107 - <td width="200" class="view-form" valign="top">'.wfMsg( 'ga-giftdesc' ).'</td>
108 - <td width="695"><textarea class="createbox" name="gift_description" rows="2" cols="30">'. $gift['gift_description'] . '</textarea></td>
109 - </tr>
110 - <tr>
111 - <td width="200" class="view-form">'.wfMsg( 'ga-gifttype' ).'</td>
112 - <td width="695">
113 - <select name="gift_category">';
 97+ $form .= '<form action="" method="post" enctype="multipart/form-data" name="gift">
 98+ <table border="0" cellpadding="5" cellspacing="0" width="500">
 99+ <tr>
 100+ <td width="200" class="view-form">'.wfMsg( 'ga-giftname' ).'</td>
 101+ <td width="695"><input type="text" size="45" class="createbox" name="gift_name" value="'. $gift['gift_name'] . '"/></td>
 102+ </tr>
 103+ <tr>
 104+ <td width="200" class="view-form" valign="top">'.wfMsg( 'ga-giftdesc' ).'</td>
 105+ <td width="695"><textarea class="createbox" name="gift_description" rows="2" cols="30">'. $gift['gift_description'] . '</textarea></td>
 106+ </tr>
 107+ <tr>
 108+ <td width="200" class="view-form">'.wfMsg( 'ga-gifttype' ).'</td>
 109+ <td width="695">
 110+ <select name="gift_category">';
114111 $g = new SystemGifts();
115112 foreach( $g->categories as $category => $id ){
116113 $form .= '<option' . ( ( $gift['gift_category'] == $id ) ? ' selected="selected"' : '' ) . " value=\"{$id}\">{$category}</option>";
117114 }
118115 $form .= '</select>
 116+ </td>
 117+ </tr>
119118 <tr>
120 - <td width="200" class="view-form">'.wfMsg( 'ga-threshold' ).'</td>
121 - <td width="695"><input type="text" size="25" class="createbox" name="gift_threshold" value="'. $gift['gift_threshold'] . '"/></td>
122 - </tr>
123 - <tr>';
 119+ <td width="200" class="view-form">'.wfMsg( 'ga-threshold' ).'</td>
 120+ <td width="695"><input type="text" size="25" class="createbox" name="gift_threshold" value="'. $gift['gift_threshold'] . '"/></td>
 121+ </tr>';
124122
125123 if( $gift_id ){
126124 $gift_image = '<img src="'. $wgUploadPath .'/awards/' . SystemGifts::getGiftImage( $gift_id, 'l' ) . '" border="0" alt="gift" />';
127125 $form .= '<tr>
128 - <td width="200" class="view-form" valign="top">'.wfMsg('ga-giftimage').'</td>
 126+ <td width="200" class="view-form" valign="top">'.wfMsg( 'ga-giftimage' ).'</td>
129127 <td width="695">' . $gift_image . '
130 - <p>
131128 <a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManagerLogo&gift_id=' . $gift_id . '">'.wfMsg( 'ga-img' ).'</a>
132129 </td>
133130 </tr>';
@@ -134,9 +131,9 @@
135132
136133 $form .= '<tr>
137134 <td colspan="2">
138 - <input type="hidden" name="id" value="' . $gift['gift_id'] . '">
139 - <input type="button" class="createbox" value="' . ( ( $gift['gift_id'] ) ? wfMsg( 'edit' ) : wfMsg( 'ga-create-gift' ) ) . '" size="20" onclick="document.gift.submit()" />
140 - <input type="button" class="createbox" value="'.wfMsg( 'cancel' ).'" size="20" onclick="history.go(-1)" />
 135+ <input type="hidden" name="id" value="' . $gift['gift_id'] . '" />
 136+ <input type="button" class="createbox" value="' . ( ( $gift['gift_id'] ) ? wfMsg( 'edit' ) : wfMsg( 'ga-create-gift' ) ) . '" size="20" onclick="document.gift.submit()" />
 137+ <input type="button" class="createbox" value="'.wfMsg( 'cancel' ).'" size="20" onclick="history.go(-1)" />
141138 </td>
142139 </tr>
143140 </table>
Index: trunk/extensions/SocialProfile/SystemGifts/SystemGift.css
@@ -1,117 +1,133 @@
22 .back-links {
3 - margin:0px 0px 10px 0px;
 3+ margin: 0px 0px 10px 0px;
44 }
55
66 .back-links a {
7 - text-decoration:none;
8 - font-weight:bold;
 7+ text-decoration: none;
 8+ font-weight: bold;
99 }
1010
1111 .ga-count {
12 - margin:0px 0px 15px 0px;
 12+ margin: 0px 0px 15px 0px;
1313 }
1414
1515 .ga-item {
16 - border:1px solid #D7DEE8;
17 - padding:7px;
18 - float:left;
19 - margin:0px 15px 15px 0px;
20 - width:350px;
 16+ border: 1px solid #D7DEE8;
 17+ padding: 7px;
 18+ float: left;
 19+ margin: 0px 15px 15px 0px;
 20+ width: 350px;
2121 }
2222
2323 .ga-item a {
24 - text-decoration:none;
25 - font-weight:bold;
26 - font-size:14px;
 24+ text-decoration: none;
 25+ font-weight: bold;
 26+ font-size: 14px;
2727 }
2828
2929 .ga-item img {
30 - border:1px solid #dcdcdc;
31 - background-color:#fff;
32 - padding:3px;
33 - display:block;
34 - float:left;
35 - margin:0px 10px 0px 0px;
 30+ border: 1px solid #dcdcdc;
 31+ background-color: #fff;
 32+ padding: 3px;
 33+ display: block;
 34+ float: left;
 35+ margin: 0px 10px 0px 0px;
3636 }
3737
3838 .page-nav a {
39 - font-weight:bold;
 39+ font-weight: bold;
4040 }
4141
4242 .ga-new {
43 - background-color:#FFFB9B;
44 - border:1px solid #FDC745;
45 - font-weight:bold;
46 - padding:0px 5px;
 43+ background-color: #FFFB9B;
 44+ border: 1px solid #FDC745;
 45+ font-weight: bold;
 46+ padding: 0px 5px;
4747 }
4848
4949 .ga-name {
50 - font-size:16px;
51 - font-weight:bold;
52 - margin:0px 0px 2px;
 50+ font-size: 16px;
 51+ font-weight: bold;
 52+ margin: 0px 0px 2px;
5353 }
5454
5555 .ga-timestamp {
56 - font-size:9px;
57 - color:#999;
58 - margin:0px 0px 5px 0px;
 56+ font-size: 9px;
 57+ color: #999;
 58+ margin: 0px 0px 5px 0px;
5959 }
6060
6161 .ga-description-message {
62 - margin:0px 0px 5px 0px;
63 - color:#666;
64 - font-weight:bold;
 62+ margin: 0px 0px 5px 0px;
 63+ color: #666;
 64+ font-weight: bold;
6565 }
6666
6767 .ga-gift-count {
68 - font-size:9px;
69 - margin:0px 0px 10px 0px;
 68+ font-size: 9px;
 69+ margin: 0px 0px 10px 0px;
7070 }
7171
7272 .ga-description-container {
73 - width:480px;
74 - margin:20px 0px;
 73+ width: 480px;
 74+ margin: 20px 0px;
7575 }
7676
7777 .ga-recent {
78 - border-top:1px solid #EFEFEF;
79 - padding:10px 0px 0px 0px;
 78+ border-top: 1px solid #EFEFEF;
 79+ padding: 10px 0px 0px 0px;
8080 }
8181
8282 .ga-recent img {
83 - vertical-align:middle;
84 - padding:3px;
85 - background-color:#fff;
86 - border:1px solid #dcdcdc;
87 - margin:0px 10px 0px 0px;
 83+ vertical-align: middle;
 84+ padding: 3px;
 85+ background-color: #fff;
 86+ border: 1px solid #dcdcdc;
 87+ margin: 0px 10px 0px 0px;
8888 }
8989
9090 .ga-recent a {
91 - display:block;
92 - float:left;
93 - text-decoration:none;
 91+ display: block;
 92+ float: left;
 93+ text-decoration: none;
9494 }
9595
9696 .ga-recent-title {
97 - font-size:14px;
98 - font-weight:bold;
99 - color:#777;
100 - margin:0px 0px 2px 0px;
 97+ font-size: 14px;
 98+ font-weight: bold;
 99+ color: #777;
 100+ margin: 0px 0px 2px 0px;
101101 }
102102
103103 .ga-recent-item {
104 - margin:0px 0px 5px 0px;
 104+ margin: 0px 0px 5px 0px;
105105 }
106106
107107 .ga-description {
108 - padding:0px 0px 15px 0px;
 108+ padding: 0px 0px 15px 0px;
109109 }
110110
111111 .ga-description img {
112 - border:1px solid #dcdcdc;
113 - background-color:#fff;
114 - padding:3px;
115 - display:block;
116 - float:left;
117 - margin:0px 10px 0px 0px;
 112+ border: 1px solid #dcdcdc;
 113+ background-color: #fff;
 114+ padding: 3px;
 115+ display: block;
 116+ float: left;
 117+ margin: 0px 10px 0px 0px;
 118+}
 119+
 120+/* Special:SystemGiftManager */
 121+.view-form {
 122+ font-weight: 800;
 123+ font-size: 12px;
 124+ color: #666666;
 125+}
 126+
 127+.view-status {
 128+ font-weight: 800;
 129+ font-size: 12px;
 130+ background-color: #FFFB9B;
 131+ color: #666666;
 132+ padding: 5px;
 133+ margin-bottom: 5px;
118134 }
\ No newline at end of file

Status & tagging log