2012-03-23, 17:26:11
I've done a bit more tidying/hacking this morning - aiming to implement Chris's suggestion.
To start with, I ran some rough find/replace actions to make my new coa/coa.inc readable - basically the following in vim:
%/{/ {\r/g
%/}/ }\r/g
%/;/;\r/g
I tried phptidy, but it didn't do anything useful for me, and I decided it was quicker to do some dirty find/replace than learn how to use phptidy - especially as I hope plue will soon provide the unobfuscated code
Tab indenting was still non-existant, but I soon found four 'coa' strings in the code - the first being part of the opening comments. So I then replaced this:
with this:
That means I can now use .coa.php files which remove the necessity to hack GS core.
I also modified the function placeObj as follows, although I'm not yet using Coa in a complex enough way for me to test if this works.
Hope this helps others make Coa a little more GS-friendly.
To start with, I ran some rough find/replace actions to make my new coa/coa.inc readable - basically the following in vim:
%/{/ {\r/g
%/}/ }\r/g
%/;/;\r/g
I tried phptidy, but it didn't do anything useful for me, and I decided it was quicker to do some dirty find/replace than learn how to use phptidy - especially as I hope plue will soon provide the unobfuscated code
Tab indenting was still non-existant, but I soon found four 'coa' strings in the code - the first being part of the opening comments. So I then replaced this:
Code:
$pathPage=$pathTemplates.'page.coa';
$pathConstant=$pathTemplates.'constant.coa';
with this:
Code:
$pathPage=$pathTemplates.'page.coa.php';
$pathConstant=$pathTemplates.'constant.coa.php';
That means I can now use .coa.php files which remove the necessity to hack GS core.
I also modified the function placeObj as follows, although I'm not yet using Coa in a complex enough way for me to test if this works.
Code:
function placeObj($OA) {
global $pathTheme;
echo $OA['wrapB'];
$last4=substr($OA['file'],-4);
$last5=substr($OA['file'],-5);
$last8=substr($OA['file'],-8);
if($last8=='.coa.php')makePage($pathTheme.$OA['file'],1);
elseif($last4=='.php'||$last4='.htm'||$last5=='.html')include_once($pathTheme.$OA['file']);
echo $OA['wrapA']."\n";
}
Hope this helps others make Coa a little more GS-friendly.