SHARE
TWEET

NPC Group Import & Export

sweenig Jan 14th, 2014 (edited) 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <style>
  2.   label,textarea,input[type='submit'] {
  3.     border:1px solid #ccc;
  4.     padding:10px;
  5.     margin: 0 0 10px;
  6.     display:block;
  7.   }
  8.   textarea {display:initial;}
  9.   label:hover,textarea:hover,input[type='submit']:hover {
  10.     background:#eee;
  11.     cursor:pointer;
  12.   }
  13. </style>
  14. <script>
  15.   function validateForm(form_name){
  16.     var x=form_name.useIDs.value;if (x===null || x===""){alert("useIDs cannot be blank");return false;} //check for required field
  17.     var y=form_name.allowDeletes.value;if (y===null || y===""){alert("allowDeletes cannot be blank");return false;} //check for required field
  18.     var z=form_name.xmlDocument.value;if (z===null || z===""){alert("xmlDocument cannot be blank");return false;} //check for required field
  19.     form_name.xmlDocument.value = escape(form_name.xmlDocument.value); //clean up the form name
  20.     for(i=0; i < form_name.xmlDocument.value.length; i++){ //remove carriage returns from the XML body
  21.      if(form_name.xmlDocument.value.indexOf("%0D%0A") > -1) {form_name.xmlDocument.value=form_name.xmlDocument.value.replace("%0D%0A","");}
  22.       else {
  23.         if(form_name.xmlDocument.value.indexOf("%0A") > -1) {form_name.xmlDocument.value=form_name.xmlDocument.value.replace("%0A","");}
  24.         else {
  25.           if(form_name.xmlDocument.value.indexOf("%0D") > -1) {form_name.xmlDocument.value=form_name.xmlDocument.value.replace("%0D",""); }
  26.         }
  27.         form_name.xmlDocument.value=unescape(form_name.xmlDocument.value);
  28.       }
  29.     }
  30.   }
  31. </script>
  32. <h2>Import Group XML</h2>
  33.   <form name="importxml" target="_blank" action="/portalwebservice/AdminCommandWS.asmx/UpdateGroups" method="POST" onsubmit="return validateForm(this);">
  34.     <label>Use IDs in XML <input type="checkbox" name="useIDs" checked /></label>
  35.     <label>Allow Deletes <input type="checkbox" name="allowDeletes" /></label>
  36.     <textarea cols="40" rows="6" name="xmlDocument"></textarea>
  37.     <input type="submit" value="Import Group XML">
  38.   </form>
  39.   <form target="_blank" action="/portalwebservice/AdminCommandWS.asmx/ListGroups" method="POST">
  40.     <label>Parent Group: <input type="text" name="parentPath" value="/All Groups"></label>
  41.     <input type="submit" value="Export Group XML">
  42.   </form>
RAW Paste Data
Top