/****************************************************************** PHPRING - Part Editor - permet de figurer sur l'annuaire correspondant Author : iri WebSite : http://www.irizone.net Date : july 2005 *******************************************************************/ /* response of the test of the domain url -> S : domain (as "www.server.com") u -> I : user parameter (not uesed) r -> I : response (1 is OK) <- I : nothing special */ fun cbConnect(url, u, r)= _DSwindow u; _DLGMessageBox _channel editWin "Information !" if !r then strcat "Domain is OK :-) " url else strcat "Domain is not OK !! :-( " url 0; 0;; /* test the domain if it is defined (otherwise display a message box obj -> ObjButton : the button clicked u -> I : user parameter (not used) <- I : nothing special */ fun cbTestDomain(obj, u)= let _CRwindow _channel editWin nil nil 200 30 0 "Testing your domain" -> win in let _CRtext _channel win 5 5 190 20 ET_ALIGN_CENTER "Please, wait ... ! ;-)" -> _ in let _GETtext adresse -> a in let strcat "scol://" _gethostbyname a -> b in if !strcmp a "" then (_DLGMessageBox _channel editWin "Warning !" "No domain is defined !" 0; _DSwindow win; 0) else if b == nil then (_DLGMessageBox _channel editWin "Warning !" "This domain is not valide !" 0; _DSwindow win; 0) else (_rflINETisConnected b @cbConnect win; 0);; /* load the parameters for a module instance l -> [[S r1] r1] : the dmi contents <- I : nothing special */ fun cbload (l) = let getInfo l "author" -> txt in _SETtext author if txt == nil then "SCS" else txt; let getInfo l "comment" -> txt in _SETtext comment if txt == nil then "SCS site" else txt; let getInfo l "adresse" -> txt in _SETtext adresse if txt == nil then "" else txt; 0;; /* main function called when the editor is starting. The openDMI function must be called at the end in order to load the data if the module has already been edited. s -> S : obsolete (unused) <- I : nothing special */ fun IniEditor (s)= let [350 105] -> [w h] in let startEditor _channel nil nil nil w h WN_NORMAL EDITOR_NORMAL s "Dms/CommTools/phpring/phpring.dmc" nil nil @cbload @cbsave nil -> ed in ( set editWin = getEditWin ed; _CRtext _channel editWin 5 5 70 20 ET_ALIGN_LEFT "Author :"; set author = _CReditLine _channel editWin 80 5 265 20 ET_DOWN|ET_AHSCROLL nil; _CRtext _channel editWin 5 30 70 20 ET_ALIGN_LEFT "Comment :"; set comment = _CReditLine _channel editWin 80 30 265 20 ET_DOWN|ET_AHSCROLL nil; _CRtext _channel editWin 5 55 70 20 ET_ALIGN_LEFT "Domain :"; set adresse = _CReditLine _channel editWin 80 55 265 20 ET_DOWN|ET_AHSCROLL nil; _CBbutton _CRbutton _channel editWin 5 80 340 20 0 "Test your domain" @cbTestDomain 0; cbload nil; if s==nil then nil else openDMI ed ); 0 ;;