Index: trunk/extensions/CongressLookup/SpecialCongressLookup.php |
— | — | @@ -112,7 +112,6 @@ |
113 | 113 | } |
114 | 114 | .sopaActionDiv { |
115 | 115 | margin-bottom: 1em; |
116 | | - margin-left: 1em; |
117 | 116 | } |
118 | 117 | </style> |
119 | 118 | </head> |
— | — | @@ -140,10 +139,12 @@ |
141 | 140 | </p> |
142 | 141 | </div> |
143 | 142 | <div id="contacts"> |
144 | | - <h4>Your Representatives:</h4> |
| 143 | + |
145 | 144 | HTML; |
146 | 145 | if ( $this->zip ) { |
147 | 146 | $htmlOut .= $this->getCongressTables(); |
| 147 | + } else { |
| 148 | + $htmlOut .= $this->getZipForm(); |
148 | 149 | } |
149 | 150 | |
150 | 151 | // Output end of the page |
— | — | @@ -156,13 +157,15 @@ |
157 | 158 | |
158 | 159 | /** |
159 | 160 | * Get an HTML table of data for the user's congressional representatives |
160 | | - * @return HTML for the table |
| 161 | + * @return string HTML for the table |
161 | 162 | */ |
162 | 163 | private function getCongressTables() { |
163 | 164 | $myRepresentative = CongressLookupDB::getRepresentative( $this->zip ); |
164 | 165 | $mySenators = CongressLookupDB::getSenators( $this->zip ); |
165 | 166 | |
166 | 167 | $congressTable = ''; |
| 168 | + |
| 169 | + $congressTable .= Html::element( 'h4', array(), 'Your Representatives:' ); |
167 | 170 | |
168 | 171 | if ( $myRepresentative ) { |
169 | 172 | $congressTable .= Html::openElement( 'table', array ( |
— | — | @@ -222,5 +225,58 @@ |
223 | 226 | |
224 | 227 | return $congressTable; |
225 | 228 | } |
226 | | - |
| 229 | + |
| 230 | + /** |
| 231 | + * Get HTML for a Zip Code form |
| 232 | + * @return string HTML |
| 233 | + */ |
| 234 | + private function getZipForm() { |
| 235 | + $htmlOut = <<<HTML |
| 236 | +<h4>Contact your representatives</h4> |
| 237 | +<div class="sopaActionDiv"> |
| 238 | + <form action="" method="GET"> |
| 239 | + <label for="zip">Your zip code:</label> |
| 240 | + <input type="text" maxlength="10" size="5" name="zip"/> |
| 241 | + <input type="submit" value="Look up" name="submit"/> |
| 242 | + </form> |
| 243 | +</div> |
| 244 | +HTML; |
| 245 | + return $htmlOut; |
| 246 | + } |
| 247 | + |
| 248 | + /** |
| 249 | + * Get HTML for social media links |
| 250 | + * @return string HTML for social media links |
| 251 | + */ |
| 252 | + private function getSocialMedia() { |
| 253 | + $htmlOut = <<<HTML |
| 254 | +<div class="sopaActionDiv"> |
| 255 | + <div> |
| 256 | + <div class="sopaSocial"> |
| 257 | + <a style="text-decoration: none;" href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fexample.com%2F"> |
| 258 | + <img width="33" height="33" src="//upload.wikimedia.org/wikipedia/commons/2/2a/WP_SOPA_sm_icon_facebook_dedede.png"> |
| 259 | + </a> |
| 260 | + <br/> |
| 261 | + <a style="text-decoration: none;" href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fexample.com%2F">Facebook</a> |
| 262 | + </div> |
| 263 | + <div class="sopaSocial"> |
| 264 | + <a style="text-decoration: none;" href="https://m.google.com/app/plus/x/?v=compose&content=Google%20Plus%20Post%20Here%20http%3A%2F%2Fexample.com%2F"> |
| 265 | + <img width="33" height="33" src="//upload.wikimedia.org/wikipedia/commons/0/08/WP_SOPA_sm_icon_gplus_dedede.png"> |
| 266 | + </a> |
| 267 | + <br/> |
| 268 | + <a style="text-decoration: none; color:" href="https://m.google.com/app/plus/x/?v=compose&content=Google%20Plus%20Post%20Here%20http%3A%2F%2Fexample.com%2F">Google+</a> |
| 269 | + </div> |
| 270 | + <div class="sopaSocial"> |
| 271 | + <a style="text-decoration: none;" href="https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Ftest.wikipedia.org%2Fwiki%2FMain_Page%3Fbanner%3Dblackout&text=Tweet%20here%20%23WikipediaBlackout%20http%3A%2F%2Fexample.com%2F"> |
| 272 | + <img width="33" height="33" src="//upload.wikimedia.org/wikipedia/commons/4/45/WP_SOPA_sm_icon_twitter_dedede.png"> |
| 273 | + </a> |
| 274 | + <br/> |
| 275 | + <a style="text-decoration: none;" href="https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Ftest.wikipedia.org%2Fwiki%2FMain_Page%3Fbanner%3Dblackout&text=Tweet%20here%20%23WikipediaBlackout%20http%3A%2F%2Fexample.com%2F">Twitter</a> |
| 276 | + </div> |
| 277 | + </div> |
| 278 | + <div style="clear: both;"></div> |
| 279 | +</div> |
| 280 | +HTML; |
| 281 | + return $htmlOut; |
| 282 | + } |
227 | 283 | } |