Index: trunk/extensions/OpenStackManager/special/SpecialNova.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | |
12 | 12 | $this->setHeaders(); |
13 | 13 | $wgOut->setPagetitle( wfMsg( 'openstackmanager-notloggedin' ) ); |
14 | | - $wgOut->addHTML( wfMsg( 'openstackmanager-mustbeloggedin' ) ); |
| 14 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-mustbeloggedin' ) ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | |
23 | 23 | $this->setHeaders(); |
24 | 24 | $wgOut->setPagetitle( wfMsg( 'openstackmanager-nonovacred' ) ); |
25 | | - $wgOut->addHTML( wfMsg( 'openstackmanager-nonovacred-admincreate' ) ); |
| 25 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonovacred-admincreate' ) ); |
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | |
34 | 34 | $this->setHeaders(); |
35 | 35 | $wgOut->setPagetitle( wfMsg( 'openstackmanager-noaccount' ) ); |
36 | | - $wgOut->addHTML( wfMsg( 'openstackmanager-noaccount2' ) ); |
| 36 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-noaccount2' ) ); |
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
— | — | @@ -45,13 +45,13 @@ |
46 | 46 | $this->setHeaders(); |
47 | 47 | if ( $role == 'sysadmin' ) { |
48 | 48 | $wgOut->setPagetitle( wfMsg( 'openstackmanager-needsysadminrole' ) ); |
49 | | - $wgOut->addHTML( wfMsg( 'openstackmanager-needsysadminrole2' ) ); |
| 49 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-needsysadminrole2' ) ); |
50 | 50 | } else if ( $role == 'netadmin' ) { |
51 | 51 | $wgOut->setPagetitle( wfMsg( 'openstackmanager-neednetadminrole' ) ); |
52 | | - $wgOut->addHTML( wfMsg( 'openstackmanager-neednetadminrole2' ) ); |
| 52 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-neednetadminrole2' ) ); |
53 | 53 | } else if ( $role == 'cloudadmin' ) { |
54 | 54 | $wgOut->setPagetitle( wfMsg( 'openstackmanager-needcloudadminrole' ) ); |
55 | | - $wgOut->addHTML( wfMsg( 'openstackmanager-needcloudadminrole2' ) ); |
| 55 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-needcloudadminrole2' ) ); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaRole.php |
— | — | @@ -61,8 +61,7 @@ |
62 | 62 | } |
63 | 63 | } |
64 | 64 | if ( ! $member_keys ) { |
65 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nomemberstoadd' ) ); |
66 | | - $wgOut->addHTML( $out ); |
| 65 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nomemberstoadd' ) ); |
67 | 66 | return true; |
68 | 67 | } |
69 | 68 | $roleInfo['members'] = array( |
— | — | @@ -149,8 +148,7 @@ |
150 | 149 | } |
151 | 150 | } |
152 | 151 | if ( ! $member_keys ) { |
153 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nomemberstoremove' ) ); |
154 | | - $wgOut->addHTML( $out ); |
| 152 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nomemberstoremove' ) ); |
155 | 153 | return true; |
156 | 154 | } |
157 | 155 | $roleInfo = array(); |
— | — | @@ -243,8 +241,7 @@ |
244 | 242 | if ( $projectname ) { |
245 | 243 | $project = OpenStackNovaProject::getProjectByName( $projectname ); |
246 | 244 | if ( ! $project ) { |
247 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistentproject' ) ); |
248 | | - $wgOut->addHTML( $out ); |
| 245 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistentproject' ) ); |
249 | 246 | return true; |
250 | 247 | } |
251 | 248 | $role = OpenStackNovaRole::getProjectRoleByName( $formData['rolename'], $project ); |
— | — | @@ -254,21 +251,19 @@ |
255 | 252 | $members = array( $formData['members'] ); |
256 | 253 | } |
257 | 254 | if ( ! $role ) { |
258 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistentrole' ) ); |
259 | | - $wgOut->addHTML( $out ); |
| 255 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistentrole' ) ); |
260 | 256 | return true; |
261 | 257 | } |
262 | | - $out = ''; |
263 | 258 | foreach ( $members as $member ) { |
264 | 259 | $success = $role->addMember( $member ); |
265 | 260 | if ( $success ) { |
266 | | - $out .= Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addedto', array(), $member, $formData['rolename'] ) ); |
| 261 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addedto', $member, $formData['rolename'] ) ); |
267 | 262 | } else { |
268 | | - $out .= Html::element( 'p', array(), wfMsgExt( 'openstackmanager-failedtoadd', array(), $member, $formData['rolename'] ) ); |
| 263 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-failedtoadd', $member, $formData['rolename'] ) ); |
269 | 264 | } |
270 | 265 | } |
271 | | - $out .= '<br />'; |
272 | 266 | $sk = $wgUser->getSkin(); |
| 267 | + $out = '<br />'; |
273 | 268 | $returnto = Title::newFromText( $formData['returnto'] ); |
274 | 269 | $out .= $sk->link( $returnto, wfMsg( 'openstackmanager-backprojectlist' ), array(), array(), array() ); |
275 | 270 | $wgOut->addHTML( $out ); |
— | — | @@ -288,8 +283,7 @@ |
289 | 284 | if ( $projectname ) { |
290 | 285 | $project = OpenStackNovaProject::getProjectByName( $projectname ); |
291 | 286 | if ( ! $project ) { |
292 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistentproject' ) ); |
293 | | - $wgOut->addHTML( $out ); |
| 287 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistentproject' ) ); |
294 | 288 | return true; |
295 | 289 | } |
296 | 290 | $role = OpenStackNovaRole::getProjectRoleByName( $formData['rolename'], $project ); |
— | — | @@ -297,21 +291,19 @@ |
298 | 292 | $role = OpenStackNovaRole::getGlobalRoleByName( $formData['rolename'] ); |
299 | 293 | } |
300 | 294 | if ( ! $role ) { |
301 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistentrole' ) ); |
302 | | - $wgOut->addHTML( $out ); |
| 295 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistentrole' ) ); |
303 | 296 | return true; |
304 | 297 | } |
305 | | - $out = ''; |
306 | 298 | foreach ( $formData['members'] as $member ) { |
307 | 299 | $success = $role->deleteMember( $member ); |
308 | 300 | if ( $success ) { |
309 | | - $out .= Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removedfrom', array(), $member, $formData['rolename'] ) ); |
| 301 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removedfrom', $member, $formData['rolename'] ) ); |
310 | 302 | } else { |
311 | | - $out .= Html::element( 'p', array(), wfMsgExt( 'openstackmanager-failedtoremove', array(), $member, $formData['rolename'] ) ); |
| 303 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-failedtoremove', $member, $formData['rolename'] ) ); |
312 | 304 | } |
313 | 305 | } |
314 | | - $out .= '<br />'; |
315 | 306 | $sk = $wgUser->getSkin(); |
| 307 | + $out = '<br />'; |
316 | 308 | $returnto = Title::newFromText( $formData['returnto'] ); |
317 | 309 | $out .= $sk->link( $returnto, wfMsg( 'openstackmanager-backprojectlist' ), array(), array(), array() ); |
318 | 310 | $wgOut->addHTML( $out ); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php |
— | — | @@ -262,7 +262,7 @@ |
263 | 263 | if ( $wgOpenStackManagerPuppetOptions['enabled'] ) { |
264 | 264 | $host = OpenStackNovaHost::getHostByInstanceId( $instanceid ); |
265 | 265 | if ( ! $host ) { |
266 | | - $wgOut->addHTML( Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistanthost' ) ) ); |
| 266 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistenthost' ) ); |
267 | 267 | return false; |
268 | 268 | } |
269 | 269 | $puppetinfo = $host->getPuppetConfiguration(); |
— | — | @@ -331,8 +331,7 @@ |
332 | 332 | } |
333 | 333 | $instanceid = $wgRequest->getText( 'instanceid' ); |
334 | 334 | if ( ! $wgRequest->wasPosted() ) { |
335 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deleteinstancequestion', array(), $instanceid ) ); |
336 | | - $wgOut->addHTML( $out ); |
| 335 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deleteinstancequestion', $instanceid ) ); |
337 | 336 | } |
338 | 337 | $instanceInfo = array(); |
339 | 338 | $instanceInfo['instanceid'] = array( |
— | — | @@ -351,7 +350,6 @@ |
352 | 351 | $instanceForm->setTitle( SpecialPage::getTitleFor( 'NovaInstance' ) ); |
353 | 352 | $instanceForm->setSubmitID( 'novainstance-form-deleteinstancesubmit' ); |
354 | 353 | $instanceForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) ); |
355 | | - $instanceForm->setSubmitText( 'confirm' ); |
356 | 354 | $instanceForm->show(); |
357 | 355 | |
358 | 356 | return true; |
— | — | @@ -494,11 +492,9 @@ |
495 | 493 | global $wgOut, $wgUser; |
496 | 494 | global $wgOpenStackManagerPuppetOptions; |
497 | 495 | |
498 | | - $sk = $wgUser->getSkin(); |
499 | 496 | $domain = OpenStackNovaDomain::getDomainByName( $formData['domain'] ); |
500 | 497 | if ( !$domain ) { |
501 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-invaliddomain' ) ); |
502 | | - $wgOut->addHtml( $out ); |
| 498 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-invaliddomain' ) ); |
503 | 499 | return true; |
504 | 500 | } |
505 | 501 | $instance = $this->userNova->createInstance( $formData['instancename'], $formData['imageType'], '', $formData['instanceType'], $formData['availabilityZone'], $formData['groups'] ); |
— | — | @@ -522,17 +518,17 @@ |
523 | 519 | $title = Title::newFromText( $wgOut->getPageTitle() ); |
524 | 520 | $job = new OpenStackNovaHostJob( $title, array( 'instanceid' => $instance->getInstanceId() ) ); |
525 | 521 | $job->insert(); |
526 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-createdinstance', array(), |
527 | | - $instance->getInstanceID(), $instance->getImageId(), |
528 | | - $host->getFullyQualifiedHostName() ) ); |
| 522 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createdinstance', $instance->getInstanceID(), $instance->getImageId(), $host->getFullyQualifiedHostName() ) ); |
529 | 523 | } else { |
530 | 524 | $this->userNova->terminateInstance( $instance->getInstanceId() ); |
531 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-createfailedldap' ) ); |
| 525 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createfailedldap' ) ); |
532 | 526 | } |
533 | 527 | # TODO: also add puppet |
534 | 528 | } else { |
535 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-createinstancefailed' ) ); |
| 529 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createeinstancefailed' ) ); |
536 | 530 | } |
| 531 | + $sk = $wgUser->getSkin(); |
| 532 | + $out = '<br />'; |
537 | 533 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backinstancelist' ), array(), array(), array() ); |
538 | 534 | |
539 | 535 | $wgOut->addHTML( $out ); |
— | — | @@ -547,11 +543,9 @@ |
548 | 544 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
549 | 545 | global $wgOut, $wgUser; |
550 | 546 | |
551 | | - $sk = $wgUser->getSkin(); |
552 | 547 | $instance = $this->adminNova->getInstance( $formData['instanceid'] ); |
553 | 548 | if ( ! $instance ) { |
554 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistanthost' ) ); |
555 | | - $wgOut->addHtml( $out ); |
| 549 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistanthost' ) ); |
556 | 550 | return true; |
557 | 551 | } |
558 | 552 | $instancename = $instance->getInstanceName(); |
— | — | @@ -560,13 +554,15 @@ |
561 | 555 | if ( $success ) { |
562 | 556 | $success = OpenStackNovaHost::deleteHostByInstanceId( $instanceid ); |
563 | 557 | if ( $success ) { |
564 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedinstance', array(), $instanceid ) ); |
| 558 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletedinstance', $instanceid ) ); |
565 | 559 | } else { |
566 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedinstance-faileddns', array(), $instancename, $instanceid ) ); |
| 560 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletedinstance-faileddns', $instancename, $instanceid ) ); |
567 | 561 | } |
568 | 562 | } else { |
569 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deleteinstancefailed' ) ); |
| 563 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deleteinstancefailed' ) ); |
570 | 564 | } |
| 565 | + $sk = $wgUser->getSkin(); |
| 566 | + $out = '<br />'; |
571 | 567 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backinstancelist' ), array(), array(), array() ); |
572 | 568 | |
573 | 569 | $wgOut->addHTML( $out ); |
— | — | @@ -582,7 +578,6 @@ |
583 | 579 | global $wgOut, $wgUser; |
584 | 580 | global $wgOpenStackManagerPuppetOptions; |
585 | 581 | |
586 | | - $sk = $wgUser->getSkin(); |
587 | 582 | $host = OpenStackNovaHost::getHostByInstanceId( $formData['instanceid'] ); |
588 | 583 | if ( $host ) { |
589 | 584 | $puppetinfo = array(); |
— | — | @@ -600,13 +595,15 @@ |
601 | 596 | } |
602 | 597 | $success = $host->modifyPuppetConfiguration( $puppetinfo ); |
603 | 598 | if ( $success ) { |
604 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-modifiedinstance' ) ); |
| 599 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-modifiedinstance' ) ); |
605 | 600 | } else { |
606 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-modifyinstancefailed' ) ); |
| 601 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-modifyinstancefailed' ) ); |
607 | 602 | } |
608 | 603 | } else { |
609 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistanthost' ) ); |
| 604 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistanthost' ) ); |
610 | 605 | } |
| 606 | + $sk = $wgUser->getSkin(); |
| 607 | + $out = '<br /'; |
611 | 608 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backinstancelist' ), array(), array(), array() ); |
612 | 609 | |
613 | 610 | $wgOut->addHTML( $out ); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php |
— | — | @@ -152,8 +152,7 @@ |
153 | 153 | } |
154 | 154 | $securitygroupname = $wgRequest->getText( 'groupname' ); |
155 | 155 | if ( ! $wgRequest->wasPosted() ) { |
156 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletesecuritygroup-confirm', array(), $securitygroupname ) ); |
157 | | - $wgOut->addHTML( $out ); |
| 156 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletesecuritygroup-confirm', $securitygroupname ) ); |
158 | 157 | } |
159 | 158 | $securityGroupInfo = array(); |
160 | 159 | $securityGroupInfo['groupname'] = array( |
— | — | @@ -172,7 +171,6 @@ |
173 | 172 | $securityGroupForm->setTitle( SpecialPage::getTitleFor( 'NovaSecurityGroup' ) ); |
174 | 173 | $securityGroupForm->setSubmitID( 'novainstance-form-deletesecuritygroupsubmit' ); |
175 | 174 | $securityGroupForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) ); |
176 | | - $securityGroupForm->setSubmitText( 'confirm' ); |
177 | 175 | $securityGroupForm->show(); |
178 | 176 | |
179 | 177 | return true; |
— | — | @@ -398,8 +396,7 @@ |
399 | 397 | } |
400 | 398 | $securitygroupname = $wgRequest->getText( 'groupname' ); |
401 | 399 | if ( ! $wgRequest->wasPosted() ) { |
402 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removerule-confirm', array(), $securitygroupname ) ); |
403 | | - $wgOut->addHTML( $out ); |
| 400 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removerule-confirm', $securitygroupname ) ); |
404 | 401 | } |
405 | 402 | $securityGroupInfo = array(); |
406 | 403 | $securityGroupInfo['groupname'] = array( |
— | — | @@ -442,7 +439,6 @@ |
443 | 440 | $securityGroupForm->setTitle( SpecialPage::getTitleFor( 'NovaSecurityGroup' ) ); |
444 | 441 | $securityGroupForm->setSubmitID( 'novainstance-form-removerulesubmit' ); |
445 | 442 | $securityGroupForm->setSubmitCallback( array( $this, 'tryRemoveRuleSubmit' ) ); |
446 | | - $securityGroupForm->setSubmitText( 'confirm' ); |
447 | 443 | $securityGroupForm->show(); |
448 | 444 | |
449 | 445 | return true; |
— | — | @@ -456,7 +452,6 @@ |
457 | 453 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
458 | 454 | global $wgOut, $wgUser; |
459 | 455 | |
460 | | - $sk = $wgUser->getSkin(); |
461 | 456 | $project = $formData['project']; |
462 | 457 | $groupname = $formData['groupname']; |
463 | 458 | $description = $formData['description']; |
— | — | @@ -464,10 +459,12 @@ |
465 | 460 | $this->userNova = new OpenStackNovaController( $userCredentials ); |
466 | 461 | $securitygroup = $this->userNova->createSecurityGroup( $groupname, $description ); |
467 | 462 | if ( $securitygroup ) { |
468 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-createdsecuritygroup' ) ); |
| 463 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createdsecuritygroup' ) ); |
469 | 464 | } else { |
470 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-createsecuritygroupfailed' ) ); |
| 465 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createsecuritygroupfailed' ) ); |
471 | 466 | } |
| 467 | + $sk = $wgUser->getSkin(); |
| 468 | + $out = '<br />'; |
472 | 469 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backsecuritygrouplist' ), array(), array(), array() ); |
473 | 470 | |
474 | 471 | $wgOut->addHTML( $out ); |
— | — | @@ -482,24 +479,24 @@ |
483 | 480 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
484 | 481 | global $wgOut, $wgUser; |
485 | 482 | |
486 | | - $sk = $wgUser->getSkin(); |
487 | 483 | $project = $formData['project']; |
488 | 484 | $userCredentials = $this->userLDAP->getCredentials( $project ); |
489 | 485 | $this->userNova = new OpenStackNovaController( $userCredentials ); |
490 | 486 | $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] ); |
491 | 487 | if ( ! $securitygroup ) { |
492 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistantsecuritygroup' ) ); |
493 | | - $wgOut->addHtml( $out ); |
| 488 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistantsecuritygroup' ) ); |
494 | 489 | return true; |
495 | 490 | } |
496 | 491 | $groupname = $securitygroup->getGroupName(); |
497 | 492 | $success = $this->userNova->deleteSecurityGroup( $groupname ); |
498 | 493 | if ( $success ) { |
499 | 494 | # TODO: Ensure group isn't being used |
500 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deletedsecuritygroup' ) ); |
| 495 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletedsecuritygroup' ) ); |
501 | 496 | } else { |
502 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deletesecuritygroupfailed' ) ); |
| 497 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletesecuritygroupfailed' ) ); |
503 | 498 | } |
| 499 | + $sk = $wgUser->getSkin(); |
| 500 | + $out = '<br />'; |
504 | 501 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backsecuritygrouplist' ), array(), array(), array() ); |
505 | 502 | |
506 | 503 | $wgOut->addHTML( $out ); |
— | — | @@ -515,21 +512,22 @@ |
516 | 513 | global $wgOut, $wgUser; |
517 | 514 | global $wgOpenStackManagerPuppetOptions; |
518 | 515 | |
519 | | - $sk = $wgUser->getSkin(); |
520 | 516 | $groupname = $formData['groupname']; |
521 | 517 | $description = $formData['description']; |
522 | 518 | $group = $this->adminNova->getSecurityGroup( $groupname ); |
523 | 519 | if ( $group ) { |
524 | 520 | # This isn't a supported function in the API for now. Leave this action out for now |
525 | | - $success = $this->userNova->modifySecurityGroup( $groupname, array( 'description' => $description )); |
| 521 | + $success = $this->userNova->modifySecurityGroup( $groupname, array( 'description' => $description ) ); |
526 | 522 | if ( $success ) { |
527 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-modifiedgroup' ) ); |
| 523 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-modifiedgroup' ) ); |
528 | 524 | } else { |
529 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-modifygroupfailed' ) ); |
| 525 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-modifygroupfailed' ) ); |
530 | 526 | } |
531 | 527 | } else { |
532 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistantgroup' ) ); |
| 528 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistantgroup' ) ); |
533 | 529 | } |
| 530 | + $sk = $wgUser->getSkin(); |
| 531 | + $out = '<br />'; |
534 | 532 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backsecuritygrouplist' ), array(), array(), array() ); |
535 | 533 | |
536 | 534 | $wgOut->addHTML( $out ); |
— | — | @@ -544,7 +542,6 @@ |
545 | 543 | function tryAddRuleSubmit( $formData, $entryPoint = 'internal' ) { |
546 | 544 | global $wgOut, $wgUser; |
547 | 545 | |
548 | | - $sk = $wgUser->getSkin(); |
549 | 546 | $project = $formData['project']; |
550 | 547 | $fromport = $formData['fromport']; |
551 | 548 | $toport = $formData['toport']; |
— | — | @@ -563,18 +560,19 @@ |
564 | 561 | $this->userNova = new OpenStackNovaController( $userCredentials ); |
565 | 562 | $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] ); |
566 | 563 | if ( ! $securitygroup ) { |
567 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistantsecuritygroup' ) ); |
568 | | - $wgOut->addHtml( $out ); |
| 564 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistantsecuritygroup' ) ); |
569 | 565 | return false; |
570 | 566 | } |
571 | 567 | $groupname = $securitygroup->getGroupName(); |
572 | 568 | $success = $this->userNova->addSecurityGroupRule( $groupname, $fromport, $toport, $protocol, $ranges, $groups ); |
573 | 569 | if ( $success ) { |
574 | 570 | # TODO: Ensure group isn't being used |
575 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-addedrule' ) ); |
| 571 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addedrule' ) ); |
576 | 572 | } else { |
577 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-addrulefailed' ) ); |
| 573 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addrulefailed' ) ); |
578 | 574 | } |
| 575 | + $sk = $wgUser->getSkin(); |
| 576 | + $out = '<br />'; |
579 | 577 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backsecuritygrouplist' ), array(), array(), array() ); |
580 | 578 | |
581 | 579 | $wgOut->addHTML( $out ); |
— | — | @@ -589,7 +587,6 @@ |
590 | 588 | function tryRemoveRuleSubmit( $formData, $entryPoint = 'internal' ) { |
591 | 589 | global $wgOut, $wgUser; |
592 | 590 | |
593 | | - $sk = $wgUser->getSkin(); |
594 | 591 | $project = $formData['project']; |
595 | 592 | $fromport = $formData['fromport']; |
596 | 593 | $toport = $formData['toport']; |
— | — | @@ -611,18 +608,19 @@ |
612 | 609 | $this->userNova = new OpenStackNovaController( $userCredentials ); |
613 | 610 | $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] ); |
614 | 611 | if ( ! $securitygroup ) { |
615 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistantsecuritygroup' ) ); |
616 | | - $wgOut->addHtml( $out ); |
| 612 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistantsecuritygroup' ) ); |
617 | 613 | return false; |
618 | 614 | } |
619 | 615 | $groupname = $securitygroup->getGroupName(); |
620 | 616 | $success = $this->userNova->removeSecurityGroupRule( $groupname, $fromport, $toport, $protocol, $ranges, $groups ); |
621 | 617 | if ( $success ) { |
622 | 618 | # TODO: Ensure group isn't being used |
623 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-removedrule' ) ); |
| 619 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removedrule' ) ); |
624 | 620 | } else { |
625 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-removerulefailed' ) ); |
| 621 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removerulefailed' ) ); |
626 | 622 | } |
| 623 | + $sk = $wgUser->getSkin(); |
| 624 | + $out = '<br />'; |
627 | 625 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backsecuritygrouplist' ), array(), array(), array() ); |
628 | 626 | |
629 | 627 | $wgOut->addHTML( $out ); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php |
— | — | @@ -61,8 +61,7 @@ |
62 | 62 | $userCredentials = $this->userLDAP->getCredentials( $project ); |
63 | 63 | $this->userNova = new OpenStackNovaController( $userCredentials ); |
64 | 64 | if ( ! $wgRequest->wasPosted() ) { |
65 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-allocateaddress-confirm', array(), $project ) ); |
66 | | - $wgOut->addHTML( $out ); |
| 65 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-allocateaddress-confirm', $project ) ); |
67 | 66 | } |
68 | 67 | $addressInfo = array(); |
69 | 68 | $addressInfo['project'] = array( |
— | — | @@ -101,8 +100,7 @@ |
102 | 101 | $this->userNova = new OpenStackNovaController( $userCredentials ); |
103 | 102 | $ip = $wgRequest->getText( 'ip' ); |
104 | 103 | if ( ! $wgRequest->wasPosted() ) { |
105 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-releaseaddress-confirm', array(), $ip ) ); |
106 | | - $wgOut->addHTML( $out ); |
| 104 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-releaseaddress-confirm', $ip ) ); |
107 | 105 | } |
108 | 106 | $addressInfo = array(); |
109 | 107 | $addressInfo['project'] = array( |
— | — | @@ -198,8 +196,7 @@ |
199 | 197 | $this->userNova = new OpenStackNovaController( $userCredentials ); |
200 | 198 | $ip = $wgRequest->getText( 'ip' ); |
201 | 199 | if ( ! $wgRequest->wasPosted() ) { |
202 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-disassociateaddress-confirm', array(), $ip ) ); |
203 | | - $wgOut->addHTML( $out ); |
| 200 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-disassociateaddress-confirm', $ip ) ); |
204 | 201 | } |
205 | 202 | $addressInfo = array(); |
206 | 203 | $addressInfo['project'] = array( |
— | — | @@ -298,8 +295,7 @@ |
299 | 296 | $domain = $wgRequest->getText( 'domain' ); |
300 | 297 | $hostname = $wgRequest->getText( 'hostname' ); |
301 | 298 | if ( ! $wgRequest->wasPosted() ) { |
302 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removehost-confirm', array(), $hostname, $ip ) ); |
303 | | - $wgOut->addHTML( $out ); |
| 299 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removehost-confirm', $hostname, $ip ) ); |
304 | 300 | } |
305 | 301 | $addressInfo = array(); |
306 | 302 | $addressInfo['project'] = array( |
— | — | @@ -438,14 +434,13 @@ |
439 | 435 | |
440 | 436 | $address = $this->userNova->allocateAddress(); |
441 | 437 | if ( ! $address ) { |
442 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-allocateaddressfailed' ) ); |
443 | | - $wgOut->addHTML( $out ); |
| 438 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-allocateaddressfailed' ) ); |
444 | 439 | return true; |
445 | 440 | } |
446 | 441 | $ip = $address->getPublicIP(); |
447 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-allocatedaddress' , array(), $ip ) ); |
448 | | - $out .= '<br />'; |
| 442 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-allocatedaddress', $ip ) ); |
449 | 443 | $sk = $wgUser->getSkin(); |
| 444 | + $out = '<br />'; |
450 | 445 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backaddresslist' ), array(), array(), array() ); |
451 | 446 | $wgOut->addHTML( $out ); |
452 | 447 | |
— | — | @@ -466,24 +461,22 @@ |
467 | 462 | # then release the address |
468 | 463 | $hosts = OpenStackNovaHost::getHostsByIP( $ip ); |
469 | 464 | if ( $hosts ) { |
470 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-cannotreleaseaddress', array(), $ip ) ); |
471 | | - $wgOut->addHTML( $out ); |
| 465 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-cannotreleaseaddress', $ip ) ); |
472 | 466 | return true; |
473 | 467 | } |
474 | 468 | $address = $this->adminNova->getAddress( $ip ); |
475 | 469 | if ( $address->getInstanceId() ) { |
476 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-cannotreleaseaddress', array(), $ip ) ); |
477 | | - $wgOut->addHTML( $out ); |
| 470 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-cannotreleaseaddress', $ip ) ); |
478 | 471 | return true; |
479 | 472 | } |
480 | 473 | $success = $this->userNova->releaseAddress( $ip ); |
481 | 474 | if ( $success ) { |
482 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-releasedaddress', array(), $ip ) ); |
| 475 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-releasedaddress', $ip ) ); |
483 | 476 | } else { |
484 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-releaseaddressfailed', array(), $ip ) ); |
| 477 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-releasedaddressfailed', $ip ) ); |
485 | 478 | } |
486 | | - $out .= '<br />'; |
487 | 479 | $sk = $wgUser->getSkin(); |
| 480 | + $out = '<br />'; |
488 | 481 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backaddresslist' ), array(), array(), array() ); |
489 | 482 | $wgOut->addHTML( $out ); |
490 | 483 | |
— | — | @@ -502,12 +495,12 @@ |
503 | 496 | $ip = $formData['ip']; |
504 | 497 | $address = $this->userNova->associateAddress( $instanceid, $ip ); |
505 | 498 | if ( $address ) { |
506 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-associatedaddress', array(), $ip, $instanceid ) ); |
| 499 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-associatedaddress', $ip, $instanceid ) ); |
507 | 500 | } else { |
508 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-associateaddressfailed', array(), $ip, $instanceid ) ); |
| 501 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-associatedaddressfailed', $ip, $instanceid ) ); |
509 | 502 | } |
510 | | - $out .= '<br />'; |
511 | 503 | $sk = $wgUser->getSkin(); |
| 504 | + $out = '<br />'; |
512 | 505 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backaddresslist' ), array(), array(), array() ); |
513 | 506 | $wgOut->addHTML( $out ); |
514 | 507 | |
— | — | @@ -525,12 +518,12 @@ |
526 | 519 | $ip = $formData['ip']; |
527 | 520 | $address = $this->userNova->disassociateAddress( $ip ); |
528 | 521 | if ( $address ) { |
529 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-disassociatedaddress', array(), $ip ) ); |
| 522 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-disassociatedaddress', $ip ) ); |
530 | 523 | } else { |
531 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-disassociateaddressfailed', array(), $ip ) ); |
| 524 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-disassociatedaddressfailed', $ip ) ); |
532 | 525 | } |
533 | | - $out .= '<br />'; |
534 | 526 | $sk = $wgUser->getSkin(); |
| 527 | + $out = '<br />'; |
535 | 528 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backaddresslist' ), array(), array(), array() ); |
536 | 529 | $wgOut->addHTML( $out ); |
537 | 530 | |
— | — | @@ -549,13 +542,11 @@ |
550 | 543 | $project = $formData['project']; |
551 | 544 | $address = $this->adminNova->getAddress( $ip ); |
552 | 545 | if ( ! $address ) { |
553 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-invalidaddress', array(), $ip ) ); |
554 | | - $wgOut->addHTML( $out ); |
| 546 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-invalidaddress', $ip ) ); |
555 | 547 | return true; |
556 | 548 | } |
557 | 549 | if ( $address->getProject() != $project ) { |
558 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-invalidaddressforproject', array(), $ip ) ); |
559 | | - $wgOut->addHTML( $out ); |
| 550 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-invalidaddressforproject', $ip ) ); |
560 | 551 | return true; |
561 | 552 | } |
562 | 553 | $hostname = $formData['hostname']; |
— | — | @@ -568,29 +559,29 @@ |
569 | 560 | # We need to add an arecord, if the arecord doesn't already exist |
570 | 561 | $success = $hostbyname->addARecord( $ip ); |
571 | 562 | if ( $success ) { |
572 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addedhost', array(), $hostname, $ip ) ); |
| 563 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addedhost', $hostname, $ip ) ); |
573 | 564 | } else { |
574 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addhostfailed', array(), $ip, $hostname ) ); |
| 565 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addhostfailed', $ip, $hostname ) ); |
575 | 566 | } |
576 | 567 | } else if ( $hostbyip ) { |
577 | 568 | # We need to add an associateddomain, if the associateddomain doesn't already exist |
578 | 569 | $success = $hostbyip->addAssociatedDomain( $hostname . '.' . $domain->getFullyQualifiedDomainName() ); |
579 | 570 | if ( $success ) { |
580 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addedhost', array(), $hostname, $ip ) ); |
| 571 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addedhost', $hostname, $ip ) ); |
581 | 572 | } else { |
582 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addhostfailed', array(), $ip, $hostname ) ); |
| 573 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addhostfailed', $ip, $hostname ) ); |
583 | 574 | } |
584 | 575 | } else { |
585 | 576 | # This is a new host entry |
586 | 577 | $host = OpenStackNovaHost::addPublicHost( $hostname, $ip, $domain ); |
587 | 578 | if ( $host ) { |
588 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addedhost', array(), $hostname, $ip ) ); |
| 579 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addedhost', $hostname, $ip ) ); |
589 | 580 | } else { |
590 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addhostfailed', array(), $ip, $hostname ) ); |
| 581 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addhostfailed', $ip, $hostname ) ); |
591 | 582 | } |
592 | 583 | } |
593 | | - $out .= '<br />'; |
594 | 584 | $sk = $wgUser->getSkin(); |
| 585 | + $out = '<br />'; |
595 | 586 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backaddresslist' ), array(), array(), array() ); |
596 | 587 | $wgOut->addHTML( $out ); |
597 | 588 | return true; |
— | — | @@ -608,13 +599,11 @@ |
609 | 600 | $project = $formData['project']; |
610 | 601 | $address = $this->adminNova->getAddress( $ip ); |
611 | 602 | if ( ! $address ) { |
612 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-invalidaddress', array(), $ip ) ); |
613 | | - $wgOut->addHTML( $out ); |
| 603 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-invalidaddress', $ip ) ); |
614 | 604 | return true; |
615 | 605 | } |
616 | 606 | if ( $address->getProject() != $project ) { |
617 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-invalidaddressforproject', array(), $ip ) ); |
618 | | - $wgOut->addHTML( $out ); |
| 607 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-invalidaddressforproject', $ip ) ); |
619 | 608 | return true; |
620 | 609 | } |
621 | 610 | $hostname = $formData['hostname']; |
— | — | @@ -628,23 +617,23 @@ |
629 | 618 | # We need to keep the host, but remove the fqdn |
630 | 619 | $success = $host->deleteAssociatedDomain( $fqdn ); |
631 | 620 | if ( $success ) { |
632 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removedhost', array(), $hostname, $ip ) ); |
| 621 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removedhost', $hostname, $ip ) ); |
633 | 622 | } else { |
634 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removehostfailed', array(), $ip, $hostname ) ); |
| 623 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removehostfailed', $ip, $hostname ) ); |
635 | 624 | } |
636 | 625 | } else { |
637 | 626 | # We need to remove the host entry |
638 | 627 | $success = OpenStackNovaHost::deleteHost( $hostname, $domain ); |
639 | 628 | if ( $success ) { |
640 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removedhost', array(), $hostname, $ip ) ); |
| 629 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removedhost', $hostname, $ip ) ); |
641 | 630 | } else { |
642 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removehostfailed', array(), $ip, $hostname ) ); |
| 631 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removehostfailed', $ip, $hostname ) ); |
643 | 632 | } |
644 | 633 | } |
645 | 634 | } else { |
646 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-nonexistenthost', array() ) ); |
| 635 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistenthost' ) ); |
647 | 636 | } |
648 | | - $out .= '<br />'; |
| 637 | + $out = '<br />'; |
649 | 638 | $sk = $wgUser->getSkin(); |
650 | 639 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backaddresslist' ), array(), array(), array() ); |
651 | 640 | $wgOut->addHTML( $out ); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php |
— | — | @@ -175,8 +175,7 @@ |
176 | 176 | |
177 | 177 | $project = $wgRequest->getText( 'projectname' ); |
178 | 178 | if ( ! $wgRequest->wasPosted() ) { |
179 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removeprojectconfirm', array(), $project ) ); |
180 | | - $wgOut->addHTML( $out ); |
| 179 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removeprojectconfirm', $project ) ); |
181 | 180 | } |
182 | 181 | $projectInfo = array(); |
183 | 182 | $projectInfo['projectname'] = array( |
— | — | @@ -191,7 +190,6 @@ |
192 | 191 | $projectForm->setTitle( SpecialPage::getTitleFor( 'NovaProject' ) ); |
193 | 192 | $projectForm->setSubmitID( 'novaproject-form-deleteprojectsubmit' ); |
194 | 193 | $projectForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) ); |
195 | | - $projectForm->setSubmitText( 'confirm' ); |
196 | 194 | $projectForm->show(); |
197 | 195 | |
198 | 196 | return true; |
— | — | @@ -283,13 +281,12 @@ |
284 | 282 | |
285 | 283 | $success = OpenStackNovaProject::createProject( $formData['projectname'] ); |
286 | 284 | if ( ! $success ) { |
287 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-createprojectfailed' ) ); |
288 | | - $wgOut->addHTML( $out ); |
| 285 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createprojectfailed' ) ); |
289 | 286 | return true; |
290 | 287 | } |
291 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-createdproject' ) ); |
292 | | - $out .= '<br />'; |
| 288 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createdproject' ) ); |
293 | 289 | $sk = $wgUser->getSkin(); |
| 290 | + $out = '<br />'; |
294 | 291 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backprojectlist' ), array(), array(), array() ); |
295 | 292 | $wgOut->addHTML( $out ); |
296 | 293 | |
— | — | @@ -306,12 +303,12 @@ |
307 | 304 | |
308 | 305 | $success = OpenStackNovaProject::deleteProject( $formData['projectname'] ); |
309 | 306 | if ( $success ) { |
310 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deletedproject' ) ); |
| 307 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletedproject' ) ); |
311 | 308 | } else { |
312 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deleteprojectfailed' ) ); |
| 309 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deleteprojectfailed' ) ); |
313 | 310 | } |
314 | | - $out .= '<br />'; |
315 | 311 | $sk = $wgUser->getSkin(); |
| 312 | + $out = '<br />'; |
316 | 313 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backprojectlist' ), array(), array(), array() ); |
317 | 314 | $wgOut->addHTML( $out ); |
318 | 315 | |
— | — | @@ -329,14 +326,12 @@ |
330 | 327 | $project = new OpenStackNovaProject( $formData['projectname'] ); |
331 | 328 | $success = $project->addMember( $formData['member'] ); |
332 | 329 | if ( $success ) { |
333 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addedto', array(), $formData['member'], |
334 | | - $formData['projectname'] ) ); |
| 330 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-addedto', $formData['member'], $formData['projectname'] ) ); |
335 | 331 | } else { |
336 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-failedtoadd', array(), $formData['member'], |
337 | | - $formData['projectname'] ) ); |
| 332 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-failedtoadd', $formData['member'], $formData['projectname'] ) ); |
338 | 333 | } |
339 | | - $out .= '<br />'; |
340 | 334 | $sk = $wgUser->getSkin(); |
| 335 | + $out = '<br />'; |
341 | 336 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backprojectlist' ), array(), array(), array() ); |
342 | 337 | $wgOut->addHTML( $out ); |
343 | 338 | |
— | — | @@ -353,20 +348,18 @@ |
354 | 349 | |
355 | 350 | $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] ); |
356 | 351 | if ( ! $project ) { |
357 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistentproject' ) ); |
358 | | - $wgOut->addHTML( $out ); |
| 352 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-nonexistentproject' ) ); |
359 | 353 | return true; |
360 | 354 | } |
361 | | - $out = ''; |
362 | 355 | foreach ( $formData['members'] as $member ) { |
363 | 356 | $success = $project->deleteMember( $member ); |
364 | 357 | if ( $success ) { |
365 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removedfrom', array(), $member, $formData['projectname'] ) ); |
| 358 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-removedfrom', $member, $formData['projectname'] ) ); |
366 | 359 | } else { |
367 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-failedtoremove', array(), $member, $formData['projectname'] ) ); |
| 360 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-failedtoremove', $member, $formData['projectname'] ) ); |
368 | 361 | } |
369 | 362 | } |
370 | | - $out .= '<br />'; |
| 363 | + $out = '<br />'; |
371 | 364 | $sk = $wgUser->getSkin(); |
372 | 365 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backprojectlist' ), array(), array(), array() ); |
373 | 366 | $wgOut->addHTML( $out ); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php |
— | — | @@ -106,8 +106,7 @@ |
107 | 107 | |
108 | 108 | $domainname = $wgRequest->getText( 'domainname' ); |
109 | 109 | if ( ! $wgRequest->wasPosted() ) { |
110 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedomain-confirm', array(), $domainname ) ); |
111 | | - $wgOut->addHTML( $out ); |
| 110 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletedomain-confirm', $domainname ) ); |
112 | 111 | } |
113 | 112 | $domainInfo = array(); |
114 | 113 | $domainInfo['domainname'] = array( |
— | — | @@ -122,7 +121,6 @@ |
123 | 122 | $domainForm->setTitle( SpecialPage::getTitleFor( 'NovaDomain' ) ); |
124 | 123 | $domainForm->setSubmitID( 'novadomain-form-deletedomainsubmit' ); |
125 | 124 | $domainForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) ); |
126 | | - $domainForm->setSubmitText( 'confirm' ); |
127 | 125 | $domainForm->show(); |
128 | 126 | |
129 | 127 | return true; |
— | — | @@ -175,13 +173,12 @@ |
176 | 174 | |
177 | 175 | $success = OpenStackNovaDomain::createDomain( $formData['domainname'], $formData['fqdn'], $formData['location'] ); |
178 | 176 | if ( ! $success ) { |
179 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-createdomainfailed' ) ); |
180 | | - $wgOut->addHTML( $out ); |
| 177 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createdomainfailed' ) ); |
181 | 178 | return true; |
182 | 179 | } |
183 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-createddomain' ) ); |
184 | | - $out .= '<br />'; |
| 180 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-createddomain' ) ); |
185 | 181 | $sk = $wgUser->getSkin(); |
| 182 | + $out = '<br />'; |
186 | 183 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backdomainlist' ), array(), array(), array() ); |
187 | 184 | $wgOut->addHTML( $out ); |
188 | 185 | |
— | — | @@ -198,12 +195,12 @@ |
199 | 196 | |
200 | 197 | $success = OpenStackNovaDomain::deleteDomain( $formData['domainname'] ); |
201 | 198 | if ( $success ) { |
202 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deleteddomain' ) ); |
| 199 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deleteddomain' ) ); |
203 | 200 | } else { |
204 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-failedeletedomain' ) ); |
| 201 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-failedeleteddomain' ) ); |
205 | 202 | } |
206 | | - $out .= '<br />'; |
207 | 203 | $sk = $wgUser->getSkin(); |
| 204 | + $out = '<br />'; |
208 | 205 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backdomainlist' ), array(), array(), array() ); |
209 | 206 | $wgOut->addHTML( $out ); |
210 | 207 | |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php |
— | — | @@ -120,9 +120,8 @@ |
121 | 121 | $hash = $wgRequest->getVal( 'hash' ); |
122 | 122 | $keypairs = $this->userLDAP->getKeypairs(); |
123 | 123 | if ( ! $wgRequest->wasPosted() ) { |
124 | | - $out = Html::element( 'pre', array(), $keypairs[$hash] ); |
125 | | - $out .= Html::element( 'p', array(), wfMsg( 'openstackmanager-deletekeyconfirm' ) ); |
126 | | - $wgOut->addHTML( $out ); |
| 124 | + $wgOut->addHTML( Html::element( 'pre', array(), $keypairs[$hash] ) ); |
| 125 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletekeyconfirm' ) ); |
127 | 126 | } |
128 | 127 | $keyInfo['hash'] = array( |
129 | 128 | 'type' => 'hidden', |
— | — | @@ -141,7 +140,6 @@ |
142 | 141 | $keyForm->setTitle( SpecialPage::getTitleFor( 'NovaKey' ) ); |
143 | 142 | $keyForm->setSubmitID( 'novakey-form-deletekeysubmit' ); |
144 | 143 | $keyForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) ); |
145 | | - $keyForm->setSubmitText( 'confirm' ); |
146 | 144 | $keyForm->show(); |
147 | 145 | return true; |
148 | 146 | } |
— | — | @@ -191,7 +189,7 @@ |
192 | 190 | } |
193 | 191 | $out .= Html::rawElement( 'table', array(), $keysOut ); |
194 | 192 | } else { |
195 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-invalidkeypair' ) ); |
| 193 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-invalidkeypair' ) ); |
196 | 194 | } |
197 | 195 | |
198 | 196 | $wgOut->addHTML( $out ); |
— | — | @@ -209,23 +207,21 @@ |
210 | 208 | if ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) { |
211 | 209 | $success = $this->userLDAP->importKeypair( $formData['key'] ); |
212 | 210 | if ( ! $success ) { |
213 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-keypairimportfailed' ) ); |
214 | | - $wgOut->addHTML( $out ); |
| 211 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-keypairimportfailed' ) ); |
215 | 212 | return true; |
216 | 213 | } |
217 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-keypairimported' ) ); |
| 214 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-keypairimported' ) ); |
218 | 215 | } else if ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) { |
219 | 216 | # wgOpenStackManagerNovaKeypairStorage == 'nova' |
220 | 217 | # OpenStack's EC2 API doesn't yet support importing keys, use |
221 | 218 | # of this option isn't currently recommended |
222 | 219 | $keypair = $this->userNova->importKeypair( $formData['keyname'], $formData['key'] ); |
223 | 220 | |
224 | | - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-keypairimportedfingerprint', array(), |
225 | | - $keypair->getKeyName(), $keypair->getKeyFingerprint() ) ); |
| 221 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-keypairimportedfingerprint', $keypair->getKeyName(), $keypair->getKeyFingerprint() ) ); |
226 | 222 | } else { |
227 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-invalidkeypair' ) ); |
| 223 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-invalidkeypair' ) ); |
228 | 224 | } |
229 | | - $out .= '<br />'; |
| 225 | + $out = '<br />'; |
230 | 226 | $sk = $wgUser->getSkin(); |
231 | 227 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backkeylist' ), array(), array(), array() ); |
232 | 228 | $wgOut->addHTML( $out ); |
— | — | @@ -243,11 +239,11 @@ |
244 | 240 | |
245 | 241 | $success = $this->userLDAP->deleteKeypair( $formData['key'] ); |
246 | 242 | if ( $success ) { |
247 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deletedkey' ) ); |
| 243 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletedkey' ) ); |
248 | 244 | } else { |
249 | | - $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deletedkeyfailed' ) ); |
| 245 | + $wgOut->wrapWikiMsg( '<div>$1</div>', array( 'openstackmanager-deletedkeyfailed' ) ); |
250 | 246 | } |
251 | | - $out .= '<br />'; |
| 247 | + $out = '<br />'; |
252 | 248 | $sk = $wgUser->getSkin(); |
253 | 249 | $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-backkeylist' ), array(), array(), array() ); |
254 | 250 | $wgOut->addHTML( $out ); |