function asset_widget_page_alter in Asset 7
Implements hook_page_alter().
File
- modules/
asset_widget/ asset_widget.module, line 896 - Code for the Asset widget module.
Code
function asset_widget_page_alter(&$page) {
// Remove all except form part from page via custom page theming.
if (asset_widget_in_frame_form()) {
// Add specific library for inner widget forms.
drupal_add_library('asset_widget', 'asset_widget_inner_form');
unset($page['page_top']);
unset($page['page_bottom']);
$page['#theme'] = 'asset_widget_asset_form_page';
}
elseif (asset_widget_add_to_page()) {
// Add our widget to page far from form to avoid any rebuilding.
drupal_add_library('asset_widget', 'asset_widget');
$page['content']['asset_widget'] = array(
'#markup' => theme('asset_widget_wrapper'),
);
}
}