34 if (isset($_POST[
'op'])) {
35 $op = trim($_POST[
'op']);
37 if (isset($_GET[
'op'])) {
38 $op = trim($_GET[
'op']);
41 if (isset($_POST[
'delete'])) {
44 if (isset($_GET[
'delete'])) {
48 if (isset($_POST[
'delete_ok'])) {
51 if (isset($_POST[
'delete_cancel'])) {
58 $xoops->redirect(
'index.php');
68 $criteria->setSort(
'modid,category,itemid');
78 $modulesObj = array();
79 foreach ($notifications as $n) {
81 $modid = $n->getVar(
'modid');
82 if (
$modid != $prev_modid) {
89 'id' =>
$modid,
'name' =>
$module->getVar(
'name'),
'categories' => array()
101 $category = $n->getVar(
'category');
102 if ($category != $prev_category) {
103 $category_info = array();
104 $prev_category = $category;
106 $category_info =
$helper->getCategory($category, $modulesObj[
$modid]->getVar(
'dirname'));
108 'name' => $category,
'title' => $category_info[
'title'],
'items' => array()
111 $item = $n->getVar(
'itemid');
112 if ($item != $prev_item) {
115 $item_info =
$helper->getItem($category, $item, $modulesObj[
$modid]->getVar(
'dirname'));
116 $modules[
$modid][
'categories'][$category][
'items'][$item] = array(
117 'id' => $item,
'name' => $item_info[
'name'],
'url' => $item_info[
'url'],
'notifications' => array()
120 $event_info =
$helper->getEvent($category, $n->getVar(
'event'), $modulesObj[$n->getVar(
'modid')]->getVar(
'dirname'));
121 $modules[
$modid][
'categories'][$category][
'items'][$item][
'notifications'][] = array(
122 'id' => $n->getVar(
'id'),
'module_id' => $n->getVar(
'modid'),
123 'category' => $n->getVar(
'category'),
'category_title' => $category_info[
'title'],
124 'item_id' => $n->getVar(
'itemid'),
'event' => $n->getVar(
'event'),
125 'event_title' => $event_info[
'title'],
'user_id' => $n->getVar(
'uid')
128 $xoops->header(
'module:notifications/list.tpl');
130 $user_info = array(
'uid' =>
$xoops->user->getVar(
'uid'));
131 $xoops->tpl()->assign(
'user', $user_info);
143 $xoops->tpl()->assign(
'notification_token',
$xoops->security()->createToken());
160 if (empty($_POST[
'del_not'])) {
164 $hidden_vars = array(
165 'uid' =>
$uid,
'delete_ok' => 1,
'del_not' => $_POST[
'del_not']
176 if (!
$xoops->security()->check()) {
177 $helper->redirect(
'index.php', 2, implode(
'<br />',
$xoops->security()->getErrors()));
179 if (empty($_POST[
'del_not'])) {
183 foreach ($_POST[
'del_not'] as $n_array) {
184 foreach ($n_array as $n) {
186 if ($notification->getVar(
'uid') ==
$uid) {
const _MD_NOTIFICATIONS_RUSUREDEL
const _MD_NOTIFICATIONS_ITEMNAME
const _MD_NOTIFICATIONS_ACTIVENOTIFICATIONS
const _MD_NOTIFICATIONS_DELETESUCCESS
defined('DS') or define('DS' DIRECTORY_SEPARATOR
const _MD_NOTIFICATIONS_EVENTS
const _MD_NOTIFICATIONS_NOTHINGTODELETE
const _MD_NOTIFICATIONS_CLEAR
const _MD_NOTIFICATIONS_NOACCESS
if(!$xoops->isUser()) $uid
const _MD_NOTIFICATIONS_EVENT
const _MD_NOTIFICATIONS_ITEMID
const _MD_NOTIFICATIONS_MODULE
const _MD_NOTIFICATIONS_DELETINGNOTIFICATIONS
const _MD_NOTIFICATIONS_CHECKALL
const _MD_NOTIFICATIONS_CATEGORY
if(file_exists($mainfile)) elseif(file_exists(__DIR__. '/install/index.php')) $xoops