Location: PHPKode > projects > Community Learning Network > cln/lib/CLN/interfaces/User/myShortcuts.html
<?php
/*
 * My Shortcuts Interface
 *
 * 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: myShortcuts.html,v 1.27 2005/01/25 17:47:44 darcy Exp $
 *
 */
 
 
// set title
// should support multiple languages
$GLOBALS['CLN_PAGE_TITLE'] = "My Shortcuts";


require_once "HTML/Form.php";
$form = new HTML_Form('');

?>
<p>Use the menu below to select which shortcuts you would like to see.</p>
<form id="selectMyShortcutList" name="selectMyShortcutList" action="<?php echo appendToURL(cleanURL($GLOBALS['path']), 'userProcess=myShortcuts'); ?>" method="post">

<div>
	<label class="clnFormLabel">Show me</label>

<?php

$shortcutTypes = array(
	'everything' => 'everything',
	'room' => 'rooms',
	'page' => 'pages',
	'block' => 'blocks'
);
$form->displaySelect("shortcutType", $shortcutTypes, $_REQUEST['shortcutType'], '1', '', FALSE, ''); // no one likes onchange // onChange=\'this.form.submit()\'

?>
	
	<label class="clnFormLabel">which I</label>
	
<?php

$roles = array(
	'creator' => 'created',
	'owner' => 'own',
	'publisher' => 'can publish',
	'collaborator' => 'can collaborate on',
	'viewer' => 'can view'
);
$form->displaySelect("roleSelector", $roles, $_REQUEST['roleSelector'], '1', '', FALSE, ''); // no one likes onchange // onChange=\'this.form.submit()\'

?>

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

</form>
<!-- end interface -->

<?php

$currentColumn = $this->sortColumn;
$currentDirection = $this->sortDirection;
$opposite['ASC'] = 'DESC';
$opposite['DESC'] = 'ASC';

$dir = $currentColumn == 'ko.title' ? $opposite[$currentDirection] : 'ASC';
$href['title'] = appendToURL(cleanURL($GLOBALS['path']), $this->getParams() . '&amp;orderColumn=ko.title&amp;direction=' . $dir);

$dir = $currentColumn == 'ko.modId' ? $opposite[$currentDirection] : 'ASC';
$href['type'] = appendToURL(cleanURL($GLOBALS['path']), $this->getParams() . '&amp;orderColumn=ko.modId&amp;direction=' . $dir);

$dir = $currentColumn == 'ko.created' ? $opposite[$currentDirection] : 'ASC';
$href['created'] = appendToURL(cleanURL($GLOBALS['path']), $this->getParams() . '&amp;orderColumn=ko.created&amp;direction=' . $dir);

$dir = $currentColumn == 'ko.modified' ? $opposite[$currentDirection] : 'ASC';
$href['modified'] = appendToURL(cleanURL($GLOBALS['path']), $this->getParams() . '&amp;orderColumn=ko.modified&amp;direction=' . $dir);


echo $this->getSearchResults();

echo $this->getPagingNavigation(); 

?>
<table border="0" cellpadding="2">
	<tr>
		<td><p><b>&nbsp;</b></p></td>
		<td style="width: 200px"><p><b><a href="<?php echo $href['title']; ?>">Title</a></b></p></td>
		<td><p><b><a href="<?php echo $href['type']; ?>">Type</a></b></p></td>
		<td><p><b><a href="<?php echo $href['created']; ?>">Created</a></b></p></td>
		<td><p><b><a href="<?php echo $href['created']; ?>">Created By</a></b></p></td>
		<td><p><b><a href="<?php echo $href['modified']; ?>">Modified</a></b></p></td>
		<td><p><b><a href="<?php echo $href['modified']; ?>">Modified By</a></b></p></td>
		<td><p><b><a href="<?php echo $href['modified']; ?>">Language</a></b></p></td>
	</tr>

<?php
		
while ($result = $this->getNextResult()) {
	// icons for rooms, pages and blocks
	if($result->modId == 1) {
		$objectIconImage = "<img src=\"".CLN_CLEAN_URL_BASE."images/roomIcon.gif\" alt=\"room icon\" border=\"0\" />";
	}
	else if($result->modId == 2) {
		$objectIconImage = "<img src=\"".CLN_CLEAN_URL_BASE."images/pageIcon.gif\" alt=\"page icon\" border=\"0\" />";
	} else {
		$objectIconImage = "<img src=\"".CLN_CLEAN_URL_BASE."images/blockIcon.gif\" alt=\"block icon\" border=\"0\" />";
	}

	$url = appendToURL(cleanURL($GLOBALS['path']), "editKoId=".$result->koId);
	
	?>
	<tr>
		<td class="myShortcutCell"><a href="<?php echo $url; ?>"><?php echo $objectIconImage; ?></a></td>
		<td><p><?php echo $result->title; ?></p></td>
		<td><p><?php echo $_SESSION['Module_Loader']->getModuleName($result->modId); ?></p></td>
		<td><p><?php echo date("m/d/y", $result->created); ?></p></td>
		<td><p><?php echo $_SESSION['User']->getUserName($result->createdBy); ?></p></td>
		<td><p><?php echo date("m/d/y", $result->modified); ?></p></td>
		<td><p><?php echo $_SESSION['User']->getUserName($result->modifiedBy); ?></p></td>
		<td><p><?php echo $result->lang; ?></p></td>
	</tr>
	<?php
}
?>

</table>
<?php

echo $this->getPagingNavigation();

?>
Return current item: Community Learning Network