Location: PHPKode > projects > Ptk-forensics > ptk/lib/modal_bookmark.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("check_session_image.php");
include("lib_std.php");
include("sanitize.php");
$type = sanitize($_GET['arg1'],INT);
$reference = preg_replace("/[^a-zA-Z0-9\-]/", "", $_GET['arg2']);
$partition_id = sanitize($_GET['arg3'],INT);
if (user_can_load_this_partition($partition_id)){
$analysis = get_bookmark_type($type);
if($reference=='null'){
	$arr = array();
	$arr = $_GET['arg4'];
	?>
	<b style="float:left">Bookmark</b><img id="close_box" style="float:right; cursor: pointer" src="../img/cancel.png" onclick="closeMessage();">
	<br><hr>
	<form method="post" name="bookmarkForm" onsubmit="new_multiple_bookmark('<?=$arr?>','<?=$type?>', '<?=$partition_id?>', '<?=$analysis?>'); return false;">
		<table class="form">
			<tr><td><b>Categories: </b></td><td><input type="text" name="tags" id="tags" style="width:250px"><div id="tag_list" class="autocomplete"></div></td></tr>
			<tr><td style="vertical-align:top">Description: </td><td><textarea class="case" id="description" name="description" style="width:250px"></textarea></td></tr>
			<tr><td></td></tr>
			<tr><td></td></tr>
			<tr><td></td><td style="text-align: right"><input type="submit" value="Add"></td></tr>		
		</table>
	</form>
	<?
}else{
	if($type==7){
		$name = htmlentities(RemoveXSS($_GET['arg4']));	
		$title = $name;		
		?>
		<b style="float:left">Bookmark</b><img id="close_box" style="float:right; cursor: pointer" src="../img/cancel.png" onclick="closeMessage()">
		<br><hr>
		<form method="post" name="bookmarkForm" onsubmit="new_bookmark($(this).serialize()); return false;">
			<input type="hidden" name="type" value="<?=$type;?>">
			<input type="hidden" name="partition_id" value="<?=$partition_id;?>">
			<table class="form">
				<tr><td>Name: </td><td><input type="text" name="title" value="<?=$title?>" style="width:250px"></td></tr>
				<tr><td><b>Categories: </b></td><td><input type="text" name="tags" id="tags" style="width:250px"><div id="tag_list" class="autocomplete"></div></td></tr>
				<tr><td style="vertical-align:top">Description: </td><td><textarea class="case" name="description" style="width:250px"></textarea></td></tr>
				<tr><td style="vertical-align:top">Content: </td><td><textarea class="case" name="reference" style="width:250px"></textarea></td></tr>
				<tr><td></td></tr>
				<tr><td></td></tr>
				<tr><td></td><td style="text-align: right"><input type="submit" value="Add"></td></tr>		
			</table>
		</form>
	<?}else{
		if($type==6) $reference = $_GET['arg5'];
		$name = htmlentities(RemoveXSS($_GET['arg4']));	
		$title = $name;
		?>
		<b style="float:left">Bookmark</b><img id="close_box" style="float:right; cursor: pointer" src="../img/cancel.png" onclick="closeMessage()">
		<br><hr>
		<form method="post" name="bookmarkForm" onsubmit="new_bookmark($(this).serialize()); return false;">
			<input type="hidden" name="type" value="<?=$type;?>">
			<input type="hidden" name="reference" value="<?=$reference;?>">
			<input type="hidden" name="partition_id" value="<?=$partition_id;?>">
			<table class="form">
				<tr><td>Name: </td><td><input type="text" name="title" value="<?=$title?>" readonly style="width:250px; color:grey"></td></tr>
				<tr><td><b>Categories: </b></td><td><input type="text" name="tags" id="tags" style="width:250px"><div id="tag_list" class="autocomplete"></div></td></tr>
				<tr><td style="vertical-align:top">Description: </td><td><textarea class="case" name="description" style="width:250px"></textarea></td></tr>
				<tr><td></td></tr>
				<tr><td></td></tr>
				<tr><td></td><td style="text-align: right"><input type="submit" value="Add" onclick="change_star(1, '<?=$type?>', '<?=$reference?>', '<?=$partition_id?>', '<?=$name?>');"></td></tr>		
			</table>
		</form>
	<?}?>
<?}?>

<script type="text/javascript">
new Ajax.Autocompleter('tags', 'tag_list', 'get_tags.php', {tokens: ' '});
document.bookmarkForm.description.focus();
</script>
<?}?>
Return current item: Ptk-forensics