Location: PHPKode > projects > Community Learning Network > cln/lib/CLN/interfaces/Room/EditNavigation.html
<?php

// set title
// should support multiple languages
$GLOBALS['CLN_PAGE_TITLE'] = 'Edit Room Navigation';

$imagesDir = CLN_CLEAN_URL_BASE . 'lib/CLN/interfaces/Room/images';

?>
<form name="roomEdit" action="<?php echo appendToURL(cleanURL($GLOBALS['path']), 'editKoId=' . $this->_super->koId . '&amp;editProcess=Content&amp;subprocess=EditNavigation'); ?>" method="post">

<p>Edit the navigation here. You can change the order of pages and rooms in the navigation by clicking the Up and Down arrows. Make a room/page not appear on the navigation by unchecking the checkbox under the Visibility column.</p>

<p>If you want to change the file (page) or folder (room) name that shows in the URL, type your new file/folder name in the space provided.</p>

<table class="editNavigation">
<tr>
	<th colspan="3">Order</th><th>Room or Page Title</th>
	<th>File or Folder Name</th><th>Visibility</th>
	<th colspan="2"></th>
</tr>

<?php

$childrenNodes = $this->getNodes(NULL, NULL, TRUE);

$numNodes = count($childrenNodes);

foreach ($childrenNodes as $nodeOrder => $node) {

	echo '<tr style="color: red">' . "\n" . '  <td>';
	
	// The down arrow
	if($nodeOrder < $numNodes) {
		echo '<input class="clnFormInput" type="image" src="' . $imagesDir . '/down.gif" name="down[' . $nodeOrder . ']" />';
	}
	else {
		echo "&nbsp;";
	}
	echo "</td>\n  <td>";
	
	// The up arrows
	if($nodeOrder > 1) {
		echo '<input class="clnFormInput" type="image" src="' . $imagesDir . '/up.gif" name="up[' . $nodeOrder . ']" />';
	}
	else {
		echo "&nbsp;";
	}
	echo '</td>'."\n";
	
	// The order #
	echo '  <td>' . $nodeOrder . '</td>' . "\n";
	
	// The title
	echo '  <td><label>' . $node['title'][0] . '</label></td>'."\n";
	
	// The field name, visibility and icon
	$nodeLink = cleanURL(getNodePath($this->_super->koId, TRUE) . '/' . $node['nodeName']);

	if(substr($nodeLink,-4) != ".php" && substr($nodeLink,-1) != "/") {
		$nodeLink .= "/";
	}
	
	// If it's a room
	if($node['modId'] == 1) {
		echo '  <td>';
		echo '<input class="clnFormInput" type="text" name="roomNodeName[' . $nodeOrder . ']" value="' . $node['nodeName'] . '" /></td>'."\n";
		if($node['visible']) { 
			$CHECKED = " checked=\"checked\"";
		} 
		else { 
			$CHECKED = "";
		}
		echo '  <td><input class="clnFormInput" type="checkbox" name="nodeVisibility[' . $nodeOrder . ']" ' . $CHECKED . ' /></td>'."\n";
		echo "  <td><a href=\"" . $nodeLink . "\"><img src=\"".CLN_CLEAN_URL_BASE."images/roomIcon.gif\" alt=\"room icon\" border=\"0\" /></a></td>\n";
	} 
	
	// Else it's a page
	else {
		echo '  <td style="text-align:right">';
		if($node['nodeName'] != "index.php") {
			echo '<input class="clnFormInput" type="text" name="pageNodeName[' . $nodeOrder . ']" value="' . substr($node['nodeName'], 0, -4) . '" />.php</td>'."\n";
		} 
		else {
			echo '<input type="hidden" name="pageNodeName[' . $nodeOrder .']" value="index" /><span>' . $node['nodeName'] . '</span></td>'."\n";
		}
		if($node['visible']) { 
			$CHECKED = " checked=\"checked\""; 
		}
		else { 
			$CHECKED = ""; 
		}
		echo '  <td><input class="clnFormInput" type="checkbox" name="nodeVisibility[' . $nodeOrder . ']" '.$CHECKED.' /></td>';
		echo "  <td><a href=\"" . $nodeLink . "\"><img src=\"".CLN_CLEAN_URL_BASE."images/pageIcon.gif\" alt=\"page icon\" border=\"0\" /></a></td>\n";
	}

	
	echo '</tr>' . "\n\n";
}
?>

</table>

<div class="clnFormLine">
	<label class="clnFormLabel" for="submitChanges"></label>
	<input class="clnFormInput" type="submit" id="submitChanges" name="submitChanges" value="<?php echo ADMIN_BTN_CONTINUE; ?>" />	
	<input class="clnFormInput" type="submit" name="cancelChanges" value="<?php echo ADMIN_BTN_CANCEL_RETURN; ?>" />
</div>

</form>
Return current item: Community Learning Network