Same name in other branches
- 7.x-3.x plugins/QuickViewContent.inc \QuickViewContent::__construct()
Overrides QuickContent::__construct
Fichier
-
src/
Plugin/ QuickContent/ QuickViewContent.php, line 83
Classe
- QuickViewContent
- Class for tab content of type "view" - this is for rendering a view as tab content. @QuicktabFormat{ id = "quickviewcontent" }
Namespace
Drupal\quicktabs\Plugin\QuickContentCode
public function __construct($item) {
parent::__construct($item);
if (\Drupal::moduleHandler()->moduleExists('views')) {
views_add_js('ajax_view');
}
$this->settings['view_path'] = rawurlencode($_GET['q']);
$this->settings['view_dom_id'] = self::$view_dom_id++;
$args_array = array();
$ajax_args = '';
if (isset($item['args'])) {
$url_args = arg();
$args = $item['args'];
foreach ($url_args as $id => $arg) {
$args = str_replace("%{$id}", $arg, $args);
}
$args = preg_replace(',/?(%\\d),', '', $args);
if (!empty($args)) {
$ajax_args = rawurlencode($args);
$args_array = explode('/', $args);
}
}
$this->settings['ajax_args'] = $ajax_args;
$this->settings['actual_args'] = $args_array;
}