replace the old <template OverwriteFlag=.../> lines in php templates

This patch replaces the current way of specifying the template settings with an XML tag like `<template OverwriteFlag=.../>` as the first line of PHP template files.
The new way is a pure PHP implementation, where the template simply sets a special variable like this:
```php
<?php
	global $_TEMPLATE_SETTINGS;
	$_TEMPLATE_SETTINGS = array(
		'OverwriteFlag' => false,
		'DocrootFlag' => false,
		'DirectorySuffix' => '',
		'TargetDirectory' => __MODEL__,
		'TargetFileName' => $objTypeTable->ClassName . '.class.php'
	);
?>
```

Note that the change preserves backward compatibility (i.e. it falls back to the XML tag if the `$_TEMPLATE_SETTINGS` is not defined). This is necessary to make sure the existing user templates are still properly processed.