forked from Patt92/Workin2Gether
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
127 additions
and
92 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
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,52 @@ | ||
<?php | ||
|
||
namespace OCA\w2g2\AppInfo; | ||
|
||
use OCP\AppFramework\App; | ||
use OCA\w2g2\Notification\Notifier; | ||
|
||
class Application extends App | ||
{ | ||
const name = 'w2g2'; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(self::name); | ||
} | ||
|
||
public function boot() | ||
{ | ||
if ( ! \OC::$server->getAppManager()->isEnabledForUser(self::name)) { | ||
return; | ||
} | ||
|
||
$this->registerHooks(); | ||
$this->registerScripts(); | ||
} | ||
|
||
public function registerHooks() | ||
{ | ||
$notificationManager = \OC::$server->getNotificationManager(); | ||
$notificationManager->registerNotifier( | ||
function() { | ||
$Application = new \OCP\AppFramework\App('w2g2'); | ||
|
||
return $Application->getContainer()->query(Notifier::class); | ||
}, | ||
function () { | ||
$l = \OC::$server->getL10N('w2g2'); | ||
|
||
return ['id' => 'w2g2', 'name' => $l->t('w2g2')]; | ||
} | ||
); | ||
} | ||
|
||
public function registerScripts() | ||
{ | ||
$eventDispatcher = \OC::$server->getEventDispatcher(); | ||
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', function() { | ||
script(self::name, 'w2g2'); | ||
style(self::name, 'styles'); | ||
}); | ||
} | ||
} |
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
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