function views_ui_build_preview in Views (for Drupal 7) 7.3
Same name and namespace in other branches
- 8.3 views_ui/admin.inc \views_ui_build_preview()
1 call to views_ui_build_preview()
- views_ui_edit_page in includes/
admin.inc - Page callback for the Edit View page.
1 string reference to 'views_ui_build_preview'
- views_ui_menu in ./
views_ui.module - Implements hook_menu().
File
- includes/
admin.inc, line 945 - Provides the Views' administrative interface.
Code
function views_ui_build_preview($view, $display_id, $render = TRUE) {
if (isset($_POST['ajax_html_ids'])) {
unset($_POST['ajax_html_ids']);
}
$build = array(
'#theme_wrappers' => array(
'container',
),
'#attributes' => array(
'id' => 'views-preview-wrapper',
'class' => 'views-admin clearfix',
),
);
$form_state = array(
'build_info' => array(
'args' => array(
$view,
$display_id,
),
),
);
$build['controls'] = drupal_build_form('views_ui_preview_form', $form_state);
$args = array();
if (!empty($form_state['values']['view_args'])) {
$args = explode('/', $form_state['values']['view_args']);
}
$build['preview'] = array(
'#theme_wrappers' => array(
'container',
),
'#attributes' => array(
'id' => 'views-live-preview',
),
'#markup' => $render ? views_ui_preview($view
->clone_view(), $display_id, $args) : '',
);
return $build;
}