commit 89ab2f75ecfa985f0f7a5b64cd7448718290f54d Author: fago Date: Sun Jun 30 12:07:56 2013 +0200 Filter fixes. diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/DataType/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Plugin/DataType/FilterFormat.php new file mode 100644 index 0000000..c8ff730 --- /dev/null +++ b/core/modules/filter/lib/Drupal/filter/Plugin/DataType/FilterFormat.php @@ -0,0 +1,63 @@ +getPossibleOptions()); + } + + /** + * {@inheritdoc} + */ + public function getPossibleOptions($account = NULL) { + $values = array(); + foreach (filter_formats() as $format) { + $values[$format->id()] = $format->label(); + } + return $values; + } + + /** + * {@inheritdoc} + */ + public function getValues($account = NULL) { + return array_keys($this->getOptions($account)); + } + + /** + * {@inheritdoc} + */ + public function getOptions($user = NULL) { + $user = empty($user) ? $GLOBALS['user'] : $user; + $values = array(); + // @todo: Avoid calling functions but move to injected dependencies. + foreach (filter_formats($user) as $format) { + $values[$format->id()] = $format->label(); + } + return $values; + } +} diff --git a/core/modules/filter/lib/Drupal/filter/Type/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Type/FilterFormat.php deleted file mode 100644 index c3fc852..0000000 --- a/core/modules/filter/lib/Drupal/filter/Type/FilterFormat.php +++ /dev/null @@ -1,55 +0,0 @@ -getPossibleOptions()); - } - - /** - * {@inheritdoc} - */ - public function getPossibleOptions($account = NULL) { - $values = array(); - foreach (filter_formats() as $format) { - $values[$format->id()] = $format->label(); - } - return $values; - } - - /** - * {@inheritdoc} - */ - public function getValues($account = NULL) { - return array_keys($this->getOptions($account)); - } - - /** - * {@inheritdoc} - */ - public function getOptions($user = NULL) { - $user = empty($user) ? $GLOBALS['user'] : $user; - $values = array(); - // @todo: Avoid calling functions but move to injected dependencies. - foreach (filter_formats($user) as $format) { - $values[$format->id()] = $format->label(); - } - return $values; - } -}