You are here

function panels_mini_panels_exportables in Panels 5.2

Same name and namespace in other branches
  1. 6.2 panels_mini/panels_mini.module \panels_mini_panels_exportables()

Implementation of hook_panels_exportables().

File

panels_mini/panels_mini.module, line 1200
panels_mini.module

Code

function panels_mini_panels_exportables($op = 'list', $panels = NULL, $name = 'foo') {
  static $all_panels = NULL;
  if ($op == 'list') {
    if (empty($all_panels)) {
      $all_panels = panels_mini_load_all();
    }
    foreach ($all_panels as $name => $panel) {
      $return[$name] = check_plain($name) . ' (' . check_plain($panel->title) . ')';
    }
    return $return;
  }
  if ($op == 'export') {
    $code = "/**\n";
    $code .= " * Implementation of hook_default_panel_minis()\n";
    $code .= " */\n";
    $code .= "function " . $name . "_default_panel_minis() {\n";
    foreach ($panels as $panel => $truth) {
      $code .= panels_mini_export($all_panels[$panel], '  ');
      $code .= '  $minis[\'' . check_plain($panel) . '\'] = $mini;' . "\n\n\n";
    }
    $code .= "  return \$minis;\n";
    $code .= "}\n";
    return $code;
  }
}