You are here

function panels_views_export in Panels 5.2

Export a view pane into PHP code.

This code is suitable to run through eval() and then be used in panels_views_save().

2 calls to panels_views_export()
panels_views_export_view in panels_views/panels_views.module
Page callback to export a view pane.
panels_views_panels_exportables in panels_views/panels_views.module
Implementation of hook_panels_exportables().

File

panels_views/panels_views.module, line 1464
panels_views.module

Code

function panels_views_export($pv, $prefix = '') {
  $output = '';
  $fields = panels_views_pane_fields();
  $output .= $prefix . '$panel_view = new stdClass()' . ";\n";
  foreach ($fields as $field => $data) {
    $value = empty($data['primary']) ? $pv->{$field} : 'new';
    $output .= $prefix . '  $panel_view->' . $field . ' = ' . panels_var_export($value, '  ') . ";\n";
  }
  return $output;
}