Location: PHPKode > projects > Community Learning Network > cln/modules/Bookmark/LinksEditForm.html
<?php
/*
 * Bookmark Links 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: LinksEditForm.html,v 1.4 2004/11/26 19:40:30 derekbrooks Exp $
 *
 */

// Set title
$GLOBALS['CLN_PAGE_TITLE'] = 'Edit Bookmark Links';

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

<p>Edit the links below. To add a new link, click the "Add A New Link" button. When you are done, click "Submit" to save the information. To delete a link, just remove the information.</p>

<form name="bookmarkLinks" action="<?php echo $fullURL; ?>" method="post">

<?php
foreach ($this->links as $linkNumber => $linkInfo) {
	?>
	<p><b>Link #<?php echo $linkNumber + 1; ?></b></p>
	<div class="clnFormLine">
		<span class="clnFormLabel"><?php
			if (isset($linkInfo['invalidUri'])) {
				echo '<span style="color:red;"><b>Link Address:</b></span>';
				unset($this->links[$linkNumber]['invalidUri']);
			}
			else {
				echo 'Link Address:';
			}
			?></span>
		<span class="clnFormElement"><input type="text" name="linkUri[<?php echo $linkNumber; ?>]" value="<?php echo $linkInfo['uri']; ?>" size="30" maxlength="255" />
		</span>
	</div>

	<div class="clnFormLine">
		<span class="clnFormLabel"><?php
			if (isset($linkInfo['invalidTitle'])) {
				echo '<span style="color:red;"><b>Link Title:</b></span>';
				unset($this->links[$linkNumber]['invalidTitle']);
			}
			else {
				echo 'Link Title:';
			}
			?></span>
		<span class="clnFormElement"><input type="text" name="linkTitle[<?php echo $linkNumber; ?>]" value="<?php echo $linkInfo['title']; ?>" size="30" maxlength="255" />
		</span>
	</div>

	<div class="clnFormLine">
		<span class="clnFormLabel">Description: (optional)</span>
		<span class="clnFormElement"><textarea name="linkDescription[<?php echo $linkNumber; ?>]" rows="2" cols="30"><?php echo $linkInfo['description']; ?></textarea>
		</span>
	</div>


	<div class="clnFormLine">
		<span class="clnFormLabel" for="linkWindow[<?php echo $linkNumber; ?>]">Link opens in:</span>
		<span class="clnFormElement">
			<input type="radio" name="linkTarget[<?php echo $linkNumber; ?>]" value="_blank"
			<?php
				if ($linkInfo['target']!='_self') {
					echo ' checked="checked"';
					}
			?> /> a new browser window  
			<input type="radio" name="linkTarget[<?php echo $linkNumber; ?>]" value="_self"
			<?php
				if ($linkInfo['target']=='_self') {
					echo ' checked="checked"';
					}
			?> /> this browser window
		</span>
	</div>
	<br/>

	<?php
}
?>

<div class="clnFormLine">
	<span class="clnFormLabel">&nbsp;</span>
	<span class="clnFormElement">
		<input class="clnFormInput" id="submitBookmarkLinks" type="submit" name="submitBookmarkLinks" value="<?php echo ADMIN_BTN_SUBMIT_CHANGES; ?>" />
		<input class="clnFormInput" id="addBookmarkLink" type="submit" name="addBookmarkLink" value="Add a New Link" />
	</span>
</div>

</form>
Return current item: Community Learning Network