Exemplo n.º 1
0
 public function __construct($descriptor, $context = null, $messagePrefix = '')
 {
     parent::__construct($descriptor, $context, $messagePrefix);
     $this->getOutput()->enableOOUI();
     $this->getOutput()->addModules('mediawiki.htmlform.ooui');
     $this->getOutput()->addModuleStyles('mediawiki.htmlform.ooui.styles');
 }
Exemplo n.º 2
0
 function __construct($formID, $fields, $title = null)
 {
     parent::__construct($formID, $fields, $title);
     foreach ($this->fields as $field) {
         $this->setType($field, "checkbox");
     }
 }
 public function __construct(IContextSource $context, $collections_message, $collection_title = '')
 {
     $this->collections_message = empty($collections_message) ? $collections_message : $collections_message . "<br>";
     $this->collection_title = $collection_title;
     $descriptor = $this->getSourceSection();
     parent::__construct($descriptor, $context, 'upload');
 }
Exemplo n.º 4
0
 public function __construct($url = null, $header = null, $method = null, $id = null)
 {
     parent::__construct($url, $method, $id);
     $this->set_header($header);
     $this->add_class(self::$_DEFAULT_CLASS);
     $this->set_callback(self::$_DEFAULT_CALLBACK);
     $this->set_cancel_action(self::$_DEFAULT_CANCEL_ACTION);
 }
Exemplo n.º 5
0
 public function __construct(array $options = array(), IContextSource $context = null)
 {
     if ($context instanceof IContextSource) {
         $this->setContext($context);
     }
     $this->mWatch = !empty($options['watch']);
     $this->mForReUpload = !empty($options['forreupload']);
     $this->mSessionKey = isset($options['sessionkey']) ? $options['sessionkey'] : '';
     $this->mHideIgnoreWarning = !empty($options['hideignorewarning']);
     $this->mDestWarningAck = !empty($options['destwarningack']);
     $this->mDestFile = isset($options['destfile']) ? $options['destfile'] : '';
     $this->mComment = isset($options['description']) ? $options['description'] : '';
     $this->mTextTop = isset($options['texttop']) ? $options['texttop'] : '';
     $this->mTextAfterSummary = isset($options['textaftersummary']) ? $options['textaftersummary'] : '';
     $sourceDescriptor = $this->getSourceSection();
     $descriptor = $sourceDescriptor + $this->getDescriptionSection() + $this->getOptionsSection();
     Hooks::run('UploadFormInitDescriptor', array(&$descriptor));
     parent::__construct($descriptor, $context, 'upload');
     # Add a link to edit MediaWik:Licenses
     if ($this->getUser()->isAllowed('editinterface')) {
         $licensesLink = Linker::linkKnown($this->msg('licenses')->inContentLanguage()->getTitle(), $this->msg('licenses-edit')->escaped(), array(), array('action' => 'edit'));
         $editLicenses = '<p class="mw-upload-editlicenses">' . $licensesLink . '</p>';
         $this->addFooterText($editLicenses, 'description');
     }
     # Set some form properties
     $this->setSubmitText($this->msg('uploadbtn')->text());
     $this->setSubmitName('wpUpload');
     # Used message keys: 'accesskey-upload', 'tooltip-upload'
     $this->setSubmitTooltip('upload');
     $this->setId('mw-upload-form');
     # Build a list of IDs for javascript insertion
     $this->mSourceIds = array();
     foreach ($sourceDescriptor as $field) {
         if (!empty($field['id'])) {
             $this->mSourceIds[] = $field['id'];
         }
     }
 }
Exemplo n.º 6
0
 public function __construct(array $options = array(), IContextSource $context = null)
 {
     $this->mWatch = !empty($options['watch']);
     $this->mForReUpload = !empty($options['forreupload']);
     $this->mSessionKey = isset($options['sessionkey']) ? $options['sessionkey'] : '';
     $this->mHideIgnoreWarning = !empty($options['hideignorewarning']);
     $this->mDestWarningAck = !empty($options['destwarningack']);
     $this->mDestFile = isset($options['destfile']) ? $options['destfile'] : '';
     $this->mComment = isset($options['description']) ? $options['description'] : '';
     $this->mTextTop = isset($options['texttop']) ? $options['texttop'] : '';
     $this->mTextAfterSummary = isset($options['textaftersummary']) ? $options['textaftersummary'] : '';
     $sourceDescriptor = $this->getSourceSection();
     $descriptor = $sourceDescriptor + $this->getDescriptionSection() + $this->getOptionsSection();
     wfRunHooks('UploadFormInitDescriptor', array(&$descriptor));
     parent::__construct($descriptor, $context, 'upload');
     # Set some form properties
     $this->setSubmitText($this->msg('uploadbtn')->text());
     $this->setSubmitName('wpUpload');
     # Used message keys: 'accesskey-upload', 'tooltip-upload'
     $this->setSubmitTooltip('upload');
     $this->setId('mw-upload-form');
     # Build a list of IDs for javascript insertion
     $this->mSourceIds = array();
     foreach ($sourceDescriptor as $field) {
         if (!empty($field['id'])) {
             $this->mSourceIds[] = $field['id'];
         }
     }
 }
	public function __construct( $options = array() ) {
		$this->mWatch = !empty( $options['watch'] );
		$this->mForReUpload = !empty( $options['forreupload'] );
		$this->mSessionKey = isset( $options['sessionkey'] )
				? $options['sessionkey'] : '';
		$this->mHideIgnoreWarning = !empty( $options['hideignorewarning'] );
		$this->mDestWarningAck = !empty( $options['destwarningack'] );

		$this->mDestFile = isset( $options['destfile'] ) ? $options['destfile'] : '';

		$sourceDescriptor = $this->getSourceSection();
		$descriptor = $sourceDescriptor
			+ $this->getDescriptionSection()
			+ $this->getOptionsSection();

		HTMLForm::__construct( $descriptor, 'upload' );

		# Set some form properties
		$this->setSubmitText( wfMsg( 'uploadbtn' ) );
		$this->setSubmitName( 'wpUpload' );
		$this->setSubmitTooltip( 'upload' );
		$this->setId( 'mw-upload-form' );

		# Build a list of IDs for JavaScript insertion
		$this->mSourceIds = array();
		foreach ( $sourceDescriptor as $key => $field ) {
			if ( !empty( $field['id'] ) ) {
				$this->mSourceIds[] = $field['id'];
			}
		}
	}
