|
| Converting a line to a PHP string? | |
Joined: 07 Jun 2006 |
Posts: 6 |
|
|
|
Posted: Thu Jul 13, 2006 6:39 pm |
|
|
|
|
|
Hi
Just wondering if it's possible to highlight a line, for example:
<table cellpadding="0" cellspacing="0" border="0"> |
And then have it converted to a PHP string (with the quotes escaped) and even an echo at the beginning of the line?
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"; |
Or even have it preceed the text with a configurable value, for example, $text .=
$text .= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"; |
What do you reckon?
Thanks in advance
M
|
|
|
| | |
|
| | |
Joined: 07 Jun 2006 |
Posts: 6 |
|
|
|
Posted: Fri Jul 14, 2006 8:34 am |
|
|
|
|
|
Ok, I tried that, but doesn't quite work.
I created the script, saved it as ReturnEscaped.php, then went to Tools -> Settings -> Integration, added a new menu, set "Execute with" to Shell, and "Command line:" to @php5@ -q "c:\wamp\www\ReturnEscaped.php"
In the options I only checked-on the "Show this command in Tools menu"
Then, when I highlighted some text in a file, and hit Tools -> Scripts -> "Convert to PHP string" I get the following dialog popup:
"Windows cannot find 'C:\program' make sure you typed the name correctly, and then try again. "
Is this to do with Shell? Why can it not seem to shell out successfully? Is there a path I'm supposed to set somewhere?
Thanks
M
|
|
|
| | |
|
| | |
|
| | |
Joined: 15 Jul 2006 |
Posts: 18 |
|
|
|
Posted: Sat Jul 15, 2006 4:35 am |
|
|
|
|
|
blueend wrote: | How about extending the Integration with some sort of "easy Plugin" architecture? I mean the possibility to use PHP scripts for certain actions is really a superb feature, but I think that there are not too many developers using this really cool feature out there. I guess there is much more potential in this easy architecture. For example: How about creating a simple "Plugin" Format which basically is a PHP script but has a detailed header (e.g. as PHP Comment) which includes all settings that are necessary to plug it into phpEd (essentially all settings in the dialog above) - or a special INI format which includes these settings. With this format adding such a script is just like "selecting the desired file" and the rest can be done automatically. Having such a simple format you could easily start a small "Extension Exchange" were all PHPEd users could start to share their "helper Scripts" and I am sure that many developers will contribute their extensions here. |
I agree. You can have probably an XML file attached to the source code of the plugin (php code) which tells what to be done.
e.g. Joomla! extenstion installer :
<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="component" version="1.0.0">
<name>Content Page</name>
<author>Joomla! Project</author>
<creationDate>July 2004</creationDate>
<copyright>(C) 2005 Open Source Matters. All rights reserved.</copyright>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>1.0.0</version>
<description>This shows a single content page</description>
<params>
<param name="pageclass_sfx" type="text" size="20" default="" label="Page Class Suffix" description="A suffix to be applied to the css classes of the page, this allows individual page styling" />
<param name="back_button" type="list" default="" label="Back Button" description="Show/Hide a Back Button, that returns you to the previously view page">
<option value="">Use Global</option>
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="keyref" type="text" size="25" default="" label="Key Reference" description="A text key that an item may be referenced by (like a help reference)" />
<param name="docbook_type" type="list" default="" label="DocBook Type" description="Associates a type of DocBook document with this content item (Note: experimental, not for production).">
<option value=""></option>
<option value="appendix">Appendix</option>
<option value="article">Article</option>
<option value="book">Book</option>
<option value="chapter">Chapter</option>
<option value="glossary">Glossary</option>
<option value="part">Part</option>
<option value="refentry">Refentry</option>
<option value="section">Section</option>
</param>
</params>
</mosinstall> |
|
_________________ developer@ clexus
|
|
| Almost there ... | |
Joined: 07 Jun 2006 |
Posts: 6 |
|
|
|
Posted: Sat Jul 15, 2006 5:07 am |
|
|
|
|
|
I'm not sure what's happened, but when I highlight a <table> tag and click on the new script it produces the following:
<?php echo "<\0t\0a\0b\0l\0e\0 \0c\0e\0l\0l\0p\0a\0d\0d\0i\0n\0g\0=\0\"\00\0\"\0 \0c\0e\0l";?>
It's close, but not exactly what I was looking for
Any clues?
|
|
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
|
|
|
| |