function getFilterOptionsPanel( $fromTransactionId, $transactionCount, $userName, $showRollBackOptions ) {
	$countOptions = array();
	
	for ( $i = 1; $i <= 20; $i++ )
		$countOptions[$i] = $i;
	
	return getOptionPanel(
		array(
			wfMsg( 'ow_transaction_from_transaction' ) =>
				getSuggest(
					'from-transaction',
					'transaction',
					array(),
					$fromTransactionId,
					getTransactionLabel( $fromTransactionId ),
					array( 0, 2, 3 )
				),
			wfMsg( 'ow_transaction_count' ) =>
				getSelect( 'transaction-count',
					$countOptions,
					$transactionCount
				),
			wfMsg( 'ow_transaction_user' ) => getTextBox( 'user-name', $userName ),
			wfMsg( 'ow_transaction_show_rollback' ) => getCheckBox( 'show-roll-back-options', $showRollBackOptions )
		)
	);
}
示例#2
0
	public function history() {
		global
			$wgOut, $wgTitle, $wgRequest;
			
		$wgOut->enableClientCache( false );

		$title = $wgTitle->getPrefixedText();

		if ( !$this->showClassicPageTitles )
			$title = $this->getTitle();

		$wgOut->setPageTitle( wfMsgSc( "history", $title ) );

		# Plain filter for the lifespan info about each record
		if ( isset( $_GET['show'] ) ) {
			$this->showRecordLifeSpan = isset( $_GET["show-record-life-span"] );
			$this->transaction = (int) $_GET["transaction"];
		}
		else {
			$this->showRecordLifeSpan = true;
			$this->transaction = 0;
		}
		
		# Up to which transaction to view the data
		if ( $this->transaction == 0 )
			$this->queryTransactionInformation = new QueryHistoryTransactionInformation();
		else
			$this->queryTransactionInformation = new QueryAtTransactionInformation( $this->transaction, $this->showRecordLifeSpan );
			
		$transactionId = $wgRequest->getInt( 'transaction' );

		$wgOut->addHTML( getOptionPanel(
			array(
				wfMsg( 'ow_history_transaction' ) => getSuggest( 'transaction', 'transaction', array(), $transactionId, getTransactionLabel( $transactionId ), array( 0, 2, 3 ) ),
				wfMsg( 'ow_history_show_life_span' ) => getCheckBox( 'show-record-life-span', $this->showRecordLifeSpan )
			),
			'history'
		) );

		$viewInformation = new ViewInformation();
		$viewInformation->filterLanguageId = $this->filterLanguageId;
		$viewInformation->showRecordLifeSpan = $this->showRecordLifeSpan;
		$viewInformation->queryTransactionInformation = $this->queryTransactionInformation;
		$viewInformation->setPropertyToColumnFilters( $this->propertyToColumnFilters );
		
		$this->viewInformation = $viewInformation;

		initializeOmegaWikiAttributes( $this->viewInformation );
		initializeObjectAttributeEditors( $viewInformation );
	}