Same name and namespace in other branches
  1. 7.x-3.x plugins/QuickCallbackContent.inc \QuickCallbackContent::__construct()

Parameters

$item:

Overrides QuickContent::__construct

File

src/Plugin/QuickContent/QuickCallbackContent.php, line 34

Class

QuickCallbackContent
Class for tab content of type "callback" - this is for rendering the contents of some menu callback function as tab content. @QuicktabFormat{ id = "quickcallbackcontent"

Namespace

Drupal\quicktabs\Plugin\QuickContent

Code

public function __construct($item) {
    parent::__construct($item);
    if (isset($item['path'])) {
        $url_args = arg();
        $path = $item['path'];
        foreach ($url_args as $id => $arg) {
            $path = str_replace("%{$id}", $arg, $path);
        }
        $path = preg_replace(',/?(%\\d),', '', $path);
        if (!empty($path)) {
            $this->settings['ajax_path'] = rawurlencode($path);
        }
        else {
            $this->settings['ajax_path'] = '';
        }
        $this->settings['actual_path'] = $path;
    }
}