addScript( "\n"); $wgOut->addScript( "\n"); $wgOut->addScript( "\n"); $wgOut->addScript( "\n"); # try to find the image that the user entered $image = $wgRequest->getText('image'); $title = Title::newFromText( $image, NS_IMAGE ); if ( ! $title instanceof Title || $title->getNamespace() != NS_IMAGE ) { $wgOut->addWikiText("Sorry, can't find that image!"); } else { # see if we're passed editing information if ($wgRequest->wasPosted()) { $x1 = $wgRequest->getInt(x1); $x2 = $wgRequest->getInt(x2); $y1 = $wgRequest->getInt(x1); $y2 = $wgRequest->getInt(y2); resizeImage($x1, $y1, $x2, $y2); $wgOut->addHTML("x1: $x1
x2: $x2
"); } else { $file = wfFindFile( $title ); if ( $file && $file->exists() ) { $wgOut->addHTML("

Use your mouse to select the new area on the image below. When you are done, press crop.

\n"); # add image $wgOut->addHTML("
getUrl()}\" alt=\"source image\" id=\"sourceImage\" width=\"500\" height=\"333\" />
\n"); # add bottom of the template $wgOut->addHTML("

"); } else { $wgOut->setStatusCode( 404 ); } } } } } ?>