X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffilter%2Fsrc%2FFilterFormatInterface.php;fp=web%2Fcore%2Fmodules%2Ffilter%2Fsrc%2FFilterFormatInterface.php;h=6008f3fa4002133de6bfa42416808be505bd855e;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/filter/src/FilterFormatInterface.php b/web/core/modules/filter/src/FilterFormatInterface.php new file mode 100644 index 000000000..6008f3fa4 --- /dev/null +++ b/web/core/modules/filter/src/FilterFormatInterface.php @@ -0,0 +1,90 @@ +filters, + * and if instantiated already, also ensures that the actual filter plugin on + * the FilterPluginCollection contains the identical configuration. + * + * @param string $instance_id + * The ID of a filter plugin to set the configuration for. + * @param array $configuration + * The filter plugin configuration to set. + */ + public function setFilterConfig($instance_id, array $configuration); + + /** + * Returns if this format is the fallback format. + * + * The fallback format can never be disabled. It must always be available. + * + * @return bool + * TRUE if this format is the fallback format, FALSE otherwise. + */ + public function isFallbackFormat(); + + /** + * Returns the machine-readable permission name for the text format. + * + * @return string|bool + * The machine-readable permission name, or FALSE if the text format is + * malformed or is the fallback format (which is available to all users). + */ + public function getPermissionName(); + + /** + * Retrieves all filter types that are used in the text format. + * + * @return array + * All filter types used by filters of the text format. + */ + public function getFilterTypes(); + + /** + * Retrieve all HTML restrictions (tags and attributes) for the text format. + * + * Note that restrictions applied to the "*" tag (the wildcard tag, i.e. all + * tags) are treated just like any other HTML tag. That means that any + * restrictions applied to it are not automatically applied to all other tags. + * It is up to the caller to handle this in whatever way it sees fit; this way + * no information granularity is lost. + * + * @return array|false + * A structured array as returned by FilterInterface::getHTMLRestrictions(), + * but with the intersection of all filters in this text format. + * Will either indicate blacklisting of tags or whitelisting of tags. In + * the latter case, it's possible that restrictions on attributes are also + * stored. FALSE means there are no HTML restrictions. + */ + public function getHtmlRestrictions(); + + /** + * Removes a filter. + * + * @param string $instance_id + * The ID of a filter plugin to be removed. + */ + public function removeFilter($instance_id); + +}