Example #1
0
	function view() {
		global
			$wgOut, $wgTitle;
		
		parent::view();

		$spelling = $wgTitle->getText();
		$wgOut->addHTML( '<h1>Words matching <i>' . $spelling . '</i> and associated meanings</h1>' );
		$wgOut->addHTML( '<p>Showing only a maximum of 100 matches.</p>' );
		$wgOut->addHTML( $this->searchText( $spelling ) );
	}
	public function edit() {
		global $wgOut, $wgTitle, $wgUser;

		if ( !parent::edit() ) {
			return false;
		}
		$this->outputEditHeader();

		$spelling = $wgTitle->getText();

		$wgOut->addHTML(
			getExpressionsEditor( $spelling, $this->viewInformation )->edit(
				$this->getIdStack(),
				getExpressionsRecordSet( $spelling, $this->viewInformation )
			)
		);

		$this->outputEditFooter();
	}
	protected function save( $referenceQueryTransactionInformation ) {
		global
			$wgTitle;

		parent::save( $referenceQueryTransactionInformation );
		$definedMeaningId = $this->getDefinedMeaningIdFromTitle( $wgTitle->getText() );
		
		$dmModel = new DefinedMeaningModel( $definedMeaningId, $this->viewInformation );
		$definedMeaningId = $this->getDefinedMeaningIdFromTitle( $wgTitle->getText() );

		getDefinedMeaningEditor( $this->viewInformation )->save(
			$this->getIdStack( $definedMeaningId ),
			$dmModel->getRecord()
		);
	
	}