Skip to content

Commit 6aac8ba

Browse files
committed
added: support for post_as plugin
1 parent 82379f6 commit 6aac8ba

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

classes/ColdTrick/EventManager/Bootstrap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public function init() {
2323
elgg_register_event_handler('supported_types', 'entity_tools', '\ColdTrick\EventManager\MigrateEvents::supportedSubtypes');
2424
}
2525

26+
if (elgg_is_active_plugin('post_as')) {
27+
elgg_extend_view('forms/event_manager/event/tabs/profile', 'post_as/input');
28+
}
29+
2630
// leafletjs
2731
elgg_register_esm('leafletjs', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js');
2832
elgg_register_external_file('css', 'leafletjs', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css', 'head');
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace ColdTrick\EventManager\Plugins;
4+
5+
/**
6+
* Support for post_as plugin
7+
*/
8+
class PostAs {
9+
10+
/**
11+
* Register post_as support for events
12+
*
13+
* @param \Elgg\Event $event 'config', 'post_as'
14+
*
15+
* @return array
16+
*/
17+
public static function addConfig(\Elgg\Event $event): array {
18+
$result = $event->getValue();
19+
20+
$result['event_manager/event/edit'] = [
21+
'type' => 'object',
22+
'subtype' => \Event::SUBTYPE,
23+
'extend_form' => false,
24+
];
25+
26+
return $result;
27+
}
28+
}

elgg-plugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@
265265
],
266266
],
267267
'events' => [
268+
'config' => [
269+
'post_as' => [
270+
'\ColdTrick\EventManager\Plugins\PostAs::addConfig' => [],
271+
],
272+
],
268273
'container_logic_check' => [
269274
'object' => [
270275
\ColdTrick\EventManager\GroupToolContainerLogicCheck::class => [],

0 commit comments

Comments
 (0)