Well...
I ve made an external php script that parses and imports a specific type of an xml file and does two things:
1) Creates a text file with info from xml
2) Creates an image from xml
The idea is this : these 2 fies (image and text) to be saved using the k2 editor in k2 items database. So i want to execute from inside k2 editor the external php script that will produce for me these files and also will inform the text fields in the screen of k2 editor. After that a "Save" from user and will be ok!
By exec the script i want to inform the screen of k2 editor and not directly the database of K2 because i want to give the user the oportunity to see and alter the imported fields.
As i ve read to forums any external php script must have the joomla environment that is :
* Initialize Joomla framework */define( '_JEXEC', 1 );define('JPATH_BASE', dirname(__FILE__) );define( 'DS', DIRECTORY_SEPARATOR );require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );/* To use Joomla's Database Class */require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' );//require_once ( JPATH_BASE .DS.'simplexml'.DS.'simplexml.class.php' );/* Create the Application *//*$mainframe =& JFactory::getApplication('appname', array('session' => false));*/$mainframe =& JFactory::getApplication('site');
I may have to keep this environment in my extrernal script cause i want to use Joomla session to set value to my 2 vars and return them back to k2 editor screen.
My difficulty is on how to return control to the k2 editor page (no matter if it is in squeezebox ) from external php script !
That's my main problem,
Thank you for interesting!