wolfcms/wolfcms — pull request #476 by marekmurawski (2013-02-13 18:48:00+00:00)
Title: Add $layout parameter to Observer::notify('page_before_execute_layout') 

Observer page_before_execute_layout was a bit useless without parameter. Adding the $layout variable to Observe::notify() makes it possible to **do something** with layout code before actual **execution**.

This can be used for example to inject some markup into any layout regardless of it's code.

A sample usage based on code of Skeleton plugin:

```php

Plugin::setInfos(array(
'id' => 'skeleton',
'title' => __('Skeleton'),
'description' => __('Provides a basic plugin implementation. (try enabling it!)'),
'version' => '1.1.0',
'license' => 'GPL',
'author' => 'Martijn van der Kleijn',
'website' => 'http://www.wolfcms.org/',
'update_url' => 'http://www.wolfcms.org/plugin-versions.xml',
'require_wolf_version' => '0.5.5'
));

Plugin::addController('skeleton', __('Skeleton'), 'admin_view', false);

Observer::observe('page_before_execute_layout', 'pbel_handler');

// adds test in front of every page
// and end of test at the end
function pbel_handler( $layout ) {
$layout -> content = 'test ' . $layout -> content . ' end of test';
}

```

PS. My netbeans automagically trims whitespace from line endings so commit looks a bit confusing, sorry