I'm trying to find out the current panel with php to integrate panels as context condition.

There was panels_page_get_current() but its not in panels and not in page_manager.
I really scanned code but couldn't find it out. The code is quite a lot of abstract :)

Comments

merlinofchaos’s picture

try panels_get_current_page_display()

Sadly that only works for the display. It's possible that the handler should have a similar function in page manager. Though the 'page' object isn't always in use so that one's a little harder. (system pages don't have a page object at all).

dawehner’s picture

I had found the function before, but it does not contain anything about the panel itself :(
I thought of using the did and load the panel with the did, but sadly i think for stuff like context its not unique enough.

No Panel-id or something like $panel->name is in the output of panels_get_current_page_display();
Perhaps i couldn't find the value

merlinofchaos’s picture

There isn't an owner->id set? If not that needs to be fixed.

dawehner’s picture

Thats all i get

panels_display::__set_state(array(
   'args' => 
  array (
  ),
   'content' => 
  array (
    12 => 
    stdClass::__set_state(array(
       'pid' => '12',
       'did' => '6',
       'panel' => 'center',
       'type' => 'custom',
       'subtype' => 'custom',
       'shown' => true,
       'access' => 
      array (
      ),
       'configuration' => 
      array (
        'title' => 'Text auf den Kopf stellen',
        'body' => 'dies ist ein text',
        'format' => '1',
      ),
       'cache' => 
      array (
      ),
       'style' => 
      array (
      ),
       'css' => 
      array (
      ),
       'extras' => 
      array (
      ),
       'position' => '0',
    )),
   'panels' => 
  array (
    'center' => 
    array (
      0 => '12',
    ),
  ),
   'incoming_content' => NULL,
   'css_id' => '',
   'context' => 
  array (
  ),
   'did' => '6',
   'layout' => 'flexible',
   'layout_settings' => 
  array (
    'items' => 
    array (
      'canvas' => 
      array (
        'type' => 'row',
        'contains' => 'column',
        'children' => 
        array (
          0 => 1,
          1 => 'main',
        ),
        'parent' => NULL,
      ),
      'main' => 
      array (
        'type' => 'column',
        'width' => '69.67990039560615',
        'width_type' => '%',
        'children' => 
        array (
          0 => 'main-row',
        ),
        'parent' => 'canvas',
      ),
      'main-row' => 
      array (
        'type' => 'row',
        'contains' => 'region',
        'children' => 
        array (
          0 => 'center',
          1 => 'testest',
        ),
        'parent' => 'main',
      ),
      'center' => 
      array (
        'type' => 'region',
        'title' => 'Center',
        'width' => '32.738780207134646',
        'width_type' => '%',
        'parent' => 'main-row',
      ),
      1 => 
      array (
        'type' => 'column',
        'width' => '30.32009960439384',
        'width_type' => '%',
        'parent' => 'canvas',
        'children' => 
        array (
        ),
    ),
  ),
   'panel_settings' => 
  array (
    'testest' => 
    array (
      'style' => 'tabs',
    ),
    'style_settings' => 
    array (
      'testest' => 
      array (
        'filling_tabs' => 'disabled',
      ),
    ),
  ),
   'cache' => 
  array (
  ),
   'title' => '',
   'hide_title' => '0',
))

There is no such entry

merlinofchaos’s picture

Status: Active » Fixed

There is now a page manager function for this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

albert volkman’s picture

Issue summary: View changes

For other internet searchers, I'm assuming the "page manager function for this" is-

http://www.drupalcontrib.org/api/drupal/contributions%21ctools%21page_ma...