You are here

function panels_add_page in Panels 5

Handle the add panels page

1 string reference to 'panels_add_page'
panels_menu in ./panels.module
Implementation of hook_menu()

File

./panels.module, line 244

Code

function panels_add_page($layout = NULL) {
  $layouts = panels_get_layouts();
  drupal_add_css(drupal_get_path('module', 'panels') . '/panels_admin.css');
  if (!$layout) {
    foreach ($layouts as $id => $layout) {
      if (!$default_id) {

        // grab the first one for our default.
        $default_id = $id;
      }
      $file = panels_get_file_path($layout['module'], $layout['icon'], false);
      $output .= theme('panels_add_image', $layout[title], $id, l(theme('image', $file), $_GET['q'] . '/' . $id, NULL, NULL, NULL, NULL, TRUE));
    }
    return $output;
  }
  if (!$layouts[$layout]) {
    return drupal_not_found();
  }
  $panels->layout = $layout;
  return drupal_get_form('panels_edit_form', $panels);
}