outputhtml : catch only de layout zones not used and not all the {XXXX} text
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4869 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -86,6 +86,9 @@ class outputhtml extends output
|
||||
</html>
|
||||
EOT;
|
||||
}
|
||||
// Get all the substitute zones
|
||||
preg_match_all ("~({[\w_-]+})~", $layoutPage, $matches);
|
||||
$zones = $matches[1];
|
||||
|
||||
// All the entries coming from views in array are substitute in layout
|
||||
// {content}, {title}
|
||||
@@ -106,7 +109,8 @@ EOT;
|
||||
$layoutPage = str_replace ($key, $val, $layoutPage);
|
||||
|
||||
// Remove the not used {XXX}
|
||||
$layoutPage = preg_replace ("~({[\w_-]+})~", "", $layoutPage);
|
||||
foreach ($zones as $zone)
|
||||
$layoutPage = str_replace ($zone, "", $layoutPage);
|
||||
|
||||
//echo $layoutPage;exit;
|
||||
// Manage the timestamp/md5sum for the external files managed by this
|
||||
@@ -126,7 +130,7 @@ EOT;
|
||||
if (! empty ($errors))
|
||||
{
|
||||
echo "ERROR: Invalid HTML provided\n";
|
||||
echo "<pre>";var_dump ($errors);
|
||||
echo "<pre>"; print_r ($errors);
|
||||
foreach (explode ("\n", $layoutPage) as $key => $val)
|
||||
{
|
||||
echo sprintf ("%5d", $key+1)." ".htmlentities ($val)."\n";
|
||||
|
||||
Reference in New Issue
Block a user