Exemplo n.º 8
0
 public function __construct($options = array())
 {
     $this->mWatch = !empty($options['watch']);
     $this->mForReUpload = !empty($options['forreupload']);
     $this->mSessionKey = isset($options['sessionkey']) ? $options['sessionkey'] : '';
     $this->mHideIgnoreWarning = !empty($options['hideignorewarning']);
     $this->mDestFile = isset($options['destfile']) ? $options['destfile'] : '';
     $this->mTextTop = isset($options['texttop']) ? $options['texttop'] : '';
     $this->mTextAfterSummary = isset($options['textaftersummary']) ? $options['textaftersummary'] : '';
     $sourceDescriptor = $this->getSourceSection();
     $descriptor = $sourceDescriptor + $this->getDescriptionSection() + $this->getOptionsSection();
     Hooks::run('UploadFormInitDescriptor', array($descriptor));
     parent::__construct($descriptor, 'upload');
     # Set some form properties
     $this->setSubmitText(wfMessage('uploadbtn')->text());
     $this->setSubmitName('wpUpload');
     $this->setSubmitTooltip('upload');
     $this->setId('mw-upload-form');
     # Build a list of IDs for javascript insertion
     $this->mSourceIds = array();
     foreach ($sourceDescriptor as $key => $field) {
         if (!empty($field['id'])) {
             $this->mSourceIds[] = $field['id'];
         }
     }
     // added for Semantic Forms
     $this->addHiddenField('sfInputID', $options['sfInputID']);
     $this->addHiddenField('sfDelimiter', $options['sfDelimiter']);
 }
Exemplo n.º 9
0
 public function __construct($options = array(), $context = null, $messagePrefix = 'multiupload')
 {
     // basically we want to map filenames to session keys here somehow
     $this->mDestFiles = array();
     for ($i = 0; $i < MultipleUpload::getMaxUploadFiles(); $i++) {
         $this->mDestFiles[$i] = $options['destfile' . $i];
     }
     $this->mSessionKeys = array();
     foreach ($options as $k => $v) {
         if (preg_match('@^sessionkey@', $k)) {
             $this->mSessionKeys[$k] = $v;
         }
     }
     // In an ideal world, this would work:
     #parent::__construct( $options, $context, $messagePrefix );
     // But MediaWiki is MediaWiki, so of course you can't pass the third
     // parameter to UploadForm::__construct(), but instead it hardcodes it
     // to 'upload'...great. So, we have to duplicate that function here. :(
     $this->mWatch = !empty($options['watch']);
     $this->mForReUpload = !empty($options['forreupload']);
     $this->mSessionKey = isset($options['sessionkey']) ? $options['sessionkey'] : '';
     $this->mHideIgnoreWarning = !empty($options['hideignorewarning']);
     $this->mDestWarningAck = !empty($options['destwarningack']);
     $this->mDestFile = isset($options['destfile']) ? $options['destfile'] : '';
     $this->mComment = isset($options['description']) ? $options['description'] : '';
     $this->mTextTop = isset($options['texttop']) ? $options['texttop'] : '';
     $this->mTextAfterSummary = isset($options['textaftersummary']) ? $options['textaftersummary'] : '';
     $sourceDescriptor = $this->getSourceSection();
     $descriptor = $sourceDescriptor + $this->getDescriptionSection() + $this->getOptionsSection();
     wfRunHooks('UploadFormInitDescriptor', array(&$descriptor));
     $this->setMessagePrefix('multiupload');
     HTMLForm::__construct($descriptor, $context, 'multiupload');
     // here's the change
     # Set some form properties
     $this->setSubmitText(wfMsg('uploadbtn'));
     $this->setSubmitName('wpUpload');
     # Used message keys: 'accesskey-upload', 'tooltip-upload'
     $this->setSubmitTooltip('upload');
     $this->setId('mw-upload-form');
     # Build a list of IDs for javascript insertion
     $this->mSourceIds = array();
     foreach ($sourceDescriptor as $field) {
         if (!empty($field['id'])) {
             $this->mSourceIds[] = $field['id'];
         }
     }
 }
	/**
	 * @param $wm Wikimania
	 * @param $context ContextSource
	 */
	public function  __construct( Wikimania $wm, $context = null ) {
		parent::__construct( $this->getFields( $wm, $context->getUser() ), $context, 'wikimania' );
	}
Exemplo n.º 11
0
 public function __construct($title)
 {
     $this->title = $title;
     $descriptors = $this->getDescriptors();
     parent::__construct($descriptors, 'addresource');
 }