%%image-crop-editor-html%%
progmin : / (context #155)
2002-06-05 15:49:31

%%preprocess%%
$this->beryliumToForm(); 
$this->timeFormat('D, M j, Y, \a\t H:i:s');

$tags= "";
$postvars= $GLOBALS['HTTP_POST_VARS'];

if ($postvars['cropwidth']=="") $this->cropwidth= $this->width;
else $this->cropwidth= $postvars['cropwidth'];
if ($postvars['cropheight']=="") $this->cropheight= $this->height;
else $this->cropheight= $postvars['cropheight'];
if ($postvars['cropstartx']=="") $this->cropstartx= 0;
else $this->cropstartx= $postvars['cropstartx'];
if ($postvars['cropstarty']=="") $this->cropstarty= 0;
else $this->cropstarty= $postvars['cropstarty'];
$tags.= "&cropwidth=$this->cropwidth&cropheight=$this->cropheight&cropstartx=$this->cropstartx&cropstarty=$this->cropstarty";




if ($postvars['submit']=="crop") {
	$this->generating= "<p align=center class=notice>Generating preview now</p>";
	$this->previewTag= "<img src=\"$this->uri?method=mogrify$tags\" alt='cropped preview' title='cropped preview' onLoad=\"window.location='#preview';\">";
	}
else $this->previewTag= "Please fill in values above and click <tt>crop</tt>.";

if ($this->id!="") {
	$this->hiddenvars= "<input type='hidden' name='id' value=\"$this->id\">";
	}

// proper icon
if (!$this->public) $this->iconpvt= "-pvt";

// get this->filesize
if (file_exists($this->path)) {
	$size= filesize($this->path);
	if ($size<1024) {
		$this->filesize= "$size Bytes";
		}
	elseif ($size < 1048576) {
		$size= $size/1024;
		$size= round($size,2);
		$this->filesize= "$size KB";
		}
	else	{
		$size= $size/1048576;
		$size= round($size,2);
		$this->filesize= "$size MB";
		}
	}
else {
	$this->filesize= "file not found!";
	}
	
// setup for thumbnail
$this->proportion(150,100);
	


%%header%%




%%css%%
.notice	{color: #ff0000; }
.editorinfo {font-size: 12px; color: #999999; }
.editorinfo b {font-size: 12px; color: #aa9999; font-weight: bold; }

.imagetable TD {padding: 0px; margin: 0px; }
.imageflavor {font-size: 12px; }
.imagetitle {font-size: 18px; font-weight: bold; color: #006699; }
.imagebyline {font-size: 12px; line-height: 18px; }
.imagedescription {font-size: 12px; line-height: 18px; }



%%template%%
$this->generating
<table border=0 class=imagetable>
	<tr>
		<td width='20'><img src='/bicons/spacer.png' border=0 alt=image width=20 height=1></td>
		<td><span class='imageflavor'>$this->flavor:</span></td>
		<td width='150' rowspan='3' align=center valign=middle><img src='$this->uri' width='$this->width' height='$this->height' alt='original image, scaled to thumbnail' title='original image, scaled to thumbnail'></td>
	</tr>
	<tr>
		<td colspan=2>
			<span class='imagetitle'>
			<img src='/bicons/image$this->iconpvt.png' border=0 alt='image:$this->id' title='image:$this->id' align=absmiddle>
			$this->title</span>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><span class='imagebyline'>By $this->author on $this->created.</span>
			<span class='editorinfo'><br>Filesize: $this->filesize | Image size: $this->origWidth x $this->origHeight pixels</span> 
		</td>
	</tr>
</table>
<form method='post' action='$this->baseURL?method=crop$session->cgi' class='.form'>
$this->hiddenvars
<table border='0'>
<tr>
	<td colspan=2><b>Cropping Options</b></td>
</tr>
<tr>
	<td align='right' valign='top'>start cropping at:</td>
	<td valign='top'><input type='text' name='cropstartx' size='4' maxlength='255' value="$this->cropstartx"> x
		<input type='text' name='cropstarty' size='4' maxlength='255' value="$this->cropstarty"><br>
		&nbsp;0x0 is upper left, $this->origWidth<!-- -->x$this->origHeight is lower right</td>
</tr>
<tr>
	<td align='right' valign='top'>width after cropping:</td>
	<td valign='top'><input type='text' name='cropwidth' size='4' maxlength='255' value="$this->cropwidth"> pixels</td>
</tr>
<tr>
	<td align='right' valign='top'>height after cropping:</td>
	<td valign='top'><input type='text' name='cropheight' size='4' maxlength='255' value="$this->cropheight"> pixels</td>
</tr>
<tr> 
	<td width=10%>&nbsp;</td>
	<td width=90%><input type='submit' name='submit' value='crop' class='buttonstyle'></td>
</tr>
</table>
</form>
<table border=0 class=imagetable>
	<tr>
		<td width='1%'><img src='/bicons/spacer.png' border=0 alt=image width=20 height=1></td>
		<td width='99%'>
			<p class='imageflavor'><span class='imagetitle'>Preview: </span><a name='preview'> </a><br>
			A preview will be generated using the settings above every time you click <tt>resize</tt>. To permanently resize the image, click <tt>commit</tt> below.<br>
			<b>Please be patient</b>, it may take up to a minute for berylium to generate the new image...</p></td>
	</tr>
	<tr>
		<td colspan=2>&nbsp;</td>
	</tr>
	<tr>
		<td colspan=2 align=center>
			$this->previewTag
		</td>
	</tr>
	<tr>
		<td colspan=2>&nbsp;</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><form method='post' action='$this->uri?method=mogrify$session->cgi' class='.form'>
				$this->hiddenvars
				<input type=hidden name=cropwidth value='$this->cropwidth'>
				<input type=hidden name=cropheight value='$this->cropheight'>
				<input type=hidden name=cropstartx value='$this->cropstartx'>
				<input type=hidden name=cropstarty value='$this->cropstarty'>
				When this image is cropped correctly, click: <input type='submit' name='submit' value='commit' class='buttonstyle'> (will resize the image permanently).
			</form>
		</td>
	</tr>
</table>


%%listrow%%
 



%%nullobject%%
<img src='/bicons/warning.png' alt='Warning' align=absmiddle> Sorry, that image is not available for editing. 



%%footer%%




%%postprocess%%




%%end of context%%
