forked from drupal-media/entity_browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #2512702 by slashrsm, Lukas von Blarer, CTaPByK, EclipseGc: Imp…
…lement configuration UI
- Loading branch information
Showing
35 changed files
with
1,348 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ type: module | |
package: Media | ||
core: 8.x | ||
test_dependencies: | ||
- ctools | ||
- ctools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
media.bundle_add: | ||
route_name: media.bundle_add | ||
title: 'Add media bundle' | ||
appears_on: | ||
- entity.media_bundle.collection | ||
|
||
entity_browser.add: | ||
route_name: entity.entity_browser.add_form | ||
title: 'Add Entity browser' | ||
weight: 0 | ||
appears_on: | ||
- entity.entity_browser.collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
entity.entity_browser.collection: | ||
title: 'Entity browsers' | ||
parent: system.admin_config_content | ||
description: 'Manage entity browsers.' | ||
route_name: entity.entity_browser.collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Drupal\entity_browser\Controllers; | ||
|
||
use Drupal\Core\Controller\ControllerBase; | ||
use Drupal\Core\Url; | ||
|
||
/** | ||
* Returns markup for entity browser entity add/edit page if ctools is missing. | ||
*/ | ||
class CtoolsFallback extends ControllerBase { | ||
|
||
/** | ||
* Displays message about missing dependency on edit/add page. | ||
* | ||
* @return \Drupal\Core\Ajax\AjaxResponse | ||
* An Ajax response with a command for opening or closing the dialog | ||
* containing the edit form. | ||
*/ | ||
public function displayMessage() { | ||
return [ | ||
'#markup' => $this->t( | ||
'This form depends on <a href=":url">Chaos tool suite module</a>. Enable it and reload this page.', | ||
[':url' => Url::fromUri('https://drupal.org/project/ctools')->toString()] | ||
), | ||
]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Contains \Drupal\entity_browser\Controllers\EntityBrowserListBuilder. | ||
*/ | ||
|
||
namespace Drupal\entity_browser\Controllers; | ||
|
||
use Drupal\Core\Entity\EntityInterface; | ||
use Drupal\Core\Entity\EntityListBuilder; | ||
|
||
|
||
/** | ||
* Provides a list controller for entity browser. | ||
* | ||
* @ingroup entity_browser | ||
*/ | ||
class EntityBrowserListBuilder extends EntityListBuilder { | ||
|
||
/** | ||
* {@inheritdoc} | ||
* | ||
* Building the header and content lines for the entity browser list. | ||
* | ||
* Calling the parent::buildHeader() adds a column for the possible actions | ||
* and inserts the 'edit' and 'delete' links as defined for the entity type. | ||
*/ | ||
public function buildHeader() { | ||
$header['id'] = $this->t('ID'); | ||
$header['name'] = $this->t('Name'); | ||
return $header + parent::buildHeader(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function buildRow(EntityInterface $entity) { | ||
/* @var $entity \Drupal\entity_browser\Entity\EntityBrowser */ | ||
$row['id'] = $entity->id(); | ||
$row['name'] = $entity->label(); | ||
return $row + parent::buildRow($entity); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.