<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CKFinder - Sample - Popup</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<link href="sample.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../ckfinder.js"></script>
<script type="text/javascript">
function BrowseServer()
{
// You can use the "CKFinder" class to render CKFinder in a page:
var finder = new CKFinder();
finder.basePath = '../'; // The path for the installation of CKFinder (default = "/ckfinder/").
finder.selectActionFunction = SetFileField;
finder.popup();
// It can also be done in a single line, calling the "static"
// popup( basePath, width, height, selectFunction ) function:
// CKFinder.popup( '../', null, null, SetFileField ) ;
//
// The "popup" function can also accept an object as the only argument.
// CKFinder.popup( { basePath : '../', selectActionFunction : SetFileField } ) ;
}
// This is a sample function which is called when a file is selected in CKFinder.
function SetFileField( fileUrl )
{
document.getElementById( 'xFilePath' ).value = fileUrl;
}
</script>
</head>
<body>
<p>
Selected File URL<br />
<input id="xFilePath" name="FilePath" type="text" size="60" />
<input type="button" value="Browse Server" onclick="BrowseServer();" />
</p>
</body>
</html>