Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Implementation of hook_form().
- */
- function panels_node_form(&$node, &$param) {
- $form['panels_node']['#tree'] = TRUE;
- if (empty($node->nid)) {
- // Grab our selected layout from the $node, If it doesn't exist, try arg(3)
- // and if that doesn't work present them with a list to pick from.
- $panel_layout = isset($node->panel_layout) ? $node->panel_layout : arg(3);
- if (!isset($node->panel_layout) && arg(3)) {
- $node->panel_layout = arg(3);
- }
- if (empty($panel_layout)) {
- $opts = $_GET;
- unset($opts['q']);
- return drupal_goto('node/add/panel/choose-layout', $opts);
- }
- panels_load_include('plugins');
- $layout = panels_get_layout($panel_layout);
- if (empty($layout)) {
- return drupal_not_found();
- }
- $form['panels_node']['layout'] = array(
- '#type' => 'value',
- '#value' => $panel_layout,
- );
- }
Add Comment
Please, Sign In to add comment