function views_views_exportables

cis7 views.module views_views_exportables($op = 'list', $views = NULL, $name = 'foo')
cle7 views.module views_views_exportables($op = 'list', $views = NULL, $name = 'foo')
elmsmedia7 views.module views_views_exportables($op = 'list', $views = NULL, $name = 'foo')
icor7 views.module views_views_exportables($op = 'list', $views = NULL, $name = 'foo')
meedjum_blog7 views.module views_views_exportables($op = 'list', $views = NULL, $name = 'foo')
mooc7 views.module views_views_exportables($op = 'list', $views = NULL, $name = 'foo')

Implement hook_views_exportables().

File

sites/all/modules/ulmus/views/views.module, line 2327
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_views_exportables($op = 'list', $views = NULL, $name = 'foo') {
  $all_views = views_get_all_views();
  if ($op == 'list') {

    foreach ($all_views as $name => $view) {
      // in list, $views is a list of tags.
      if (empty($views) || in_array($view->tag, $views)) {
        $return[$name] = array(
          'name' => check_plain($name),
          'desc' => check_plain($view->description),
          'tag' => check_plain($view->tag),
        );
      }
    }
    return $return;
  }

  if ($op == 'export') {
    $code = "/**\n";
    $code .= " * Implement hook_views_default_views().\n";
    $code .= " */\n";
    $code .= "function " . $name . "_views_default_views() {\n";
    foreach ($views as $view => $truth) {
      $code .= "  /*\n";
      $code .= "   * View " . var_export($all_views[$view]->name, TRUE) . "\n";
      $code .= "   */\n";
      $code .= $all_views[$view]->export('  ');
      $code .= '  $views[$view->name] = $view;' . "\n\n";
    }
    $code .= "  return \$views;\n";
    $code .= "}\n";

    return $code;
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.