Allows to alter the list of pages on the CMS/Pages page in the Administration Area.
The event handler accepts the back-end controller object and should return
a configured
Cms_Page object. The following example repeats the default functionality,
and effectively does not change the page list behavior.
public function subscribeEvents()
{
Backend::$events->addEvent('cms:onPreparePageListData', $this, 'prepare_page_list');
}
public function prepare_page_list($controller)
{
$obj = Cms_Page::create();
if (!$controller->currentUser->get_permission('cms', 'manage_pages'))
$obj->where('pages.has_contentblocks is not null and pages.has_contentblocks > 0');
if (Cms_Theme::is_theming_enabled())
{
$theme = Cms_Theme::get_edit_theme();
if ($theme)
$obj->where('theme_id=?', $theme->id);
}
return $obj;
}