Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Revert "hide add user option from overview page"
Browse files Browse the repository at this point in the history
This reverts commit 938c4c9.
  • Loading branch information
Lucas D Hedding committed Aug 10, 2018
1 parent 09ac635 commit 11e0163
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 251 deletions.
3 changes: 0 additions & 3 deletions og.links.action.yml

This file was deleted.

20 changes: 0 additions & 20 deletions src/Controller/OgAdminMembersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\og\Entity\OgMembership;
use Drupal\og\OgMembershipInterface;
use Drupal\views\Views;

/**
Expand All @@ -32,22 +30,4 @@ public function membersList(RouteMatchInterface $route_match) {
return Views::getView('og_members_overview')->executeDisplay('default', $arguments);
}

/**
* Display subscribe form.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match service.
*
* @return array
* The subscribe form.
*/
public function addMember(RouteMatchInterface $route_match) {
$parameter_name = $route_match->getRouteObject()->getOption('_og_entity_type_id');
/** @var \Drupal\Core\Entity\EntityInterface $group */
$group = $route_match->getParameter($parameter_name);
$membership = OgMembership::create(['type' => OgMembershipInterface::TYPE_DEFAULT]);
$membership->setGroup($group);
return $this->entityFormBuilder()->getForm($membership, 'user-subscribe');
}

}
5 changes: 0 additions & 5 deletions src/Controller/OgAdminRoutesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ public function overview(RouteMatchInterface $route_match) {
$route_name = "entity.$entity_type_id.og_admin_routes.$name";
$parameters = [$entity_type_id => $group->id()];

// Don't list items that are intentionally hidden from the overview.
if (array_intersect_assoc(['_overview' => FALSE], $info)) {
continue;
}

// We don't use Url::fromRoute() here for the access check, as it will
// prevent us from unit testing this method.
if (!$this->accessManager->checkNamedRoute($route_name, $parameters)) {
Expand Down
1 change: 0 additions & 1 deletion src/Entity/OgMembership.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
* "views_data" = "Drupal\og\OgMembershipViewsData",
* "form" = {
* "subscribe" = "Drupal\og\Form\GroupSubscribeForm",
* "user-subscribe" = "Drupal\og\Form\GroupUserSubscribeForm",
* "unsubscribe" = "Drupal\og\Form\GroupUnsubscribeConfirmForm",
* },
* }
Expand Down
10 changes: 0 additions & 10 deletions src/EventSubscriber/OgEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,6 @@ public function provideOgAdminRoutes(OgAdminRoutesEventInterface $event) {
'_module_dependencies' => 'views',
],
];
$routes_info['add_member'] = [
'controller' => '\Drupal\og\Controller\OgAdminMembersController::addMember',
'title' => 'Add Member',
'description' => 'Add group membership',
'path' => 'add-member',
'requirements' => [
'_og_user_access_group' => 'administer group',
],
'_overview' => FALSE,
];

$event->setRoutesInfo($routes_info);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Form/GroupSubscribeForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function getQuestion() {

$message = $this->isStateActive()
? $this->t('Are you sure you want to join the group %label?', ['%label' => $label])
: $this->t('Are you sure you want to request a subscription to the group %label?', ['%label' => $label]);
: $this->t('Are you sure you want to request subscription the group %label?', ['%label' => $label]);

return $message;
}
Expand Down
127 changes: 0 additions & 127 deletions src/Form/GroupUserSubscribeForm.php

This file was deleted.

84 changes: 0 additions & 84 deletions src/Plugin/Derivative/OgLocalAction.php

This file was deleted.

0 comments on commit 11e0163

Please sign in to comment.