r112944 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112943‎ | r112944 | r112945 >
Date:12:14, 3 March 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /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
@@ -236,7 +236,8 @@
237237 $form->setSubmitText( wfMsg( 'educationprogram-org-submit' ) );
238238 $form->setSubmitTooltip( 'ep-form-save' );
239239 $form->setShowSummary( !$this->isNew() );
240 -
 240+ $form->setShowMinorEdit( !$this->isNew() );
 241+
241242 $action = $this->isNew() ? 'add' : 'edit';
242243 $form->setWrapperLegend( $this->msg( $this->prefixMsg( 'legend-' . $action ) ) );
243244
Index: trunk/extensions/EducationProgram/includes/EPFailForm.php
@@ -26,6 +26,13 @@
2727 * @var boolean
2828 */
2929 protected $showSummary = true;
 30+
 31+ /**
 32+ * Should the minor edit checkbox be shown or not?
 33+ * @since 0.1
 34+ * @var boolean
 35+ */
 36+ protected $showMinorEdit = true;
3037
3138 /**
3239 * Wrap the form innards in an actual <form> element
@@ -80,6 +87,17 @@
8188 }
8289
8390 /**
 91+ * Sets if the minor edit checkbox be shown or not.
 92+ *
 93+ * @since 0.1
 94+ *
 95+ * @param boolean $showMinorEdit
 96+ */
 97+ public function setShowMinorEdit( $showMinorEdit ) {
 98+ $this->showMinorEdit = $showMinorEdit;
 99+ }
 100+
 101+ /**
84102 * (non-PHPdoc)
85103 * @see HTMLForm::getBody()
86104 */
@@ -111,15 +129,17 @@
112130 ) . '<br />';
113131 }
114132
115 - $attrs = Linker::tooltipAndAccesskeyAttribs( 'ep-minor' );
 133+ if ( $this->showMinorEdit ) {
 134+ $attrs = Linker::tooltipAndAccesskeyAttribs( 'ep-minor' );
116135
117 - $html .= Xml::checkLabel(
118 - wfMsg( 'ep-form-minor' ),
119 - 'wpMinoredit',
120 - 'wpMinoredit',
121 - false,
122 - $attrs
123 - ) . '<br />';
 136+ $html .= Xml::checkLabel(
 137+ wfMsg( 'ep-form-minor' ),
 138+ 'wpMinoredit',
 139+ 'wpMinoredit',
 140+ false,
 141+ $attrs
 142+ ) . '<br />';
 143+ }
124144
125145 return $html;
126146 }

Status & tagging log