r111104 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111103‎ | r111104 | r111105 >
Date:21:36, 9 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
adding minor edit and comment control to edit forms
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/actions/EPEditAction.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPFailForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/actions/EPEditAction.php
@@ -78,6 +78,8 @@
7979 * @since 0.1
8080 */
8181 protected function showContent() {
 82+ $out = $this->getOutput();
 83+
8284 $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_>
8385
8486 $data = $this->getNewData();
@@ -85,7 +87,7 @@
8688 $object = $c::selectRow( null, $data );
8789
8890 if ( $object !== false && $this->getRequest()->getText( 'redlink' ) === '1' ) {
89 - $this->getOutput()->redirect( $this->getTitle()->getLocalURL() );
 91+ $out->redirect( $this->getTitle()->getLocalURL() );
9092 }
9193 else {
9294 if ( $object === false ) {
@@ -101,8 +103,8 @@
102104 $this->showWarning( wfMessage( 'ep-' . strtolower( $this->getName() ) . '-exists-already' ) );
103105 }
104106
105 - $this->getOutput()->setPageTitle( $this->getPageTitle() );
106 - $this->getOutput()->setSubtitle( $this->getDescription() );
 107+ $out->setPageTitle( $this->getPageTitle() );
 108+ $out->setSubtitle( $this->getDescription() );
107109
108110 $this->item = $object;
109111 $this->showForm();
Index: trunk/extensions/EducationProgram/includes/EPFailForm.php
@@ -47,5 +47,44 @@
4848 public function setQuery( array $query ) {
4949 $this->query = $query;
5050 }
51 -
 51+
 52+ function getBody() {
 53+ $html = $this->displaySection( $this->mFieldTree );
 54+
 55+ $html .= '<br />';
 56+
 57+ $html .= Html::element(
 58+ 'label',
 59+ array( 'for' => 'wpSummary' ),
 60+ wfMsg( 'ep-form-summary' )
 61+ ) . '&#160;';
 62+
 63+ $attrs = array(
 64+ 'id' => 'wpSummary',
 65+ 'name' => 'wpSummary',
 66+ 'size' => 60,
 67+ 'maxlength' => 250,
 68+ 'spellcheck' => true
 69+ );
 70+
 71+ $attrs = array_merge( $attrs, Linker::tooltipAndAccesskeyAttribs( 'ep-summary' ) );
 72+
 73+ $html .= Html::element(
 74+ 'input',
 75+ $attrs
 76+ ) . '<br />';
 77+
 78+ $attrs = Linker::tooltipAndAccesskeyAttribs( 'ep-minor' );
 79+
 80+ $html .= Xml::checkLabel(
 81+ wfMsg( 'ep-form-minor' ),
 82+ 'wpMinoredit',
 83+ 'wpMinoredit',
 84+ false,
 85+ $attrs
 86+ ) . '<br />';
 87+
 88+ return $html;
 89+ }
 90+
5291 }
\ No newline at end of file
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -25,6 +25,8 @@
2626 'ep-toplink' => 'My courses',
2727 'ep-org-course-delete-comment' => "Deleted institution $1 and all it's courses with comment $2",
2828 'ep-org-course-delete' => "Deleted institution $1 and all it's courses",
 29+ 'ep-form-summary' => 'Summary:',
 30+ 'ep-form-minor' => 'This is a minor edit',
2931
3032 // Tabs
3133 'ep-tab-view' => 'Read',
@@ -37,11 +39,15 @@
3840 'tooltip-ep-form-save' => 'Save',
3941 'tooltip-ep-edit-institution' => 'Edit this institution',
4042 'tooltip-ep-edit-course' => 'Edit this course',
 43+ 'tooltip-ep-summary' => 'Enter a short summary',
 44+ 'tooltip-ep-minor' => 'Marks this as a minor edit',
4145
4246 // Access keys
4347 'accesskey-ep-form-save' => 's', # do not translate or duplicate this message to other languages
4448 'accesskey-ep-edit-institution' => 'e', # do not translate or duplicate this message to other languages
4549 'accesskey-ep-edit-course' => 'e', # do not translate or duplicate this message to other languages
 50+ 'accesskey-ep-summary' => 'b', # do not translate or duplicate this message to other languages
 51+ 'accesskey-ep-minor' => 'i', # do not translate or duplicate this message to other languages
4652
4753 // Navigation links
4854 'ep-nav-orgs' => 'Institution list',

Status & tagging log