32 }
else if (isset(
$_GET[
'op'])) {
35 if (isset(
$_POST[
'delete'])) {
37 }
else if (isset(
$_GET[
'delete'])) {
40 if (isset(
$_POST[
'delete_ok'])) {
43 if (isset(
$_POST[
'delete_cancel'])) {
60 $criteria->setSort(
'not_modid,not_category,not_itemid');
66 include_once
$GLOBALS[
'xoops']->path(
'include/notification_functions.php');
71 foreach ($notifications as $n) {
72 $modid = $n->getVar(
'not_modid');
73 if (
$modid != $prev_modid) {
80 'name' =>
$module->getVar(
'name') ,
81 'categories' => array());
91 $not_config =
$module->getInfo(
'notification');
93 if (! empty($not_config[
'lookup_file'])) {
94 $lookup_file =
$GLOBALS[
'xoops']->path(
'modules/' .
$module->getVar(
'dirname') .
'/' . $not_config[
'lookup_file']);
95 if (file_exists($lookup_file)) {
96 include_once $lookup_file;
97 if (! empty($not_config[
'lookup_func']) && function_exists($not_config[
'lookup_func'])) {
98 $lookup_func = $not_config[
'lookup_func'];
103 $category = $n->getVar(
'not_category');
104 if ($category != $prev_category) {
105 $prev_category = $category;
108 $modules[
$modid][
'categories'][$category] = array(
109 'name' => $category ,
110 'title' => $category_info[
'title'] ,
113 $item = $n->getVar(
'not_itemid');
114 if ($item != $prev_item) {
116 if (! empty($lookup_func)) {
117 $item_info = $lookup_func($category, $item);
123 $modules[
$modid][
'categories'][$category][
'items'][$item] = array(
125 'name' => $item_info[
'name'] ,
126 'url' => $item_info[
'url'] ,
127 'notifications' => array());
130 $modules[
$modid][
'categories'][$category][
'items'][$item][
'notifications'][] = array(
131 'id' => $n->getVar(
'not_id') ,
132 'module_id' => $n->getVar(
'not_modid') ,
133 'category' => $n->getVar(
'not_category') ,
134 'category_title' => $category_info[
'title'] ,
135 'item_id' => $n->getVar(
'not_itemid') ,
136 'event' => $n->getVar(
'not_event') ,
137 'event_title' => $event_info[
'title'] ,
138 'user_id' => $n->getVar(
'not_uid'));
140 $xoopsOption[
'template_main'] =
'system_notification_list.html';
141 include
$GLOBALS[
'xoops']->path(
'header.php');
143 $user_info = array(
'uid' =>
$xoopsUser->getVar(
'uid'));
156 $xoopsTpl->assign(
'notification_token',
$GLOBALS[
'xoopsSecurity']->createToken());
157 include
$GLOBALS[
'xoops']->path(
'footer.php');
173 if (empty(
$_POST[
'del_not'])) {
176 include
$GLOBALS[
'xoops']->path(
'header.php');
177 $hidden_vars = array(
180 'del_not' =>
$_POST[
'del_not']);
183 include
$GLOBALS[
'xoops']->path(
'footer.php');
190 if (!
$GLOBALS[
'xoopsSecurity']->check()) {
193 if (empty(
$_POST[
'del_not'])) {
197 foreach (
$_POST[
'del_not'] as $n_array) {
198 foreach ($n_array as $n) {
200 if ($notification->getVar(
'not_uid') ==
$uid) {