https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112944

Revision: 112944
Author:   jeroendedauw
Date:     2012-03-03 12:14:19 +0000 (Sat, 03 Mar 2012)
Log Message:
-----------
address 
http://education.wmflabs.org/index.php/Thread:MW_1.18_talk:Community_portal/Adding_an_institution_as_a_minor_edit

Modified Paths:
--------------
    trunk/extensions/EducationProgram/actions/EPEditAction.php
    trunk/extensions/EducationProgram/includes/EPFailForm.php

Modified: trunk/extensions/EducationProgram/actions/EPEditAction.php
===================================================================
--- trunk/extensions/EducationProgram/actions/EPEditAction.php  2012-03-03 
12:07:23 UTC (rev 112943)
+++ trunk/extensions/EducationProgram/actions/EPEditAction.php  2012-03-03 
12:14:19 UTC (rev 112944)
@@ -236,7 +236,8 @@
                $form->setSubmitText( wfMsg( 'educationprogram-org-submit' ) );
                $form->setSubmitTooltip( 'ep-form-save' );
                $form->setShowSummary( !$this->isNew() );
-               
+               $form->setShowMinorEdit( !$this->isNew() );
+
                $action = $this->isNew() ? 'add' : 'edit';
                $form->setWrapperLegend( $this->msg( $this->prefixMsg( 
'legend-' . $action ) ) );
 

Modified: trunk/extensions/EducationProgram/includes/EPFailForm.php
===================================================================
--- trunk/extensions/EducationProgram/includes/EPFailForm.php   2012-03-03 
12:07:23 UTC (rev 112943)
+++ trunk/extensions/EducationProgram/includes/EPFailForm.php   2012-03-03 
12:14:19 UTC (rev 112944)
@@ -26,6 +26,13 @@
         * @var boolean
         */
        protected $showSummary = true;
+
+       /**
+        * Should the minor edit checkbox be shown or not?
+        * @since 0.1
+        * @var boolean
+        */
+       protected $showMinorEdit = true;
        
        /**
         * Wrap the form innards in an actual <form> element
@@ -80,6 +87,17 @@
        }
 
        /**
+        * Sets if the minor edit checkbox be shown or not.
+        *
+        * @since 0.1
+        *
+        * @param boolean $showMinorEdit
+        */
+       public function setShowMinorEdit( $showMinorEdit ) {
+               $this->showMinorEdit = $showMinorEdit;
+       }
+
+       /**
         * (non-PHPdoc)
         * @see HTMLForm::getBody()
         */
@@ -111,15 +129,17 @@
                        ) . '<br />';
                }
 
-               $attrs = Linker::tooltipAndAccesskeyAttribs( 'ep-minor' );
+               if ( $this->showMinorEdit ) {
+                       $attrs = Linker::tooltipAndAccesskeyAttribs( 'ep-minor' 
);
 
-               $html .= Xml::checkLabel(
-                       wfMsg( 'ep-form-minor' ),
-                       'wpMinoredit',
-                       'wpMinoredit',
-                       false,
-                       $attrs
-               ) . '<br />';
+                       $html .= Xml::checkLabel(
+                               wfMsg( 'ep-form-minor' ),
+                               'wpMinoredit',
+                               'wpMinoredit',
+                               false,
+                               $attrs
+                       ) . '<br />';
+               }
 
                return $html;
        }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to