mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/ldap_groups_sync.git
synced 2026-03-10 10:27:40 -03:00
Move submódulos para modules/ seguindo convenção Drupal
ldap_departments_sync/ e ldap_research_groups_sync/ movidos para modules/, padrão adotado por módulos contrib como Drupal Commerce. Nenhum arquivo PHP ou YAML alterado — o Drupal descobre módulos recursivamente pelo .info.yml independente do caminho. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\ldap_research_groups_sync\Form;
|
||||
|
||||
use Drupal\ldap_groups_sync\Form\AccessRuleFormBase;
|
||||
|
||||
/**
|
||||
* Modal form for creating or editing a single access rule (Research Groups Sync).
|
||||
*/
|
||||
class AccessRuleForm extends AccessRuleFormBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getConfigName(): string {
|
||||
return 'ldap_research_groups_sync.settings';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFormId(): string {
|
||||
return 'ldap_research_groups_sync_access_rule_form';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getAccessRulesRoute(): string {
|
||||
return 'ldap_research_groups_sync.access_rules';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getDefaultGroupTypeId(): string {
|
||||
return 'research_group';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\ldap_research_groups_sync\Form;
|
||||
|
||||
use Drupal\ldap_groups_sync\Form\AccessRulesFormBase;
|
||||
|
||||
/**
|
||||
* Lists and manages access rules for the LDAP Research Groups Sync module.
|
||||
*/
|
||||
class AccessRulesForm extends AccessRulesFormBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getConfigName(): string {
|
||||
return 'ldap_research_groups_sync.settings';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFormId(): string {
|
||||
return 'ldap_research_groups_sync_access_rules_form';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getAccessRuleFormRoute(): string {
|
||||
return 'ldap_research_groups_sync.access_rule_form';
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
1212
modules/ldap_research_groups_sync/src/LdapResearchGroupsSync.php
Normal file
1212
modules/ldap_research_groups_sync/src/LdapResearchGroupsSync.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\ldap_research_groups_sync\Plugin\EntityReferenceSelection;
|
||||
|
||||
use Drupal\group\Plugin\EntityReferenceSelection\GroupSelection;
|
||||
|
||||
/**
|
||||
* Plugin for research group entity reference selection.
|
||||
*
|
||||
* Restricts selection to the 'research_group' group type.
|
||||
*
|
||||
* @EntityReferenceSelection(
|
||||
* id = "default:research_group",
|
||||
* label = @Translation("Research Group selection"),
|
||||
* entity_types = {"group"},
|
||||
* group = "default",
|
||||
* weight = 1
|
||||
* )
|
||||
*/
|
||||
class ResearchGroupSelection extends GroupSelection {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
|
||||
$query = parent::buildEntityQuery($match, $match_operator);
|
||||
$query->condition('type', 'research_group');
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user