Location: PHPKode > projects > Community Learning Network > cln/lib/CLN/BORT/bort.php
<?php

$publishedStatusClass = '';

if ($this->isEditable()) {
	$status = $this->getStatus();
	if ($status == 0) {
		if ($this->isEditable(1)) {
			$url = appendToURL(cleanURL($GLOBALS['path']),"editKoId=".$this->koId."&amp;editProcess=Publish&amp;exitPanel=TRUE");
			$publishedStatus[] = ' <span class="noLive"><b>Never published</b></span> -> <b><a href="'.$url.'">Publish now</a></b>';
		}
		else {
			$publishedStatus[] = ' <span class="noLive"><b>Never published</b></span>';
		}
		$publishedStatusClass = 'unpublishedKO';
	}
	else if ($status == 1) {
		if ($this->isEditable(1)) {
			$url = appendToURL(cleanURL($GLOBALS['path']),"editKoId=".$this->koId."&amp;editProcess=Publish&amp;exitPanel=TRUE");
			$publishedStatus[] =  ' <span class="outOfDate"><b>Out of date</b></span> -> <b><a href="'.$url.'">Publish now</a></b>';
		}
		else {
			$publishedStatus[] =  ' <span class="outOfDate"><b>Out of date</b></span>';
		}
		$publishedStatusClass = 'outOfDateKO';
	}
	else if ($status == 2) {
		$publishedStatus[] = '<span class="published"><b>Yes</b></span>';
		$publishedStatusClass = 'publishedKO';
	}
	
	$publishedString = implode(', ', $publishedStatus);
}

// Room
if($this->modId == 1) {
	$className = "roomBort ".$publishedStatusClass;
}
// Page
else if($this->modId == 2) {
	$className = "pageBort ".$publishedStatusClass;
}
// Content
else {
	$className = "blockBort";
}

$cln_clean_url_base = CLN_CLEAN_URL_BASE;

$bort= <<<EOF
<!-- BEGIN {$this->modName} BORT OPENING -->
<div id="koEditId{$this->koId}" class="bort {$className}"><a href="javascript:showHide('expand{$this->koId}','{$cln_clean_url_base}')"><img id="OpenButtonexpand{$this->koId}" class="openCloseButton" 
src="{$cln_clean_url_base}images/open.gif" border="0" width="41" height="15" /></a><span class="icon">{$this->modName} : <em>{$this->currentPart['title']}</em></span>
EOF;

// $bort .= "\n  <em>{$this->modName}: </em><b> {$this->currentPart['title']}</b>";


if ($this->isEditable()) {
	if(!isset($_REQUEST['editKoId'])) {
		$url = appendToURL(cleanURL($GLOBALS['path']),"editKoId=$this->koId&amp;editProcess=Panel");
		$bort .= ' <i>Published:</i> '.$publishedString.' | <b><a href="'.$url.'">Edit</a></b>'."\n";
	} 
	/*else if(isset($_GET['subprocess'])) {
		$url = appendToURL(cleanURL($GLOBALS['path']),'editProcess=Panel');
		$bort .= ' <i>Published:</i> '.$publishedString.' | <b><a href="'.$url.'">Return to Panel</a></b>'."\n";
	}*/
	else {
		$url = cleanURL($GLOBALS['path']);
		$bort .= ' <i>Published:</i> '.$publishedString.' | <b><a href="'.$url.'">Exit Panel</a></b>'."\n";
	}
}

// setup roles
$theseRoles = array();
if(in_array(CLN_SUPERUSER_GROUPID,$_SESSION['User']->groupList)) $theseRoles[] = " SuperUser ";
if($this->isManageable()) $theseRoles[] = " Owner ";
if($this->isEditable(1)) $theseRoles[] = " Publisher ";
if($this->isEditable()) $theseRoles[] = " Collaborator ";
if($this->isViewable()) $theseRoles[] = " Viewer ";
$theseRolesText = join(",",$theseRoles);

//setup info
$created = formatDate(convertCreated($this->currentPart['created']));
$creator = $_SESSION['User']->getUserName($this->creator);
$lastModified = formatDate(convertModified($this->currentPart['modified']));
$lastModifiedBy = $_SESSION['User']->getUserName($this->currentPart['modifiedBy']);
foreach ($this->existingLanguages as $lang => $true) {
	$languages[] = $GLOBALS['languages'][$lang];
}
$availableLanguages = join(",",$languages);
if((defined('CLN_DEBUG_SHOW_KOID') && CLN_DEBUG_SHOW_KOID == 1) || in_array(CLN_SUPERUSER_GROUPID,$_SESSION['User']->groupList)) {
	$koIdObjectId = "<br/><span>koId: <b><a href=\"".appendToURL(cleanURL($GLOBALS['path']),"koId=".$this->koId)."\">".$this->koId."</a></b>"
					."&nbsp; objectId: <b>".$this->currentPart['objectId']."</b></span>";
} else {
	$koIdObjectId = "";
}

$bort .= <<<EOF
<div id="expand{$this->koId}" class="bortExpandContent" style="display:none;">
	<div class="drawerTop">
	<span class="drawerRole">Your Role: </span> {$theseRolesText} <br/>
	<span class="drawerInformation">Created by: </span>{$creator} on: {$created}. <br/>
	<span class="drawerInformation">Last modified by: </span>{$lastModifiedBy} on: {$lastModified}. <br/>
	<span class="drawerLanguages">Current languages for this block are: </span>{$availableLanguages}.
			{$koIdObjectId}
  	</div>
</div>
EOF;

$bort .= "</div>\n";

?>
Return current item: Community Learning Network