NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
phpdock plus phped integration


Joined: 22 May 2004
Posts: 76
Reply with quote
1) I want to know it if is possible, using the phped integration feature, to pass the currently selected text to a phpdock application for further manipulation of that text.
2) Then I want to know if I can return that text back to the editor.

I know I can do this by calling the php script directly, using the integration feature. But I am wondering if it works the same way when calling phpdock.exe directly? Can I pass data to and from phpdock for further manipulation by my php script?


Also what I want to know is, let's say I launch a phpdock application from integration, the application is a form. After filling out the form, and hitting submit, can I have that information then returned back to the php editor?

Thanks,
Jeff
View user's profileFind all posts by jphilapySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Thanks, it's much clearer now. I hope, my answer is clear too Smile let know if it's not.
As of 2.0 and 5.2 - I can think of the following scenario:
you can create a script that will be called from phped. It will
1) save necessary arguments into a file,
2) update phpdock.ini to have phpdock started with specified URL where filename per p.1 is passed in among the other GET arguments
3) launch phpdock and wait for the results.

Meanwhile phpdock starts with the URL, processes its input that it can get from the file, show you with some kind of html form, get the POSTed data after you clicked submit button and store the results into a specified (known) "results" file. At this point the script that you've invoked from PhpED will pick up the results and return them into the editor.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 May 2004
Posts: 76
Reply with quote
Ok, Sounds good to me. I will give it a try.

Thanks,
Jeff

dmitri wrote:
Thanks, it's much clearer now. I hope, my answer is clear too Smile let know if it's not.
As of 2.0 and 5.2 - I can think of the following scenario:
you can create a script that will be called from phped. It will
1) save necessary arguments into a file,
2) update phpdock.ini to have phpdock started with specified URL where filename per p.1 is passed in among the other GET arguments
3) launch phpdock and wait for the results.

Meanwhile phpdock starts with the URL, processes its input that it can get from the file, show you with some kind of html form, get the POSTed data after you clicked submit button and store the results into a specified (known) "results" file. At this point the script that you've invoked from PhpED will pick up the results and return them into the editor.
View user's profileFind all posts by jphilapySend private message


Joined: 22 May 2004
Posts: 76
Reply with quote
It works pretty good. I initially built a script that will let you insert a href tag. Now this is just a quick script so don't expect much.

The file that I add into phped integration, contains this code:

filename: call_phpdock.php
Code:
<?php
exec('C:\dev\xampp\SITES\ah_apps\phpdock.exe');

//read values from file
$file = './insert_text.txt';
$fh = fopen($file,'r');
$string = fread($fh,filesize($file));
print $string;
fclose($fh);
?>



The theform.php (contains the form) file that phpdock calls looks like this:

Code:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
if(isset($_POST['submit_form']))
{
    //write values to file
    $fh = fopen('./insert_text.txt','w');
    fwrite($fh,'<a href = "' . $_POST['test'] . '"></a>');
    fclose($fh);
   
    $body = " onLoad='self.close();'";
}
?>
</head>

<body<?php echo "$body"; ?>>
<form name="test_param" action="" method="post">
<input type="text" name="test" size="25">
<input type="hidden" name="submit_form" value="true">
<input type="submit" name="save" value="save">
</form>
</body>
</html>



So when I run the script 'call_phpdock.php' from the scripts menu, it then starts phpdock and displays a form. Then I fill out the form and click submit, data is written to a file and the window auto closes. Then the text is inserted into my current document.

The only problem I noticed, is that I have to set absolute paths in my ini file, or else I get an error saying that phpdock can't find the 'appicon.ico' and then the window won't close not even if I click the red x. I have to use the task manager to kill the window.


Any ideas or suggestions?

Jeff
View user's profileFind all posts by jphilapySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
I get an error saying that phpdock can't find the 'appicon.ico' and then the window won't close

We've fixed this problem. You may want to update to build PhpDock 2010.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
phpdock plus phped integration
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic