You are here

class panels_display in Panels 6.2

Same name and namespace in other branches
  1. 8.3 panels.module \panels_display
  2. 5.2 panels.module \panels_display
  3. 6.3 panels.module \panels_display
  4. 7.3 panels.module \panels_display

Forms the basis of a panel display

Hierarchy

Expanded class hierarchy of panels_display

Related topics

2 string references to 'panels_display'
panels_mini_uninstall in panels_mini/panels_mini.install
Implementation of hook_uninstall().
panels_save_display in ./panels.module
Save a display object.

File

./panels.module, line 463
panels.module

View source
class panels_display {
  var $args = array();
  var $content = array();
  var $panels = array();
  var $incoming_content = NULL;
  var $css_id = NULL;
  var $context = array();
  var $layout_settings = array();
  var $panel_settings = array();
  var $cache = array();
  var $title = '';
  var $hide_title = 0;
  var $layout = '';
  function add_pane($pane, $location = FALSE) {
    $pane->pid = $this
      ->next_new_pid();
    if (!$location || !isset($this->panels[$location])) {
      foreach ($this->panels as $panel_name => $panel) {
        if (array_key_exists($pane->pid, $panel)) {
          $this->panels[$panel_name][] = $pane->pid;
        }
      }
    }
    else {
      $this->panels[$location][] = $pane->pid;
    }
  }
  function duplicate_pane($pid, $location = FALSE) {
    $pane = $this
      ->clone_pane($pid);
    $this
      ->add_pane($pane, $location);
  }
  function clone_pane($pid) {
    $pane = drupal_clone($this->content[$pid]);
    foreach (array_keys($this->content) as $pidcheck) {

      // necessary?
      unset($pane->position);
    }
    return $pane;
  }
  function next_new_pid() {

    // necessary if/until we use this method and ONLY this method for adding temporary pids.
    // then we can do it with a nice static var.
    $id = array(
      0,
    );
    foreach (array_keys($this->content) as $pid) {
      if (!is_numeric($pid)) {
        $id[] = substr($pid, 4);
      }
    }
    $next_id = end($id);
    return ++$next_id;
  }

}

Members