33 $path = dirname(__DIR__);
35 'notifications' =>
$path .
'/class/helper.php',
44 $notifications = array();
45 $notifications[
'show'] =
$xoops->isModule() &&
$xoops->isUser() &&
$helper->enabled(
'inline') ? 1 : 0;
46 if ($notifications[
'show']) {
48 $categories =
$helper->getSubscribableCategories();
50 if (!empty($categories)) {
52 foreach ($categories as $category) {
53 $section[
'name'] = $category[
'name'];
54 $section[
'title'] = $category[
'title'];
55 $section[
'description'] = $category[
'description'];
56 $section[
'itemid'] = $category[
'item_id'];
57 $section[
'events'] = array();
58 $subscribed_events =
$notification_handler->getSubscribedEvents($category[
'name'], $category[
'item_id'],
$xoops->module->getVar(
'mid'),
$xoops->user->getVar(
'uid'));
59 foreach (
$helper->getEvents($category[
'name'],
true,
$xoops->module->getVar(
'dirname')) as $event) {
60 if (!empty($event[
'admin_only']) && !
$xoops->user->isAdmin(
$xoops->module->getVar(
'mid'))) {
63 if (!empty($event[
'invisible'])) {
66 $subscribed = in_array($event[
'name'], $subscribed_events) ? 1 : 0;
67 $section[
'events'][$event[
'name']] = array(
68 'name' => $event[
'name'],
69 'title' => $event[
'title'],
70 'caption' => $event[
'caption'],
71 'description' => $event[
'description'],
72 'subscribed' => $subscribed
76 $notifications[
'categories'][$category[
'name']] = $section;
78 $notifications[
'target_page'] =
$helper->url(
'update.php');
79 $notifications[
'mid'] =
$xoops->module->getVar(
'mid');
80 $notifications[
'redirect_script'] =
$xoops->getEnv(
'PHP_SELF');
81 $xoops->tpl()->assign(array(
92 'editprofile_url' => XOOPS_URL .
'/edituser.php?uid=' .
$xoops->user->getVar(
'uid')
94 switch (
$xoops->user->getVar(
'notify_method')) {
95 case NOTIFICATIONS_METHOD_DISABLE:
98 case NOTIFICATIONS_METHOD_PM:
101 case NOTIFICATIONS_METHOD_EMAIL:
106 $notifications[
'show'] = 0;
108 if ($event_count == 0) {
109 $notifications[
'show'] = 0;
112 $xoops->tpl()->assign(
'notifications', $notifications);
122 if ($plugin = \
Xoops\Module\Plugin::getPlugin(
$module->getVar(
'dirname'),
'notifications',
true)) {
124 foreach ($notConfigs as $notConfig) {
134 if ($plugin = \
Xoops\Module\Plugin::getPlugin(
$module->getVar(
'dirname'),
'notifications',
true)) {
143 if ($plugin = \
Xoops\Module\Plugin::getPlugin(
$module->getVar(
'dirname'),
'notifications')) {
152 if ($plugin = \
Xoops\Module\Plugin::getPlugin(
$module->getVar(
'dirname'),
'notifications')) {
static eventOnModuleUpdateConfigs($args)
const _MD_NOTIFICATIONS_UPDATEOPTIONS
static eventOnSystemPreferencesForm($args)
const _MD_NOTIFICATIONS_EMAIL
static eventCoreFooterStart($args)
const _MD_NOTIFICATIONS_PM
const _MD_NOTIFICATIONS_ACTIVENOTIFICATIONS
const _MD_NOTIFICATIONS_UPDATENOW
const _MD_NOTIFICATIONS_NOTIFICATIONMETHODIS
const _MD_NOTIFICATIONS_EVENTS
const _MD_NOTIFICATIONS_NOTIFICATIONOPTIONS
static eventCoreIncludeCommonClassmaps($args)
const _MD_NOTIFICATIONS_CHANGE
const _MD_NOTIFICATIONS_EVENT
const _MD_NOTIFICATIONS_DISABLE
static eventCoreIncludeCheckloginSuccess()
static eventOnModuleInstallConfigs($args)
static addMap(array $map)
static eventOnModuleUnistall($args)
const _MD_NOTIFICATIONS_CHECKALL
const _MD_NOTIFICATIONS_CATEGORY