X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Flinkit%2Fsrc%2FAttributeBase.php;fp=web%2Fmodules%2Fcontrib%2Flinkit%2Fsrc%2FAttributeBase.php;h=1fd9f0b0d17d69904cba73e0451fa45469180cd4;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/linkit/src/AttributeBase.php b/web/modules/contrib/linkit/src/AttributeBase.php new file mode 100644 index 000000000..1fd9f0b0d --- /dev/null +++ b/web/modules/contrib/linkit/src/AttributeBase.php @@ -0,0 +1,112 @@ +setConfiguration($configuration); + } + + /** + * {@inheritdoc} + */ + public function getConfiguration() { + return [ + 'id' => $this->getPluginId(), + 'weight' => $this->weight, + 'settings' => $this->configuration, + ]; + } + + /** + * {@inheritdoc} + */ + public function setConfiguration(array $configuration) { + $configuration += [ + 'weight' => '0', + 'settings' => [], + ]; + $this->configuration = $configuration['settings'] + $this->defaultConfiguration(); + $this->weight = $configuration['weight']; + return $this; + } + + /** + * {@inheritdoc} + */ + public function defaultConfiguration() { + return []; + } + + /** + * {@inheritdoc} + */ + public function calculateDependencies() { + return []; + } + + /** + * {@inheritdoc} + */ + public function getLabel() { + return $this->pluginDefinition['label']; + } + + /** + * {@inheritdoc} + */ + public function getHtmlName() { + return $this->pluginDefinition['html_name']; + } + + /** + * {@inheritdoc} + */ + public function getDescription() { + return $this->pluginDefinition['description']; + } + + /** + * {@inheritdoc} + */ + public function getWeight() { + return $this->weight; + } + + /** + * {@inheritdoc} + */ + public function setWeight($weight) { + $this->weight = $weight; + return $this; + } + +}