<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Entier Studio</title>
<script src="../scripts/common.{USERBROWSER}.js" type="text/javascript" language="javascript"></script>
<link rel="stylesheet" type="text/css" href="../styles/pageview.{USERBROWSER}.css">
<link rel="stylesheet" type="text/css" href="../styles/gridview.{USERBROWSER}.css">
</head>
<body>
<table id="grid" name="grid" class="gridView" style="width:220px" cellspacing="0" cellpadding="1" onKeyDown="fGridOnKeyDown()">
<thead>
<tr valign="middle" class="gridHead">
<td class="gridHeadCell" width="10%"> </td>
<td class="gridHeadCell" width="90%"> </td>
</tr>
</thead>
<tbody>
<block:list>
<tr valign="middle" class="gridBody">
<td class="gridBodyNrow" width="10%"> </td>
<td class="gridBodyCell" width="90%"><a class="gridItem" href="mainpage.php?__ctrl=RepositoryElementExport&__mode=form&__view=form&__user={DIRPUSRPKID}&pkid={TMPELEMPKID}&type={OBJETYPPKID}&step=2" target="form"><img src="images/elem_item-{OBJETYPPKID}.gif" alt="Icon" class="gridIcon"> {TMPELEMCODE}</a></td>
</tr>
</block:list>
<tr valign="middle" class="gridBody">
<td class="gridBodyNrow" width="10%"> </td>
<td class="gridBodyCell" width="90%"><span style="width:100%" ondrop="fGridOnDrop(this, 'model', {DIRPUSRPKID} )" onDragEnter="fGridOnDragOver()" onDragOver="fGridOnDragOver()"> </span></td>
</tr>
</tbody>
</table>
<script type="text/javascript" language="javascript">
//
var selectUrl = "mainpage.php?__ctrl=RepositoryElementExport&__mode=form&__view=form&__user={DIRPUSRPKID}&step=1&link={OBJELEMPKID}&bind="
var viewInnerHtml0 = '<span style="width:100%" ondrop="fGridOnDrop(this, ' + "'model'" + ' )" onDragEnter="fGridOnDragOver()" onDragOver="fGridOnDragOver()"> </span>';
//
function fGridOnDragOver ()
{
event.returnValue = false;
if (window.event.dataTransfer.getData("Text") )
window.event.dataTransfer.dropEffect = "copy";
}
//
function fGridOnDrop( TheDrop, TheMode ) {
var theData = unescape( window.event.dataTransfer.getData("Text") );
if ( theData && (theData != "" ) ) {
//
eval( "var theItem=parent." + theData + ";");
//
if( theItem && ( theItem.mode == TheMode) ) {
fGridOnDropItem( TheDrop, theItem );
}
else {
//
if( theItem && ( theItem.mode == "core") ) {
// 1 - Lookup if core model
var theView = parent.frames["view"];
var theName = theItem.name;
if( theName == theView.gDragName )
fGridOnDropList( TheDrop, theItem );
}
}
}
}
//
function fGridOnDropItem( TheDrop, TheItem )
{
//
var theName = TheItem.name;
var thePkid = TheItem.pkid;
var theType = TheItem.type;
//
var theGrid = document.all["grid"];
var theBody = theGrid.tBodies(0);
var theCell = TheDrop.parentElement;
var theLine = theCell.parentElement;
// Fill the drop cell
TheDrop.innerHTML = '<a class="gridItem" href="' + selectUrl + thePkid + '&kind=' + theType + '" target="form"> ' + theName + '</a>';
// Add a new line
var NewLine = theBody.insertRow();
NewLine.className = "gridBody";
//
var NewCell = NewLine.insertCell();
NewCell.width = "10%";
NewCell.className = "gridBodyNRow";
NewCell.innerText = " ";
//
NewCell = NewLine.insertCell();
NewCell.width = "90%";
NewCell.className = "gridBodyCell";
NewCell.innerHTML = viewInnerHtml0;
}
//
function fGridOnDropList( TheDrop, TheList )
{
//
fGridOnDelete();
//
var theGrid = document.all["grid"];
var theBody = theGrid.tBodies(0);
//
for( var i=0; i < TheList.submenu.items.length; i++ )
{
//
var theName = TheList.submenu.items[i].name;
var thePkid = TheList.submenu.items[i].pkid;
var theType = TheList.submenu.items[i].type;
// Add a new line
var NewLine = theBody.insertRow();
NewLine.className = "gridBody";
//
var NewCell = NewLine.insertCell();
NewCell.width = "10%";
NewCell.className = "gridBodyNRow";
NewCell.innerText = " ";
//
NewCell = NewLine.insertCell();
NewCell.width = "90%";
NewCell.className = "gridBodyCell";
NewCell.innerHTML = '<a class="gridItem" href="' + selectUrl + thePkid + '&kind=' + theType + '" target="form"> ' + theName + '</a>';
}
}
//
function fGridOnKeyDown ()
{
//
if( (event.keyCode != 46) && (event.keyCode != 110) ) {
event.returnValue=true;
}
else {
var theItem = event.srcElement;
while( theItem.tagName != "TD" )
theItem = theItem.parentElement;
//
var theCell = theItem.cellIndex;
var theGrid = document.all["grid"];
var theHead = theGrid.tHead.children[0];
var theBody = theGrid.tBodies(0);
var theLast = theHead.cells.length-1;
if( ( theCell > 1 ) && ( theCell < theLast ) ) {
// Supprimer une cellule
theHead.deleteCell(theCell);
//
for( i = 0 ; i < theBody.rows.length; i++ )
theBody.rows(i).deleteCell(theCell);
}
}
}
//
function fGridOnDelete() {
//
var theGrid = document.all["grid"];
var theBody = theGrid.tBodies(0);
for( i = 0 ; i < theBody.rows.length; i++ )
theBody.deleteRow( i );
}
</script>
</body>
</html>