Of course I can shareJan wrote:Hi, thank you for your information, yes the non system solution (find and replace link to pdf) is not good solution but didn't find any better
Maybe using ereg_replace will be better then preg_replace_callback.
Did you test it, does it work? If yes, I will try to change it and test it.
Can you share changes you have made?
Thank you, Jan
I replaced original code
Code: Select all
if ($pdfDestination == 'I' || $pdfDestination == 'D') {
// Remome OnClick
//$bodySite = preg_replace_callback('/<a(.+)href="(.*)format=pdf(.*)"(.+)onclick="(.*)"/Ui', array('plgSystemPhocaPDFContent', 'phocaPDFCallbackOnClick'), $bodySite);
} else {
//$bodySite = preg_replace_callback('/<a(.+)href="(.*)format=pdf(.*)"/Ui', array('plgSystemPhocaPDFContent', 'phocaPDFCallback'), $bodySite);
// IE 7 bug
$bodySite = preg_replace_callback('/<a(.+)href="(.*)format=pdf(.*)"(.+)onclick="(.*)"/Ui', array('plgSystemPhocaPDFContent', 'phocaPDFCallbackOnClickIE'), $bodySite); //this line is causing blank page
}
Code: Select all
$bodySite = str_ireplace('?format=pdf','?format=phocapdf',$bodySite);
I'm guessing that my solution is not in any way the best solution since $bodySite contains whole code of page (so maybe somewhere else on the page will be '?format=pdf' ).
Also I'm still trying to figure out problem when SEF and suffix is on. SEF engine adds suffix based on format= part of query(then format should be .phocapdf) but it's not. I know that there is solution with template override of article/category-blog/section-blog content. But I guess that there should be more general solution for this problem also.
And one more thing (since I'm new to joomla coding and I'm still trying to fit all pieces together ). Is this plugin must belong to system category(maybe content?) ? If question is stupid just don't laugh