Create a
function include_if_exists(filename_relative_to_PGV_base)
In the code that generates headers and footers, put at the obvious places:
include_if_exists("customizations/before_head_open.inc");
include_if_exists("customizations/after_head_open.inc");
include_if_exists("customizations/before_head_close.inc");
include_if_exists("customizations/after_head_close.inc");
include_if_exists("customizations/before_body_open.inc");
include_if_exists("customizations/after_body_open.inc");
include_if_exists("customizations/before_body_close.inc");
include_if_exists("customizations/after_body_close.inc");
include_if_exists("customizations/after_html_close.inc");
Then users can put plain HTML, with or without PHP sections, in the appropriate files, or leave the files out. Perhaps create a couple of xxx_xxx_xxx.inc.sample that they can edit and rename. A sample should show how to invoke Javascript from a separate file instead of embedding it in the PHP/HTML.
customizations/before_body_close.inc.sample should contain the Google analytics code moved out of the
footer patch.
Wes
I've only just seen this proposal of yours. A good one too.
In the absence of it though, I thought I'd share what I do. Its simple, and works well if you upgrade using Tortoise SVN as the changes to standard files is minimal enough to be auto-merged.
What I do is very simple:
1 - I created a new folder called 'modfiles' in the PGV root folder. I place all my re-written or modified files in here, with the same name as their original.
2 - in each original file I add two lines of code:
A - at the very top, before anything is processed, something like:
if (!file_exists("modfiles/family.php")){
B - at the very bottom :
} else {include ('modfiles/family.php');}
When I do an svn update, TortoiseSVN generally regards as insignificant differences, so just merges any changes. Very rarely it will give a "conflicted file" warning, which I can easily rectify.
I then just need to use WinMerge to compare my modified file with the new one from svn to see what changes I need to carry across to my own file - usually a very simple process.