⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newfold.ssc

📁 PowerBuilder8.0开发分散式应用所帶的例程
💻 SSC
字号:
<!--SCRIPT PSOBJMOD
    import( site.GetRootDocument().location + "/ObjMod80.ssc" );
    session.active = true;
    InitObjects(session);
-->
<!--SCRIPT // {{ SCRIPT()
  var webRoot = site.GetRootDocument();
  import ( webRoot.location + '/system/utils/strtable.ssc' );
  import ( webRoot.location + '/system/utils/wizard.ssc' );
  
  var folderWiz;
  var connList;
  var i;
  var connName;
  var inherited;
  
  folderWiz.name = new wizardPage( 'Text',
    IntlStr.wizNewFold.p1.title,
    IntlStr.wizNewFold.p1.explanation,
    IntlStr.wizNewFold.p1.question
    );
  
  folderWiz.description = new wizardPage( 'TextArea',
    IntlStr.wizNewFold.p2.title,
    IntlStr.wizNewFold.p2.explanation,
    IntlStr.wizNewFold.p2.question
    );
  
  // determine if there is more than one connection, and if so,
  // allow the user to specify a connection for the folder
  connList = site.GetConnectionNameList();
  i = 0;
  inherited = 0;
  for( connName in connList ) {
    i++;
    if( connList[connName] ==  IntlStr.inherited ) break;  // stop if we found the inherited connection
    inherited++;
  }
  if( i > 1 ) {
    folderWiz.connect = new wizardPage( 'Choice',
      IntlStr.wizNewFold.p3.title,
      IntlStr.wizNewFold.p3.explanation,
      IntlStr.wizNewFold.p3.question,
      connList,
      inherited
      );
  }
  
  /* Display the wizard */
  if( site.CreateWizard(folderWiz) ) {
    /* Check if a folder name was provided */
    if( folderWiz.name.value.length > 0 ) {
      /* Check if we need to specify a connection when creating the folder */
      var fullname = document.location + '/' + folderWiz.name.value;
      var newFolder;
      if( i > 1 ) {
	/* Create the folder in the specified directory with the chosen connection */
	newFolder = site.CreateDocument( fullname,
	  'directory', folderWiz.description.value, '', folderWiz.connect.value );
      } else {
	/* Create the folder in the specified directory */
	newFolder = site.CreateDocument( fullname,
	  'directory', folderWiz.description.value );
      }
      if( newFolder == null ) {
	document.writeln( formatString( IntlStr.unableToCreate, fullname ) );
      }
    } else {
      document.writeln( IntlStr.noFolderName );
    }
  }
// }}
-->


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -