Location: PHPKode > projects > Content*Builder > contentbuilder/plugins/article2/editor_v2/insimage.php
<?php
extract($_GET);
?>
<HTML>
<HEAD>
<TITLE>Bild einfuegen/bearbeiten</TITLE>
<STYLE TYPE="text/css">
 BODY   {margin-left:10; font-family:Verdana; font-size:10pt; background:menu}
 BUTTON {width:5em}
 TABLE  {font-family:Verdana; font-size:10pt;}
 P      {text-align:center}
</STYLE>
<SCRIPT LANGUAGE=JavaScript>
<!--
var imgCaptions = new Array();
var imgHeights = new Array();
var imgWidths = new Array();
imgCaptions[0] = "";
imgHeights[0] = "0";
imgWidths[0] = "0";

function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
function showPreview()
{
if (document.frmImagePick.ImgUrl.value != "") {
 document.PREVIEWPIC.src=document.frmImagePick.ImgUrl.value ;
 document.frmImagePick.ImgHeight.value = document.PREVIEWPIC.height;
 document.frmImagePick.ImgWidth.value = document.PREVIEWPIC.width;
 }
else
  document.PREVIEWPIC.src='images/imgpreview.gif';
}
// -->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=PREVIEWPIC EVENT=onreadystatechange>
<!--
if(readyState == "complete"){
	PREVIEWPIC.style.visibility = "visible";
	if(document.readyState == "complete"){
	 document.frmImagePick.ImgHeight.value = document.PREVIEWPIC.height;
	 document.frmImagePick.ImgWidth.value = document.PREVIEWPIC.width;
	}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=JavaScript FOR=window EVENT=onload>
<!--
  for ( elem in window.dialogArguments )
  {
    switch( elem )
    {
    case "UploadDirRoot":
      var str = window.dialogArguments["ImgUrl"];
      // args["UploadDirRoot"] == das definierte Upload-Root von CB; wenn die Bild-URL sich
      // innerhalb des erlaubten Pfades ( /uploads/ ) bewegt, wird das Verzeichnis der
      // Datei angezeigt (im anderen Fall bleibt Standard-Verzeichnis)
      // bitte die folgende verrueckte Code-Zeile genau checken ...
      if ((str)&&(str.indexOf(window.dialogArguments["UploadDirRoot"])>=0)){
         if (document.frmImagePick.UploadDirRoot.value=str.substring(window.dialogArguments["UploadDirRoot"].length-1,str.lastIndexOf("/"))){
             document.IMGPICK.location.href="browseimage.php?dir="+document.frmImagePick.UploadDirRoot.value+"&IMGURL="+str;
             //alert(document.IMGPICK.location.href);
         }
      }
      break;
    case "ImgUrl":
      document.frmImagePick.ImgUrl.value=window.dialogArguments["ImgUrl"];
      showPreview();
      //alert(document.IMGPICK.location.href);
      break;
    case "AltText":
      document.frmImagePick.AltText.value = window.dialogArguments["AltText"];
      break;
    case "ImgBorder":
      document.frmImagePick.ImgBorder.value = window.dialogArguments["ImgBorder"];
      break;
    case "HorSpace":
      document.frmImagePick.HorSpace.value = window.dialogArguments["HorSpace"];
      break;
    case "VerSpace":
      document.frmImagePick.VerSpace.value = window.dialogArguments["VerSpace"];
      break;
    case "ImgHeight":
      document.frmImagePick.ImgHeight.value = window.dialogArguments["ImgHeight"];
      break;
    case "ImgWidth":
      document.frmImagePick.ImgWidth.value = window.dialogArguments["ImgWidth"];
      break;
    case "ImgAlign":
      for(i=1;i<(document.frmImagePick.ImgAlign.length-1);i++)
        if(document.frmImagePick.ImgAlign[i].value==window.dialogArguments["ImgAlign"])
          document.frmImagePick.ImgAlign.selectedIndex = i;
      break;
    }
  }
// -->
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=Ok EVENT=onclick>
<!--
  var arr = new Array();
  if (document.PREVIEWPIC.src=='imgpreview.gif'){
    alert('You did not select a picture. Page not updated.');
    arr=null;
  } else {
  arr["AltText"] = document.frmImagePick.AltText.value;
  arr["HorSpace"] = document.frmImagePick.HorSpace.value;
  arr["VerSpace"] = document.frmImagePick.VerSpace.value;
  arr["ImgUrl"] = document.frmImagePick.ImgUrl.value;
  arr["ImgBorder"] = document.frmImagePick.ImgBorder.value;
  arr["ImgAlign"] = document.frmImagePick.ImgAlign[document.frmImagePick.ImgAlign.selectedIndex].value;
  arr["ImgHeight"] = document.frmImagePick.ImgHeight.value;
  arr["ImgWidth"] = document.frmImagePick.ImgWidth.value;
  arr["ImgAlign"] = document.frmImagePick.ImgAlign[document.frmImagePick.ImgAlign.selectedIndex].value;
  }
  
  window.returnValue = arr;
  window.close();
// -->
</SCRIPT>

</HEAD>

<BODY>
<FORM NAME="frmImagePick" method="post" action="">
<TABLE CELLSPACING=2 border="0">
<TR>
</TR>
<TD VALIGN="top" align="left" nowrap colspan=2>Browse Picture Source
(to article assigned media folder : <a href="#" onClick="document.IMGPICK.location.href='browseimage.php?dir=<?php echo urlencode($BASEURL);?>'"><?php echo $BASEURL;?></a>):<br>
<INPUT TYPE=HIDDEN SIZE=150 value="123" NAME="UploadDirRoot" style="width : 380px;">
</TD></TR>
<TR>
<TD VALIGN="top" align="left" nowrap>
<iframe name="IMGPICK" src="browseimage.php?dir=<?php echo urlencode($BASEURL);?>" style="border: solid black 1px; width: 320px; height:240px; z-index:1"></iframe>
</TD>
<TD VALIGN="top" align="center" nowrap>
<p>
<span style="background-color:gray;overflow:auto;width:230px;height:240px;border-width:1px;
border-style:solid;border-color:threeddarkshadow white white threeddarkshadow;">
<IMG ID="PREVIEWPIC" NAME="PREVIEWPIC" bgcolor="#ffffff" src="icons/imgpreview.gif" alt="Preview" align="absmiddle" valign="middle"></span>
</p>

</TD></TR>
<TR>
<TD VALIGN="top" align="left" colspan="2" nowrap>
Or Enter Full URL :<br>
<INPUT TYPE=TEXT SIZE=40 NAME=ImgUrl style="width : 300px;" value=""  onChange="showPreview()">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BUTTON ID=Ok>   OK   </BUTTON>
<br>Alternate Text:<br>
<INPUT TYPE=TEXT SIZE=40 NAME=AltText style="width : 300px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BUTTON ONCLICK="window.close();">Cancel</BUTTON>
</TD>
</TR>
<TR>
<TD VALIGN="top" align="left" colspan="2">
<table border=0 cellpadding=2 cellspacing=2>
<tr>
<td nowrap>
<fieldset style="padding : 2px;"><legend> Layout </legend>
<table border=0 cellpadding=2 cellspacing=2>
<tr>
<td>Alignment:</td>
<td><select NAME=ImgAlign style="width : 80px;">
<option value=""></option>
<option value="left">Left</option>
<option value="right">Right</option>
<option value="top">Top</option>
<option value="middle">Middle</option>
<option value="bottom">Bottom</option>
</select>
</td>
</tr>
<tr>
<td nowrap>Border Thickness:</td>
<td><INPUT TYPE=TEXT SIZE=2 value="0" NAME=ImgBorder  ONKEYPRESS="event.returnValue=IsDigit();" style="width : 80px;"></td>
</tr>
</table>
</fieldset>
</td>
<td nowrap>
<fieldset style="padding : 5px;"><legend> Spacing </legend>
<table border=0 cellpadding=2 cellspacing=1>
<tr>
<td>Horizontal:</td>
<td><INPUT TYPE=TEXT SIZE=2 value="0" NAME=HorSpace  ONKEYPRESS="event.returnValue=IsDigit();" style="width : 80px;"> </td>
</tr>
<tr>
<td>Vertical:</td>
<td><INPUT TYPE=TEXT SIZE=2 value="0" NAME=VerSpace  ONKEYPRESS="event.returnValue=IsDigit();" style="width : 80px;"></td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</TD>
 </TR>
</TABLE>
<INPUT TYPE=HIDDEN SIZE=5 value="0" NAME=ImgHeight>
<INPUT TYPE=HIDDEN SIZE=5 value="0" NAME=ImgWidth>
</FORM>
</BODY>
</HTML>
Return current item: Content*Builder