@trigger_error('Implementing '.__NAMESPACE__.'\TipPluginInterface without also implementing '.__NAMESPACE__.'\TourTipPluginInterface is deprecated in drupal:9.2.0. See https://www.drupal.org/node/3204096',E_USER_DEPRECATED);
}
}
/**
* {@inheritdoc}
*/
@@ -71,38 +49,6 @@ public function getWeight() {
return$this->get('weight');
}
/**
* {@inheritdoc}
*
* @todo remove in https://drupal.org/node/3195193
*/
publicfunctiongetAttributes(){
// This method is deprecated and rewritten to be as backwards compatible as
// possible with pre-existing uses. Due to the flexibility of tip plugins,
// this backwards compatibility can't be fully guaranteed. Because of this,
// we trigger a warning to caution the use of this function. This warning
// does not stop page execution, but will be logged.
trigger_error(__NAMESPACE__.'\TipPluginInterface::getAttributes is deprecated. Tour tip plugins should implement '.__NAMESPACE__.'\TourTipPluginInterface and Tour configs should use the \'selector\' property instead of \'attributes\' to target an element.',E_USER_WARNING);
// The _tour_update_joyride() updates the deprecated 'attributes' property
// to the current 'selector' property. It's possible that additional
// attributes not supported by Drupal core exist and these need to merged
// in.
$attributes=$this->get('attributes')?:[];
// Convert the selector property to the expected structure.
$selector=$this->get('selector');
$first_char=substr($selector,0,1);
if($first_char==='#'){
$attributes['data-id']=substr($selector,1);
}
elseif($first_char==='.'){
$attributes['data-class']=substr($selector,1);
}
return$attributes;
}
/**
* {@inheritdoc}
*/
@@ -119,30 +65,6 @@ public function set($key, $value) {
$this->configuration[$key]=$value;
}
/**
* This method should not be used. It is deprecated from TipPluginInterface.
*
* @return array
* An intentionally empty array.
*
* @todo remove in https://drupal.org/node/3195193
*/
publicfunctiongetOutput(){
// The getOutput() method was a requirement of TipPluginInterface, but was
// not part of TipPluginBase prior to it being deprecated. As a result, all
// tip plugins have their own implementations of getOutput() making it
// unlikely that this implementation will be called. If it does get called,
// however, the tour tip will have no content due to this method returning
// an empty array. To help tour tips from unexpectedly having no content, a
// warning is triggered. This warning does not stop page
// execution, but will be logged.
trigger_error(__NAMESPACE__.'TipPluginInterface::getOutput is deprecated. Use getBody() instead. See https://www.drupal.org/node/3204096',E_USER_WARNING);
// This class must implement TipPluginInterface, but this method is
// deprecated. An empty array is returned to meet interface requirements.
return[];
}
/**
* Determines the placement of the tip relative to the element.