Location: PHPKode > projects > Community Learning Network > cln/lib/CLN/interfaces/panel.html
<?php
// set title
// should support multiple languages
$GLOBALS['CLN_PAGE_TITLE'] = 'Control Panel for '.$this->modName;


// Display the save message, if it exists
if (isset($saveMessage)) {
	echo '<div class="saveTask">';
	displayTask($saveMessage, $this);
	echo '</div>';
}

?>


<div style="display: block;clear:any;" class="controlPanel">
	
	<div class="controlPanel">
	  <h4> For the selected language</h4>

		<ul class="panelLangTab">
			<li class="panelLangTab context">Current language:</li>
		
			<?php
			
			// If this is a new object, a language isn't set yet
			if (!isset($this->existingLanguages)) {
				$this->existingLanguages['en'] = 0; // :HACK: This need to be thought about more
			}
			
			// Loop through the languages, displaying each of them, and setting the current one.
			foreach ($this->existingLanguages as $lang => $original) {
				if ($lang == $this->editLang) {
					$displayLang = $GLOBALS['languages'][$lang];
					echo '<li class="panelLangTab here"><b>' . $displayLang . '</b></li>';
				}
				else {
					$displayLang = $GLOBALS['languages'][$lang];
					$linkURL = appendToURL($_SERVER['REQUEST_URI'], 'editProcess=Panel&amp;editLang='.$lang);
					echo '<li class="panelLangTab link"><a href="' . $linkURL . '">' . $displayLang . '</a></li>';
				}
			}
			
			// add a translation button
			$params = 'editKoId=' . $this->koId . '&amp;editProcess=TranslateMe';
			$taskLink = appendToURL($_SERVER['REQUEST_URI'],$params);
			echo ' <span class="taskTitle">&lt;-- <a href="' . $taskLink . '">Add a Translation</a></span>';
			
		?>
		</ul>
		
		<div class="languageTasks">
		<?php
		
		// Display Module & Language specific tasks
		foreach ($moduleLanguageParts as $task) {
			$task['editProcess'] = 'Content';
			displayTask($task, $this);
		}
		
		
		// Display general Language specific tasks
		foreach ($koLanguageParts as $task) {
			displayTask($task, $this);
		}
		?>
		</div>
	
	</div>


	<h4>For all languages for this Block</h4>
	
	<div class="generalTasks">
	<?php
	
	// Display Module General Tasks
	foreach ($moduleGeneralParts as $task) {
		$task['editProcess'] = 'Content';
		displayTask($task, $this);
	}
	
	// Display KO General Tasks
	foreach ($koGeneralParts as $task) {
		displayTask($task, $this);
	}
	
	?>
	</div>
	
</div>

<?php
/**************************************************************************/
/******** Functions Used on this page *************************************/
/**************************************************************************/

/*
 *
 * Function:  displayTask()
 *
 * 		Displays a task DIV
 *
 * @access public
 * @return String 		$message
 *                
 */	
function displayTask($task, &$currentObject) {
	if ($currentObject->koId != 'NEW' ||
	    $currentObject->koId == 'NEW' && (!isset($task['requiresSaving']) || !$task['requiresSaving'])) {

		if(!isset($task['link'])) {
			$params = 'editKoId=' . $currentObject->koId . '&amp;editProcess=' . $task['editProcess'];
			if (isset($task['subprocess'])) {
				$params .= '&amp;subprocess=' . $task['subprocess'];
			}
			$taskLink = '<a href="' . appendToURL($_SERVER['REQUEST_URI'],$params) . '">';
		} else {
			// :QUESTION: target does not seem to work in firefox - any idea what this should be - dwc
			$taskLink = '<a href="' . $task['link'] . '" target="_blank">';
		}
		
		echo '<div class="task" id="task' . $task['editProcess'] .'" >';
		echo '<p class="taskTitle">' . $taskLink . $task['title'] . '</a>'
			// this link needs to show the help in view mode - we need to restructure our code so that it's easy to get 
			// to a page in view mode, without changing the mode you are in - dwc
			.'<span class="helpLink"><a href="javascript:void(0);" onClick="showHelp(\'' . cleanURL(CLN_HELP_PAGE) . '\');">?</a></span></p>';
		echo '<p class="taskDescription">' . $task['description'] . '</p>';
		echo '</div>';
	}
}

?>
Return current item: Community Learning Network