Same name in other branches
  1. 8.x-1.x src/Plugin/QuickContent/QuickCallbackContent.php \Drupal\quicktabs\Plugin\QuickContent\QuickCallbackContent::__construct()

Overrides QuickContent::__construct

Fichier

plugins/QuickCallbackContent.inc, line 13

Classe

QuickCallbackContent
Class for tab content of type "callback" - this is for rendering the contents of some menu callback function as tab content.

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;
    }
}