Location: PHPKode > projects > Community Learning Network > cln/modules/ImageAV/ImageAVEditForm.html
<?php
/*
 * ImageAV Edit Form
 *
 * Copyright (c) 2003-4 St. Christopher House
 *
 * Developed by The Working Group Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  
 *
 * @version $Id: ImageAVEditForm.html,v 1.26 2005/01/20 19:36:07 cbooth7575 Exp $
 *
 */

// set title
// should support multiple languages
if ($this->type == 'image') {
	$GLOBALS['CLN_PAGE_TITLE'] = 'Edit Image';
}
else if ($this->type == 'flash') {
	$GLOBALS['CLN_PAGE_TITLE'] = 'Edit Flash';
}
else if ($this->type == 'document') {
	$GLOBALS['CLN_PAGE_TITLE'] = 'Edit Document';
}

$cleanURL = cleanURL($GLOBALS['path']);
$params = 'editKoId=' . $this->_super->koId . '&amp;editProcess=Content';
$fullURL = appendToURL($cleanURL, $params);

?>

<form enctype="multipart/form-data" name="blockEdit" action="<?php echo $fullURL; ?>" method="post">


<?php
// ***************************************************************
// For type = image
if ($this->type == 'image') {
	// Display the new image select, only for new images
	if ($this->imageId == "NEW" || empty($this->imageFilename)) {
	
	?>
	
	<p>Choose the image file from your local disk using the "Browse" button below. Your image will be uploaded to the site.</p>

	<div class="clnFormLine">
		<span class="clnFormLabel"><label class="clnFormLabel"><?php echo ADMIN_LABEL_IMAGE ?>:</label></span>
		<span class="clnFormElement"><input type="file" id="koImageFile" name="koImageFile" /></span>
	</div>
	
	<?php
	
	}
	
	// Else, display the image itself for existing images, it's not editable
	else {
		echo '<img style="border:1px solid #000000;padding:2px;margin:10px" src="'.$this->getThumbnailURL().'" alt="thumbnail"/>'."\n";
		echo '<p>If you want to replace the above image with a new one, fill in this field here. Otherwise, leave this field blank.</p>'."\n";
		echo '<div class="clnFormLine">'."\n";
		echo '  <span class="clnFormLabel"><label class="clnFormLabel">' . ADMIN_LABEL_IMAGE . ':</label></span>'."\n";
		echo '  <span class="clnFormElement"><input type="file" id="koNewImageFile" name="koNewImageFile" /></span>'."\n";
		echo '</div>'."\n";
	}
	?>
	
	<div class="clnFormLine">
		<span class="clnFormLabel"><label class="clnFormLabel">Alt-tag:</label></span>
		<span class="clnFormElement"><input type="text" id="koImageCaption" name="koImageCaption" value="<?php echo $this->caption; ?>" size="30" maxlength="100" /></span>
	</div>
	<p class="grFormContext">An alt-tag is the text description for people who cannot see the images. It is recommended that you fill this field out.</p>	
	<div class="clnFormLine">
		<span class="clnFormLabel"><label class="clnFormLabel">Image Link:</label></span>
		<span class="clnFormElement"><input type="text" id="koImageUrl" name="koImageUrl" value="<?php echo $this->url; ?>" size="30" maxlength="255" /></span>
	</div>

	<div class="clnFormLine">
		<span class="clnFormLabel"><label class="clnFormLabel">Open Link In:</label></span>
		<span class="clnFormElement"><input type="radio" id="koImageWindow" name="koImageWindow" value="_self" <?php if ($this->window == '_self') { echo ' checked="checked" '; } ?> /></span> same browser window 
		<span class="clnFormElement"><input type="radio" id="koImageWindow" name="koImageWindow" value="_blank" <?php if ($this->window == '_blank') { echo ' checked="checked" '; } ?> /></span> new browser window (use this if the link is not on the St. Chris CLN)
	</div>


<?php
}

// ***************************************************************
// For type = flash
else if ($this->type == 'flash') {
	// Display the new image select, only for new images
	if ($this->imageId == "NEW" || empty($this->imageFilename)) {
	
	?>
	
	<p>Choose the flash file from your local disk using the "Browse" button below. Your image will be uploaded to the site.</p>

	<div class="clnFormLine">
		<span class="clnFormLabel"><label class="clnFormLabel">Flash File:</label></span>
		<span class="clnFormElement"><input type="file" id="koImageFile" name="koImageFile" /></span>
	</div>
	
	<?php
	
	}
	
	// Else, display the image itself for existing images, it's not editable
	else {
		echo $this->getFormattedImage();
		echo '<p>If you want to replace the above flash movie with a new one, fill in this field here. Otherwise, leave this field blank.</p>';
		echo '<div class="clnFormLine">';
		echo '<span class="clnFormLabel"><label class="clnFormLabel">Flash File::</label></span>';
		echo '<span class="clnFormElement"><input type="file" id="koNewImageFile" name="koNewImageFile" /></span>';
		echo '</div>';
	}
}

// ***************************************************************
// For type = document
else  {
	// Display the new image select, only for new images
	if ($this->imageId == "NEW" || empty($this->imageFilename)) {
	
	?>
	
	<p>Choose the document file from your local disk using the "Browse" button below. Your image will be uploaded to the site.</p>

	<div class="clnFormLine">
		<span class="clnFormLabel"><label class="clnFormLabel">File:</label></span>
		<span class="clnFormElement"><input type="file" id="koImageFile" name="koImageFile" /></span>
	</div>
	
	<?php
	
	}
	
	// Else, display the image itself for existing images, it's not editable
	else {
		echo $this->getFormattedImage();
		echo '<p>If you want to replace the above document with a new one, fill in this field here. Otherwise, leave this field blank.</p>';
		echo '<div class="clnFormLine">';
		echo '<span class="clnFormLabel"><label class="clnFormLabel">File:</label></span>';
		echo '<span class="clnFormElement"><input type="file" id="koNewImageFile" name="koNewImageFile" /></span>';
		echo '</div>';
	}
	?>
	
	<div class="clnFormLine">
		<span class="clnFormLabel"><label class="clnFormLabel">Display Name:</label></span>
		<span class="clnFormElement"><input type="text" id="koImageCaption" name="koImageCaption" value="<?php echo $this->caption; ?>" size="30" maxlength="100" /></span>
	</div>

<?php
}




$sessionObject = 'KO';
include("interfaces/simpleMetadata.html");
?>

<div class="clnFormLine">
	<span class="clnFormLabel">&nbsp;</span>
	<span class="clnFormElement"><input class="clnFormInput" id="editImageAVModule" type="submit" name="editImageAVModule" value="<?php echo ADMIN_BTN_SUBMIT_CHANGES; ?>" />
</div>

</form>
Return current item: Community Learning Network