Skip to content
Snippets Groups Projects
Commit fce98c83 authored by Oleksandr Tymoshchuk's avatar Oleksandr Tymoshchuk Committed by Kostia Bohach
Browse files

Issue #3336996: Add a proper READ.md file

parent 4a83d445
No related branches found
No related tags found
1 merge request!1Issue #3336996: Add a proper READ.md file
Showing with 32 additions and 32 deletions
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* @file * @file
* Describes hooks provided by the list_formatter module. * Describes hooks provided by the List module.
*/ */
/** /**
...@@ -15,7 +15,7 @@ function hook_list_formatter_field_info() { ...@@ -15,7 +15,7 @@ function hook_list_formatter_field_info() {
// key array with module name. // key array with module name.
$info['example'] = array( $info['example'] = array(
// An array of fields that list_formatter can be used on. Typically you // An array of fields that List can be used on. Typically you
// would add the name(s) of the fields you are integrating here. // would add the name(s) of the fields you are integrating here.
'fields' => array('example', 'example_other'), 'fields' => array('example', 'example_other'),
// Callback to process $items from hook_field_formatter_view, and format // Callback to process $items from hook_field_formatter_view, and format
......
...@@ -12,7 +12,7 @@ use Drupal\Core\Template\Attribute; ...@@ -12,7 +12,7 @@ use Drupal\Core\Template\Attribute;
*/ */
function list_formatter_help($path, $arg) { function list_formatter_help($path, $arg) {
switch ($path) { switch ($path) {
case 'admin/help#list_formatter' : case 'admin/help#List' :
$output = '<p>' . t("The text formatter module provides a new display formatter that can $output = '<p>' . t("The text formatter module provides a new display formatter that can
be used on any text, number, list, or taxonomy fields.") . '</p>'; be used on any text, number, list, or taxonomy fields.") . '</p>';
$output .= '<p>' . t("Go to 'Manage display' for your entity field display settings and $output .= '<p>' . t("Go to 'Manage display' for your entity field display settings and
...@@ -32,9 +32,9 @@ function list_formatter_help($path, $arg) { ...@@ -32,9 +32,9 @@ function list_formatter_help($path, $arg) {
* Implements hook_field_formatter_info_alter(). * Implements hook_field_formatter_info_alter().
*/ */
function list_formatter_field_formatter_info_alter(&$info) { function list_formatter_field_formatter_info_alter(&$info) {
$list_formatter_info = \Drupal::service('plugin.manager.list_formatter')->fieldListInfo(); $list_formatter_info = \Drupal::service('plugin.manager.List')->fieldListInfo();
$info['list_formatter']['field_types'] = $list_formatter_info['field_types']; $info['List']['field_types'] = $list_formatter_info['field_types'];
$info['list_formatter']['settings']['contrib'] = $list_formatter_info['settings']; $info['List']['settings']['contrib'] = $list_formatter_info['settings'];
} }
/** /**
...@@ -85,7 +85,7 @@ function theme_list_formatter_comma($variables) { ...@@ -85,7 +85,7 @@ function theme_list_formatter_comma($variables) {
// Optionally follow the list with a '.'. // Optionally follow the list with a '.'.
if ($formatter->getSetting('comma_full_stop')) { if ($formatter->getSetting('comma_full_stop')) {
$output .= '<span class="list_formatter-fullstop">.</span>'; $output .= '<span class="List-fullstop">.</span>';
} }
// Optionally wrap the list in an HTML tag. // Optionally wrap the list in an HTML tag.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\list_formatter\Plugin\field\formatter\List; * Definition of Drupal\List\Plugin\field\formatter\List;
*/ */
namespace Drupal\list_formatter\Plugin\Field\FieldFormatter; namespace Drupal\list_formatter\Plugin\Field\FieldFormatter;
...@@ -21,7 +21,7 @@ use Drupal\Component\Utility\Html; ...@@ -21,7 +21,7 @@ use Drupal\Component\Utility\Html;
* Plugin implementation of the 'text_default' formatter. * Plugin implementation of the 'text_default' formatter.
* *
* @FieldFormatter( * @FieldFormatter(
* id = "list_formatter", * id = "List",
* label = @Translation("List"), * label = @Translation("List"),
* field_types = {}, * field_types = {},
* ) * )
...@@ -45,7 +45,7 @@ class ListFormatter extends FormatterBase implements ContainerFactoryPluginInter ...@@ -45,7 +45,7 @@ class ListFormatter extends FormatterBase implements ContainerFactoryPluginInter
$configuration['label'], $configuration['label'],
$configuration['view_mode'], $configuration['view_mode'],
$configuration['third_party_settings'], $configuration['third_party_settings'],
$container->get('plugin.manager.list_formatter') $container->get('plugin.manager.List')
); );
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Contains .... * Contains ....
*/ */
namespace Drupal\list_formatter\Plugin\list_formatter; namespace Drupal\list_formatter\Plugin\List;
use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Field\FieldFilteredMarkup;
...@@ -18,13 +18,13 @@ use Drupal\list_formatter\Plugin\ListFormatterListInterface; ...@@ -18,13 +18,13 @@ use Drupal\list_formatter\Plugin\ListFormatterListInterface;
* *
* @ListFormatter( * @ListFormatter(
* id = "default", * id = "default",
* module = "list_formatter" * module = "List"
* ) * )
*/ */
class DefaultList implements ListFormatterListInterface { class DefaultList implements ListFormatterListInterface {
/** /**
* Implements \Drupal\list_formatter\Plugin\ListFormatterListInterface::createList(). * Implements \Drupal\List\Plugin\ListFormatterListInterface::createList().
*/ */
public function createList(FieldItemListInterface $items, FieldDefinitionInterface $field_definition, $langcode) { public function createList(FieldItemListInterface $items, FieldDefinitionInterface $field_definition, $langcode) {
$list_items = []; $list_items = [];
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Contains .... * Contains ....
*/ */
namespace Drupal\list_formatter\Plugin\list_formatter; namespace Drupal\list_formatter\Plugin\List;
use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Field\FieldFilteredMarkup;
use Drupal\list_formatter\Plugin\ListFormatterListInterface; use Drupal\list_formatter\Plugin\ListFormatterListInterface;
...@@ -28,7 +28,7 @@ use Drupal\Component\Utility\Html; ...@@ -28,7 +28,7 @@ use Drupal\Component\Utility\Html;
class EntityReferenceList implements ListFormatterListInterface { class EntityReferenceList implements ListFormatterListInterface {
/** /**
* Implements \Drupal\list_formatter\Plugin\ListFormatterListInterface::createList(). * Implements \Drupal\List\Plugin\ListFormatterListInterface::createList().
*/ */
public function createList(FieldItemListInterface $items, FieldDefinitionInterface $field_definition, $langcode) { public function createList(FieldItemListInterface $items, FieldDefinitionInterface $field_definition, $langcode) {
// Load the target type for the field instance. // Load the target type for the field instance.
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Contains .... * Contains ....
*/ */
namespace Drupal\list_formatter\Plugin\list_formatter; namespace Drupal\list_formatter\Plugin\List;
use Drupal\list_formatter\Plugin\ListFormatterListInterface; use Drupal\list_formatter\Plugin\ListFormatterListInterface;
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
...@@ -23,7 +23,7 @@ use Drupal\Core\Field\FormatterInterface; ...@@ -23,7 +23,7 @@ use Drupal\Core\Field\FormatterInterface;
class LinkList implements ListFormatterListInterface { class LinkList implements ListFormatterListInterface {
/** /**
* Implements \Drupal\list_formatter\Plugin\ListFormatterListInterface::createList(). * Implements \Drupal\List\Plugin\ListFormatterListInterface::createList().
*/ */
public function createList(FieldItemListInterface $items, FieldDefinitionInterface $field_definition, $langcode) { public function createList(FieldItemListInterface $items, FieldDefinitionInterface $field_definition, $langcode) {
$list_items = array(); $list_items = array();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @file * @file
*/ */
namespace Drupal\list_formatter\Plugin\list_formatter; namespace Drupal\list_formatter\Plugin\List;
/** /**
* Plugin implementation of the taxonomy module. * Plugin implementation of the taxonomy module.
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Contains \... * Contains \...
*/ */
namespace Drupal\list_formatter\Plugin\list_formatter; namespace Drupal\list_formatter\Plugin\List;
use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Field\FieldFilteredMarkup;
use Drupal\list_formatter\Plugin\ListFormatterListInterface; use Drupal\list_formatter\Plugin\ListFormatterListInterface;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @file * @file
*/ */
namespace Drupal\list_formatter\Plugin\list_formatter; namespace Drupal\list_formatter\Plugin\List;
use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Field\FieldFilteredMarkup;
use Drupal\list_formatter\Plugin\ListFormatterListInterface; use Drupal\list_formatter\Plugin\ListFormatterListInterface;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @file * @file
*/ */
namespace Drupal\list_formatter\Plugin\list_formatter; namespace Drupal\list_formatter\Plugin\List;
use Drupal\list_formatter\Plugin\ListFormatterListInterface; use Drupal\list_formatter\Plugin\ListFormatterListInterface;
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* @file * @file
* Contains \Drupal\list_formatter\Plugin\ListFormatterListInterface. * Contains \Drupal\List\Plugin\ListFormatterListInterface.
*/ */
namespace Drupal\list_formatter\Plugin; namespace Drupal\list_formatter\Plugin;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* @file * @file
* Contains \Drupal\list_formatter\Plugin\ListFormatterPluginManager. * Contains \Drupal\List\Plugin\ListFormatterPluginManager.
*/ */
namespace Drupal\list_formatter\Plugin; namespace Drupal\list_formatter\Plugin;
...@@ -31,7 +31,7 @@ class ListFormatterPluginManager extends DefaultPluginManager { ...@@ -31,7 +31,7 @@ class ListFormatterPluginManager extends DefaultPluginManager {
* The typed data manager. * The typed data manager.
*/ */
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/list_formatter', $namespaces, $module_handler, ListFormatterListInterface::class, 'Drupal\list_formatter\Annotation\ListFormatter'); parent::__construct('Plugin/List', $namespaces, $module_handler, ListFormatterListInterface::class, 'Drupal\list_formatter\Annotation\ListFormatter');
$this->alterInfo('field_info'); $this->alterInfo('field_info');
$this->setCacheBackend($cache_backend, 'list_formatter_plugins'); $this->setCacheBackend($cache_backend, 'list_formatter_plugins');
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* @file * @file
* Contains \Drupal\list_formatter\Tests\OutputTest. * Contains \Drupal\List\Tests\OutputTest.
*/ */
namespace Drupal\list_formatter\Tests; namespace Drupal\list_formatter\Tests;
...@@ -17,7 +17,7 @@ class OutputTest extends TestBase { ...@@ -17,7 +17,7 @@ class OutputTest extends TestBase {
public static function getInfo() { public static function getInfo() {
return array( return array(
'name' => 'Test list output', 'name' => 'Test list output',
'description' => 'Tests the output markup of list_formatter list formatters.', 'description' => 'Tests the output markup of List list formatters.',
'group' => 'List formatter', 'group' => 'List formatter',
); );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\list_formatter\Tests\TestBase. * Definition of Drupal\List\Tests\TestBase.
*/ */
namespace Drupal\list_formatter\Tests; namespace Drupal\list_formatter\Tests;
...@@ -10,7 +10,7 @@ namespace Drupal\list_formatter\Tests; ...@@ -10,7 +10,7 @@ namespace Drupal\list_formatter\Tests;
use Drupal\simpletest\WebTestBase; use Drupal\simpletest\WebTestBase;
/** /**
* Test base class for list_formatter tests. * Test base class for List tests.
*/ */
abstract class TestBase extends WebTestBase { abstract class TestBase extends WebTestBase {
...@@ -19,7 +19,7 @@ abstract class TestBase extends WebTestBase { ...@@ -19,7 +19,7 @@ abstract class TestBase extends WebTestBase {
* *
* @var array * @var array
*/ */
public static $modules = array('list_formatter', 'node', 'field', 'field_ui'); public static $modules = array('List', 'node', 'field', 'field_ui');
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
...@@ -47,7 +47,7 @@ abstract class TestBase extends WebTestBase { ...@@ -47,7 +47,7 @@ abstract class TestBase extends WebTestBase {
$display = array( $display = array(
'label' => 'above', 'label' => 'above',
'module' => 'list_formatter', 'module' => 'List',
'settings' => array( 'settings' => array(
'class' => 'list-formatter-list', 'class' => 'list-formatter-list',
'comma_and' => 0, 'comma_and' => 0,
...@@ -61,7 +61,7 @@ abstract class TestBase extends WebTestBase { ...@@ -61,7 +61,7 @@ abstract class TestBase extends WebTestBase {
'term_plain' => 0, 'term_plain' => 0,
'type' => 'ul', 'type' => 'ul',
), ),
'type' => 'list_formatter', 'type' => 'List',
'weight' => '10', 'weight' => '10',
); );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* @file * @file
* Definition of Drupal\list_formatter\Tests\UITest. * Definition of Drupal\List\Tests\UITest.
*/ */
namespace Drupal\list_formatter\Tests; namespace Drupal\list_formatter\Tests;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment