Hi,
I’m currently modding a plugin for fck editor which allows you to add to create links to site documents, what is the best way to start the MODx API on an external php file?
At the moment i have copied index.php and changed the line which executes the modx parser
// execute the parser
$modx->aexecuteParser();
Then I have copied part of the executeparser() function in this file
\manager\includes\document.parser.class.inc.php
and created this function:
function aexecuteParser() {
//error_reporting(0);
if (version_compare( phpversion(), "5.0.0", ">=" ))
set_error_handler(array(&$this,"phpError"), E_ALL);
else
set_error_handler(array(&$this,"phpError"));
$this->db->connect();
// get the settings
if(empty($this->config)) {
$this->getSettings();
}
}
I guess theres a better way to do this, but I can’t work out how to do it, I know doing it like this will lead to problems in the future, any help would be much appreciated and once I have removed the above mess i will release the fckeditor plugin which allows you to create hyperlinks to internal modx documents via the menu.
A screen shot is attached so you can see how it will work.
Thanks
Aaron