home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 September / Australian PC User - September 2003 (CD1).iso / magstuff / web / files / dwmx61.exe / Disk1 / data1.cab / Configuration_En / Objects / Script / SSI.js < prev   
Encoding:
JavaScript  |  2002-11-25  |  1.2 KB  |  36 lines

  1. // Copyright 2001 Macromedia, Inc. All rights reserved.
  2.  
  3. //---------------     API FUNCTIONS    ---------------
  4.  
  5. function isDOMRequired()
  6.     // Return false, indicating that this object is available in code view.
  7.     return false;
  8. }
  9.  
  10. function objectTag()
  11. {
  12.   var bDialogState = dw.getShowDialogsOnInsert(); // Was dialog shown?
  13.   var newURL = browseForFileURL("select");
  14.  
  15.   if ((newURL == '') && bDialogState)
  16.     return '';
  17.  
  18.   // Attempt to get SSI used for connection include file if Server Model is defined for page
  19.   var insertText = "";
  20.   if (dw.getDocumentDOM().serverModel.getDisplayName() != "")
  21.     insertText = dw.getExtDataValue("connectioninc_statement", "insertText");
  22.  
  23.   // Default to NCSA SSI
  24.   if (insertText == "" || insertText.indexOf('@@connectionURL@@') == -1)
  25.       insertText = '<!--#include file="@@connectionURL@@" -->';
  26.  
  27.   // For Apache include, use 'virtual' for site relative file paths, otherwise 'file'
  28.   insertText = (newURL.substring(0,1) == "/")
  29.                 ? insertText.replace("#include file", "#include virtual")
  30.                 : insertText.replace("#include virtual", "#include file");
  31.  
  32.   return (insertText.replace('@@connectionURL@@', newURL));
  33. }
  34.  
  35.