You are here

public function QuickSet::__construct in Quick Tabs 7.3

Constructor

File

./quicktabs.classes.inc, line 128

Class

QuickSet
A QuickSet object is an unrendered Quicktabs instance, essentially just a container of content items, as defined by its configuration settings and the array of content items it contains.

Code

public function __construct($name, $contents, $settings) {
  $this->name = $name;
  $this->contents = array();
  foreach ($contents as $key => $item) {

    // Instantiate a content renderer object and add it to the contents array.
    if ($renderer = self::getContentRenderer($item)) {
      $this->contents[$key] = $renderer;
    }
  }
  $default_settings = self::getDefaultSettings();
  $this->settings = array_merge($default_settings, $settings);
  $this
    ->prepareContents();

  // Set the default style if necessary.
  if ($this->settings['style'] == 'default') {
    $this->settings['style'] = variable_get('quicktabs_tabstyle', 'nostyle');
  }
}