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

Paramètres

$item:

Overrides QuickContent::__construct

Fichier

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

Classe

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