@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @version $Id$ |
19 | 19 | */ |
20 | 20 | |
21 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
21 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
22 | 22 | |
23 | 23 | $xoops = Xoops::getInstance(); |
24 | 24 | $helper = Notifications::getInstance(); |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | $first_arg = 1; |
95 | 95 | foreach (array_keys($redirect_args) as $arg) { |
96 | 96 | if ($first_arg) { |
97 | - $argstring .= "?" . $arg . "=" . $redirect_args[$arg]; |
|
97 | + $argstring .= "?".$arg."=".$redirect_args[$arg]; |
|
98 | 98 | $first_arg = 0; |
99 | 99 | } else { |
100 | - $argstring .= "&" . $arg . "=" . $redirect_args[$arg]; |
|
100 | + $argstring .= "&".$arg."=".$redirect_args[$arg]; |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | -$xoops->redirect($_POST['not_redirect'] . $argstring, 3, _MD_NOTIFICATIONS_UPDATEOK); |
|
104 | +$xoops->redirect($_POST['not_redirect'].$argstring, 3, _MD_NOTIFICATIONS_UPDATEOK); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @author trabis <[email protected]> |
17 | 17 | */ |
18 | 18 | |
19 | -include __DIR__ . '/header.php'; |
|
19 | +include __DIR__.'/header.php'; |
|
20 | 20 | |
21 | 21 | $xoops = Xoops::getInstance(); |
22 | 22 | $xoops->header(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $path = dirname(__DIR__); |
39 | 39 | XoopsLoad::addMap(array( |
40 | - 'notifications' => $path . '/class/helper.php', |
|
40 | + 'notifications' => $path.'/class/helper.php', |
|
41 | 41 | )); |
42 | 42 | } |
43 | 43 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'lang_checkall' => _MD_NOTIFICATIONS_CHECKALL, |
95 | 95 | 'lang_notificationmethodis' => _MD_NOTIFICATIONS_NOTIFICATIONMETHODIS, |
96 | 96 | 'lang_change' => _MD_NOTIFICATIONS_CHANGE, |
97 | - 'editprofile_url' => XOOPS_URL . '/edituser.php?uid=' . $xoops->user->getVar('uid') |
|
97 | + 'editprofile_url' => XOOPS_URL.'/edituser.php?uid='.$xoops->user->getVar('uid') |
|
98 | 98 | )); |
99 | 99 | switch ($xoops->user->getVar('notify_method')) { |
100 | 100 | case NOTIFICATIONS_METHOD_DISABLE: |
@@ -85,6 +85,6 @@ |
||
85 | 85 | //added on 2.6.0 |
86 | 86 | define('_MD_NOTIFICATIONS_RUSUREDEL', 'Are you sure you want to delete this notification?'); |
87 | 87 | |
88 | -define("_MD_NOTIFICATIONS_DELETE","Deleting notifications..."); |
|
89 | -define("_MD_NOTIFICATIONS_DELETE_ERROR","ERROR: Could not delete notifications"); |
|
90 | -define("_MD_NOTIFICATIONS_DELETED","Notifications deleted"); |
|
88 | +define("_MD_NOTIFICATIONS_DELETE", "Deleting notifications..."); |
|
89 | +define("_MD_NOTIFICATIONS_DELETE_ERROR", "ERROR: Could not delete notifications"); |
|
90 | +define("_MD_NOTIFICATIONS_DELETED", "Notifications deleted"); |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | |
231 | 231 | foreach ($events as $event) { |
232 | 232 | if ($event['category'] == $category_name) { |
233 | - if (!is_dir($dir = \XoopsBaseConfig::get('root-path') . '/modules/' . $dirname . '/locale/' . $xoops->getConfig('locale') . '/templates/')) { |
|
234 | - $dir = \XoopsBaseConfig::get('root-path') . '/modules/' . $dirname . '/locale/en_US/templates/'; |
|
233 | + if (!is_dir($dir = \XoopsBaseConfig::get('root-path').'/modules/'.$dirname.'/locale/'.$xoops->getConfig('locale').'/templates/')) { |
|
234 | + $dir = \XoopsBaseConfig::get('root-path').'/modules/'.$dirname.'/locale/en_US/templates/'; |
|
235 | 235 | } |
236 | 236 | $event['mail_template_dir'] = $dir; |
237 | 237 | if (!$enabled_only || $this->eventEnabled($category, $event, $dirname)) { |
@@ -253,11 +253,11 @@ discard block |
||
253 | 253 | // Insert comment info if applicable |
254 | 254 | |
255 | 255 | /* @var $commentsPlugin CommentsPluginInterface */ |
256 | - if (false!==$commentHelper && $commentsPlugin = \Xoops\Module\Plugin::getPlugin($dirname, 'comments')) { |
|
256 | + if (false !== $commentHelper && $commentsPlugin = \Xoops\Module\Plugin::getPlugin($dirname, 'comments')) { |
|
257 | 257 | //todo replace this |
258 | 258 | if (!empty($category['item_name']) && $category['item_name'] == $commentsPlugin->itemName()) { |
259 | - if (!is_dir($dir = \XoopsBaseConfig::get('root-path') . '/locale/' . $xoops->getConfig('locale') . '/templates/')) { |
|
260 | - $dir = \XoopsBaseConfig::get('root-path') . '/locale/en_US/templates/'; |
|
259 | + if (!is_dir($dir = \XoopsBaseConfig::get('root-path').'/locale/'.$xoops->getConfig('locale').'/templates/')) { |
|
260 | + $dir = \XoopsBaseConfig::get('root-path').'/locale/en_US/templates/'; |
|
261 | 261 | } |
262 | 262 | $mail_template_dir = $dir; |
263 | 263 | |
@@ -466,10 +466,10 @@ discard block |
||
466 | 466 | switch ($type) { |
467 | 467 | case 'option_value': |
468 | 468 | case 'name': |
469 | - return 'notify:' . $category['name'] . '-' . $event['name']; |
|
469 | + return 'notify:'.$category['name'].'-'.$event['name']; |
|
470 | 470 | break; |
471 | 471 | case 'option_name': |
472 | - return $category['name'] . '-' . $event['name']; |
|
472 | + return $category['name'].'-'.$event['name']; |
|
473 | 473 | break; |
474 | 474 | default: |
475 | 475 | return false; |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | //Delete all configs |
535 | 535 | $criteria = new CriteriaCompo(); |
536 | 536 | $criteria->add(new Criteria('conf_modid', $module->getVar('mid'))); |
537 | - $criteria->add(new Criteria('conf_name', "('" . implode("','", $configNames) . "')", 'IN')); |
|
537 | + $criteria->add(new Criteria('conf_name', "('".implode("','", $configNames)."')", 'IN')); |
|
538 | 538 | $configs = $config_handler->getConfigs($criteria); |
539 | 539 | /* @var $config XoopsConfigItem */ |
540 | 540 | foreach ($configs as $config) { |
@@ -574,8 +574,8 @@ discard block |
||
574 | 574 | if (!empty($event['invisible'])) { |
575 | 575 | continue; |
576 | 576 | } |
577 | - $option_name = $category['title'] . ' : ' . $event['title']; |
|
578 | - $option_value = $category['name'] . '-' . $event['name']; |
|
577 | + $option_name = $category['title'].' : '.$event['title']; |
|
578 | + $option_value = $category['name'].'-'.$event['name']; |
|
579 | 579 | $options[$option_name] = $option_value; |
580 | 580 | } |
581 | 581 | unset($events); |
@@ -487,19 +487,19 @@ |
||
487 | 487 | $tags = $helper->getTags($category, $item_id, $event, $module->getVar('dirname')); |
488 | 488 | |
489 | 489 | $tags['X_ITEM_NAME'] |
490 | - = !empty($item_info['name']) ? $item_info['name'] : '[' . _MD_NOTIFICATIONS_ITEMNAMENOTAVAILABLE . ']'; |
|
490 | + = !empty($item_info['name']) ? $item_info['name'] : '['._MD_NOTIFICATIONS_ITEMNAMENOTAVAILABLE.']'; |
|
491 | 491 | $tags['X_ITEM_URL'] |
492 | - = !empty($item_info['url']) ? $item_info['url'] : '[' . _MD_NOTIFICATIONS_ITEMURLNOTAVAILABLE . ']'; |
|
492 | + = !empty($item_info['url']) ? $item_info['url'] : '['._MD_NOTIFICATIONS_ITEMURLNOTAVAILABLE.']'; |
|
493 | 493 | $tags['X_ITEM_TYPE'] |
494 | 494 | = !empty($category_info['item_name']) ? $category_info['title'] : '[' |
495 | - . _MD_NOTIFICATIONS_ITEMTYPENOTAVAILABLE . ']'; |
|
495 | + . _MD_NOTIFICATIONS_ITEMTYPENOTAVAILABLE.']'; |
|
496 | 496 | $tags['X_MODULE'] = $module->getVar('name'); |
497 | - $tags['X_MODULE_URL'] = \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/'; |
|
497 | + $tags['X_MODULE_URL'] = \XoopsBaseConfig::get('url').'/modules/'.$module->getVar('dirname').'/'; |
|
498 | 498 | $tags['X_NOTIFY_CATEGORY'] = $category; |
499 | 499 | $tags['X_NOTIFY_EVENT'] = $event; |
500 | 500 | |
501 | 501 | $template_dir = $event_info['mail_template_dir']; |
502 | - $template = $event_info['mail_template'] . '.tpl'; |
|
502 | + $template = $event_info['mail_template'].'.tpl'; |
|
503 | 503 | $subject = $event_info['mail_subject']; |
504 | 504 | |
505 | 505 | foreach ($notifications as $notification) { |
@@ -53,143 +53,143 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | switch ($op) { |
56 | - case 'cancel': |
|
57 | - // FIXME: does this always go back to correct location?? |
|
58 | - $xoops->redirect('index.php'); |
|
59 | - break; |
|
56 | + case 'cancel': |
|
57 | + // FIXME: does this always go back to correct location?? |
|
58 | + $xoops->redirect('index.php'); |
|
59 | + break; |
|
60 | 60 | |
61 | - case 'list': |
|
62 | - // Do we allow other users to see our notifications? Nope, but maybe |
|
63 | - // see who else is monitoring a particular item (or at least how many)? |
|
64 | - // Well, maybe admin can see all... |
|
65 | - // TODO: need to span over multiple pages...??? |
|
66 | - // Get an array of all notifications for the selected user |
|
67 | - $criteria = new Criteria('uid', $uid); |
|
68 | - $criteria->setSort('modid,category,itemid'); |
|
69 | - $notification_handler = $helper->getHandlerNotification(); |
|
70 | - $notifications = $notification_handler->getObjectsArray($criteria); |
|
61 | + case 'list': |
|
62 | + // Do we allow other users to see our notifications? Nope, but maybe |
|
63 | + // see who else is monitoring a particular item (or at least how many)? |
|
64 | + // Well, maybe admin can see all... |
|
65 | + // TODO: need to span over multiple pages...??? |
|
66 | + // Get an array of all notifications for the selected user |
|
67 | + $criteria = new Criteria('uid', $uid); |
|
68 | + $criteria->setSort('modid,category,itemid'); |
|
69 | + $notification_handler = $helper->getHandlerNotification(); |
|
70 | + $notifications = $notification_handler->getObjectsArray($criteria); |
|
71 | 71 | |
72 | - // Generate the info for the template |
|
73 | - $module_handler = $xoops->getHandlerModule(); |
|
74 | - $modules = array(); |
|
75 | - $prev_modid = -1; |
|
76 | - $prev_category = -1; |
|
77 | - $prev_item = -1; |
|
78 | - $modulesObj = array(); |
|
79 | - foreach ($notifications as $n) { |
|
80 | - /* @var $n NotificationsNotification */ |
|
81 | - $modid = $n->getVar('modid'); |
|
82 | - if ($modid != $prev_modid) { |
|
83 | - $prev_modid = $modid; |
|
84 | - $prev_category = -1; |
|
85 | - $prev_item = -1; |
|
86 | - $module = $xoops->getModuleById($modid); |
|
87 | - $modulesObj[$modid] = $module; |
|
88 | - $modules[$modid] = array( |
|
89 | - 'id' => $modid, 'name' => $module->getVar('name'), 'categories' => array() |
|
90 | - ); |
|
91 | - // TODO: note, we could auto-generate the url from the id |
|
92 | - // and category info... (except when category has multiple |
|
93 | - // subscription scripts defined...) |
|
94 | - // OR, add one more option to xoops_version 'view_from' |
|
95 | - // which tells us where to redirect... BUT, e.g. forums, it |
|
96 | - // still wouldn't give us all the required info... e.g. the |
|
97 | - // topic ID doesn't give us the ID of the forum which is |
|
98 | - // a required argument... |
|
99 | - // Get the lookup function, if exists |
|
100 | - } |
|
101 | - $category = $n->getVar('category'); |
|
102 | - if ($category != $prev_category) { |
|
103 | - $category_info = array(); |
|
104 | - $prev_category = $category; |
|
105 | - $prev_item = -1; |
|
106 | - $category_info = $helper->getCategory($category, $modulesObj[$modid]->getVar('dirname')); |
|
107 | - $modules[$modid]['categories'][$category] = array( |
|
108 | - 'name' => $category, 'title' => $category_info['title'], 'items' => array() |
|
109 | - ); |
|
110 | - } |
|
111 | - $item = $n->getVar('itemid'); |
|
112 | - if ($item != $prev_item) { |
|
113 | - $prev_item = $item; |
|
72 | + // Generate the info for the template |
|
73 | + $module_handler = $xoops->getHandlerModule(); |
|
74 | + $modules = array(); |
|
75 | + $prev_modid = -1; |
|
76 | + $prev_category = -1; |
|
77 | + $prev_item = -1; |
|
78 | + $modulesObj = array(); |
|
79 | + foreach ($notifications as $n) { |
|
80 | + /* @var $n NotificationsNotification */ |
|
81 | + $modid = $n->getVar('modid'); |
|
82 | + if ($modid != $prev_modid) { |
|
83 | + $prev_modid = $modid; |
|
84 | + $prev_category = -1; |
|
85 | + $prev_item = -1; |
|
86 | + $module = $xoops->getModuleById($modid); |
|
87 | + $modulesObj[$modid] = $module; |
|
88 | + $modules[$modid] = array( |
|
89 | + 'id' => $modid, 'name' => $module->getVar('name'), 'categories' => array() |
|
90 | + ); |
|
91 | + // TODO: note, we could auto-generate the url from the id |
|
92 | + // and category info... (except when category has multiple |
|
93 | + // subscription scripts defined...) |
|
94 | + // OR, add one more option to xoops_version 'view_from' |
|
95 | + // which tells us where to redirect... BUT, e.g. forums, it |
|
96 | + // still wouldn't give us all the required info... e.g. the |
|
97 | + // topic ID doesn't give us the ID of the forum which is |
|
98 | + // a required argument... |
|
99 | + // Get the lookup function, if exists |
|
100 | + } |
|
101 | + $category = $n->getVar('category'); |
|
102 | + if ($category != $prev_category) { |
|
103 | + $category_info = array(); |
|
104 | + $prev_category = $category; |
|
105 | + $prev_item = -1; |
|
106 | + $category_info = $helper->getCategory($category, $modulesObj[$modid]->getVar('dirname')); |
|
107 | + $modules[$modid]['categories'][$category] = array( |
|
108 | + 'name' => $category, 'title' => $category_info['title'], 'items' => array() |
|
109 | + ); |
|
110 | + } |
|
111 | + $item = $n->getVar('itemid'); |
|
112 | + if ($item != $prev_item) { |
|
113 | + $prev_item = $item; |
|
114 | 114 | |
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() |
|
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() |
|
118 | + ); |
|
119 | + } |
|
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') |
|
118 | 126 | ); |
119 | 127 | } |
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') |
|
126 | - ); |
|
127 | - } |
|
128 | - $xoops->header('module:notifications/list.tpl'); |
|
129 | - $xoops->tpl()->assign('modules', $modules); |
|
130 | - $user_info = array('uid' => $xoops->user->getVar('uid')); |
|
131 | - $xoops->tpl()->assign('user', $user_info); |
|
132 | - $xoops->tpl()->assign('lang_cancel', XoopsLocale::A_CANCEL); |
|
133 | - $xoops->tpl()->assign('lang_clear', _MD_NOTIFICATIONS_CLEAR); |
|
134 | - $xoops->tpl()->assign('lang_delete', XoopsLocale::A_DELETE); |
|
135 | - $xoops->tpl()->assign('lang_checkall', _MD_NOTIFICATIONS_CHECKALL); |
|
136 | - $xoops->tpl()->assign('lang_module', _MD_NOTIFICATIONS_MODULE); |
|
137 | - $xoops->tpl()->assign('lang_event', _MD_NOTIFICATIONS_EVENT); |
|
138 | - $xoops->tpl()->assign('lang_events', _MD_NOTIFICATIONS_EVENTS); |
|
139 | - $xoops->tpl()->assign('lang_category', _MD_NOTIFICATIONS_CATEGORY); |
|
140 | - $xoops->tpl()->assign('lang_itemid', _MD_NOTIFICATIONS_ITEMID); |
|
141 | - $xoops->tpl()->assign('lang_itemname', _MD_NOTIFICATIONS_ITEMNAME); |
|
142 | - $xoops->tpl()->assign('lang_activenotifications', _MD_NOTIFICATIONS_ACTIVENOTIFICATIONS); |
|
143 | - $xoops->tpl()->assign('notification_token', $xoops->security()->createToken()); |
|
144 | - $xoops->footer(); |
|
128 | + $xoops->header('module:notifications/list.tpl'); |
|
129 | + $xoops->tpl()->assign('modules', $modules); |
|
130 | + $user_info = array('uid' => $xoops->user->getVar('uid')); |
|
131 | + $xoops->tpl()->assign('user', $user_info); |
|
132 | + $xoops->tpl()->assign('lang_cancel', XoopsLocale::A_CANCEL); |
|
133 | + $xoops->tpl()->assign('lang_clear', _MD_NOTIFICATIONS_CLEAR); |
|
134 | + $xoops->tpl()->assign('lang_delete', XoopsLocale::A_DELETE); |
|
135 | + $xoops->tpl()->assign('lang_checkall', _MD_NOTIFICATIONS_CHECKALL); |
|
136 | + $xoops->tpl()->assign('lang_module', _MD_NOTIFICATIONS_MODULE); |
|
137 | + $xoops->tpl()->assign('lang_event', _MD_NOTIFICATIONS_EVENT); |
|
138 | + $xoops->tpl()->assign('lang_events', _MD_NOTIFICATIONS_EVENTS); |
|
139 | + $xoops->tpl()->assign('lang_category', _MD_NOTIFICATIONS_CATEGORY); |
|
140 | + $xoops->tpl()->assign('lang_itemid', _MD_NOTIFICATIONS_ITEMID); |
|
141 | + $xoops->tpl()->assign('lang_itemname', _MD_NOTIFICATIONS_ITEMNAME); |
|
142 | + $xoops->tpl()->assign('lang_activenotifications', _MD_NOTIFICATIONS_ACTIVENOTIFICATIONS); |
|
143 | + $xoops->tpl()->assign('notification_token', $xoops->security()->createToken()); |
|
144 | + $xoops->footer(); |
|
145 | 145 | |
146 | - // TODO: another display mode... instead of one notification per line, |
|
147 | - // show one line per item_id, with checkboxes for the available options... |
|
148 | - // and an update button to change them... And still have the delete box |
|
149 | - // to delete all notification for that item |
|
150 | - // How about one line per ID, showing category, name, id, and list of |
|
151 | - // events... |
|
152 | - // TODO: it would also be useful to provide links to other available |
|
153 | - // options so we can say switch from new_message to 'bookmark' if we |
|
154 | - // are receiving too many emails. OR, if we click on 'change options' |
|
155 | - // we get a form for that page... |
|
156 | - // TODO: option to specify one-time??? or other modes?? |
|
157 | - break; |
|
146 | + // TODO: another display mode... instead of one notification per line, |
|
147 | + // show one line per item_id, with checkboxes for the available options... |
|
148 | + // and an update button to change them... And still have the delete box |
|
149 | + // to delete all notification for that item |
|
150 | + // How about one line per ID, showing category, name, id, and list of |
|
151 | + // events... |
|
152 | + // TODO: it would also be useful to provide links to other available |
|
153 | + // options so we can say switch from new_message to 'bookmark' if we |
|
154 | + // are receiving too many emails. OR, if we click on 'change options' |
|
155 | + // we get a form for that page... |
|
156 | + // TODO: option to specify one-time??? or other modes?? |
|
157 | + break; |
|
158 | 158 | |
159 | - case 'delete_ok': |
|
160 | - if (empty($_POST['del_not'])) { |
|
161 | - $helper->redirect('index.php', 2, _MD_NOTIFICATIONS_NOTHINGTODELETE); |
|
162 | - } |
|
163 | - $xoops->header(); |
|
164 | - $hidden_vars = array( |
|
165 | - 'uid' => $uid, 'delete_ok' => 1, 'del_not' => $_POST['del_not'] |
|
166 | - ); |
|
167 | - echo '<h4>' . _MD_NOTIFICATIONS_DELETINGNOTIFICATIONS . '</h4>'; |
|
168 | - echo $xoops->confirm($hidden_vars, $xoops->getEnv('PHP_SELF'), _MD_NOTIFICATIONS_RUSUREDEL); |
|
169 | - $xoops->footer(); |
|
170 | - // FIXME: There is a problem here... in $xoops->confirm it treats arrays as |
|
171 | - // optional radio arguments on the confirmation page... change this or |
|
172 | - // write new function... |
|
173 | - break; |
|
159 | + case 'delete_ok': |
|
160 | + if (empty($_POST['del_not'])) { |
|
161 | + $helper->redirect('index.php', 2, _MD_NOTIFICATIONS_NOTHINGTODELETE); |
|
162 | + } |
|
163 | + $xoops->header(); |
|
164 | + $hidden_vars = array( |
|
165 | + 'uid' => $uid, 'delete_ok' => 1, 'del_not' => $_POST['del_not'] |
|
166 | + ); |
|
167 | + echo '<h4>' . _MD_NOTIFICATIONS_DELETINGNOTIFICATIONS . '</h4>'; |
|
168 | + echo $xoops->confirm($hidden_vars, $xoops->getEnv('PHP_SELF'), _MD_NOTIFICATIONS_RUSUREDEL); |
|
169 | + $xoops->footer(); |
|
170 | + // FIXME: There is a problem here... in $xoops->confirm it treats arrays as |
|
171 | + // optional radio arguments on the confirmation page... change this or |
|
172 | + // write new function... |
|
173 | + break; |
|
174 | 174 | |
175 | - case 'delete': |
|
176 | - if (!$xoops->security()->check()) { |
|
177 | - $helper->redirect('index.php', 2, implode('<br />', $xoops->security()->getErrors())); |
|
178 | - } |
|
179 | - if (empty($_POST['del_not'])) { |
|
180 | - $helper->redirect('index.php', 2, _MD_NOTIFICATIONS_NOTHINGTODELETE); |
|
181 | - } |
|
182 | - $notification_handler = $helper->getHandlerNotification(); |
|
183 | - foreach ($_POST['del_not'] as $n_array) { |
|
184 | - foreach ($n_array as $n) { |
|
185 | - $notification = $notification_handler->get($n); |
|
186 | - if ($notification->getVar('uid') == $uid) { |
|
187 | - $notification_handler->delete($notification); |
|
175 | + case 'delete': |
|
176 | + if (!$xoops->security()->check()) { |
|
177 | + $helper->redirect('index.php', 2, implode('<br />', $xoops->security()->getErrors())); |
|
178 | + } |
|
179 | + if (empty($_POST['del_not'])) { |
|
180 | + $helper->redirect('index.php', 2, _MD_NOTIFICATIONS_NOTHINGTODELETE); |
|
181 | + } |
|
182 | + $notification_handler = $helper->getHandlerNotification(); |
|
183 | + foreach ($_POST['del_not'] as $n_array) { |
|
184 | + foreach ($n_array as $n) { |
|
185 | + $notification = $notification_handler->get($n); |
|
186 | + if ($notification->getVar('uid') == $uid) { |
|
187 | + $notification_handler->delete($notification); |
|
188 | + } |
|
188 | 189 | } |
189 | 190 | } |
190 | - } |
|
191 | - $helper->redirect('index.php', 2, _MD_NOTIFICATIONS_DELETESUCCESS); |
|
192 | - break; |
|
193 | - default: |
|
194 | - break; |
|
191 | + $helper->redirect('index.php', 2, _MD_NOTIFICATIONS_DELETESUCCESS); |
|
192 | + break; |
|
193 | + default: |
|
194 | + break; |
|
195 | 195 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
22 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
23 | 23 | |
24 | 24 | $xoops = Xoops::getInstance(); |
25 | 25 | $helper = Notifications::getInstance(); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $hidden_vars = array( |
165 | 165 | 'uid' => $uid, 'delete_ok' => 1, 'del_not' => $_POST['del_not'] |
166 | 166 | ); |
167 | - echo '<h4>' . _MD_NOTIFICATIONS_DELETINGNOTIFICATIONS . '</h4>'; |
|
167 | + echo '<h4>'._MD_NOTIFICATIONS_DELETINGNOTIFICATIONS.'</h4>'; |
|
168 | 168 | echo $xoops->confirm($hidden_vars, $xoops->getEnv('PHP_SELF'), _MD_NOTIFICATIONS_RUSUREDEL); |
169 | 169 | $xoops->footer(); |
170 | 170 | // FIXME: There is a problem here... in $xoops->confirm it treats arrays as |
@@ -16,22 +16,22 @@ |
||
16 | 16 | * @author XOOPS Development Team |
17 | 17 | */ |
18 | 18 | |
19 | -$adminmenu=array(); |
|
19 | +$adminmenu = array(); |
|
20 | 20 | |
21 | 21 | $adminmenu[] = array( |
22 | - 'title' => _MI_DEBUGBAR_ADMENU1 , |
|
23 | - 'link' => 'admin/index.php' , |
|
22 | + 'title' => _MI_DEBUGBAR_ADMENU1, |
|
23 | + 'link' => 'admin/index.php', |
|
24 | 24 | 'icon' => 'home.png' |
25 | -) ; |
|
25 | +); |
|
26 | 26 | |
27 | 27 | $adminmenu[] = array( |
28 | - 'title' => _MI_DEBUGBAR_ADMENU2 , |
|
29 | - 'link' => 'admin/about.php' , |
|
28 | + 'title' => _MI_DEBUGBAR_ADMENU2, |
|
29 | + 'link' => 'admin/about.php', |
|
30 | 30 | 'icon' => 'about.png' |
31 | -) ; |
|
31 | +); |
|
32 | 32 | |
33 | 33 | $adminmenu[] = array( |
34 | - 'title' => _MI_DEBUGBAR_ADMENU3 , |
|
35 | - 'link' => 'admin/permissions.php' , |
|
34 | + 'title' => _MI_DEBUGBAR_ADMENU3, |
|
35 | + 'link' => 'admin/permissions.php', |
|
36 | 36 | 'icon' => 'permissions.png' |
37 | -) ; |
|
37 | +); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | use Xmf\Module\Helper; |
21 | 21 | use Xmf\Module\Helper\Permission; |
22 | 22 | |
23 | -include_once __DIR__ . '/admin_header.php'; |
|
23 | +include_once __DIR__.'/admin_header.php'; |
|
24 | 24 | |
25 | 25 | $moduleAdmin = new \Xoops\Module\Admin(); |
26 | 26 | $moduleAdmin->displayNavigation('permissions.php'); |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | $permHelper = new Permission(); |
30 | 30 | if ($permHelper) { |
31 | 31 | // this is the name and item we are going to work with |
32 | - $gperm_name='use_debugbar'; |
|
33 | - $gperm_itemid=0; |
|
32 | + $gperm_name = 'use_debugbar'; |
|
33 | + $gperm_itemid = 0; |
|
34 | 34 | |
35 | 35 | // if this is a post operation get our variables |
36 | - if ('POST'===Request::getMethod()) { |
|
37 | - $name=$permHelper->defaultFieldName($gperm_name, $gperm_itemid); |
|
38 | - $groups=Request::getVar($name, array(), 'POST'); |
|
36 | + if ('POST' === Request::getMethod()) { |
|
37 | + $name = $permHelper->defaultFieldName($gperm_name, $gperm_itemid); |
|
38 | + $groups = Request::getVar($name, array(), 'POST'); |
|
39 | 39 | $permHelper->savePermissionForItem($gperm_name, $gperm_itemid, $groups); |
40 | 40 | echo $xoops->alert('success', _MA_DEBUGBAR_FORM_PROCESSED, _MA_DEBUGBAR_PERMISSION_FORM); |
41 | 41 | } |
@@ -55,4 +55,4 @@ discard block |
||
55 | 55 | echo $form->render(); |
56 | 56 | } |
57 | 57 | |
58 | -include_once __DIR__ . '/admin_footer.php'; |
|
58 | +include_once __DIR__.'/admin_footer.php'; |