@@ -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'; |
@@ -16,10 +16,10 @@ |
||
16 | 16 | * @author XOOPS Development Team |
17 | 17 | */ |
18 | 18 | |
19 | -include_once __DIR__ . '/admin_header.php'; |
|
19 | +include_once __DIR__.'/admin_header.php'; |
|
20 | 20 | |
21 | 21 | $moduleAdmin = new \Xoops\Module\Admin(); |
22 | 22 | $moduleAdmin->displayNavigation('index.php'); |
23 | 23 | $moduleAdmin->displayIndex(); |
24 | 24 | |
25 | -include_once __DIR__ . '/admin_footer.php'; |
|
25 | +include_once __DIR__.'/admin_footer.php'; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | { |
95 | 95 | $path = dirname(__DIR__); |
96 | 96 | XoopsLoad::addMap(array( |
97 | - 'debugbarlogger' => $path . '/class/debugbarlogger.php', |
|
97 | + 'debugbarlogger' => $path.'/class/debugbarlogger.php', |
|
98 | 98 | )); |
99 | 99 | } |
100 | 100 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $logger = DebugbarLogger::getInstance(); |
111 | 111 | |
112 | - $logger->enable();//until we get a db connection debug is enabled |
|
112 | + $logger->enable(); //until we get a db connection debug is enabled |
|
113 | 113 | //if (isset($_SERVER['REQUEST_TIME_FLOAT'])) { |
114 | 114 | // $logger->getDebugbar()['time']->addMeasure('Loading', $_SERVER['REQUEST_TIME_FLOAT'], microtime(true)); |
115 | 115 | //} |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | { |
255 | 255 | /* @var $block XoopsBlock */ |
256 | 256 | $block = $args[0]; |
257 | - $isCached= $args[1]; |
|
257 | + $isCached = $args[1]; |
|
258 | 258 | //Logger::getInstance()->addBlock($block->getVar('name'), $isCached, $block->getVar('bcachetime')); |
259 | 259 | $context = array('channel'=>'Blocks', 'cached'=>$isCached, 'cachetime'=>$block->getVar('bcachetime')); |
260 | 260 | DebugbarLogger::getInstance()->log(LogLevel::INFO, $block->getVar('name'), $context); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | */ |
405 | 405 | public static function eventDebugTimerStart($args) |
406 | 406 | { |
407 | - $args = (array) $args; |
|
407 | + $args = (array)$args; |
|
408 | 408 | DebugbarLogger::getInstance()->startTime($args[0], isset($args[1]) ? $args[1] : null); |
409 | 409 | } |
410 | 410 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | { |
31 | 31 | $xoops = Xoops::getInstance(); |
32 | 32 | // copy font-awesome font files to assets directory |
33 | - $dir = \XoopsBaseConfig::get('lib-path') . '/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/'; |
|
33 | + $dir = \XoopsBaseConfig::get('lib-path').'/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/'; |
|
34 | 34 | $pattern = '*'; |
35 | 35 | return $xoops->assets()->copyFileAssets($dir, $pattern, 'fonts'); |
36 | 36 | } |
@@ -15,18 +15,18 @@ |
||
15 | 15 | * @author Richard Griffith <[email protected]> |
16 | 16 | */ |
17 | 17 | |
18 | -define('_MI_DEBUGBAR_NAME','DebugBar'); |
|
19 | -define('_MI_DEBUGBAR_DSC','Error reporting and performance analysis'); |
|
18 | +define('_MI_DEBUGBAR_NAME', 'DebugBar'); |
|
19 | +define('_MI_DEBUGBAR_DSC', 'Error reporting and performance analysis'); |
|
20 | 20 | |
21 | -define('_MI_DEBUGBAR_ENABLE',"Display DebugBar"); |
|
22 | -define('_MI_DEBUGBAR_SMARTYDEBUG',"Enable Smarty Debug"); |
|
21 | +define('_MI_DEBUGBAR_ENABLE', "Display DebugBar"); |
|
22 | +define('_MI_DEBUGBAR_SMARTYDEBUG', "Enable Smarty Debug"); |
|
23 | 23 | |
24 | -define('_MI_DEBUGBAR_UCONF_CAT_OPT','Options'); |
|
25 | -define('_MI_DEBUGBAR_UCONF_CAT_OPT_DESC','DebugBar Options'); |
|
24 | +define('_MI_DEBUGBAR_UCONF_CAT_OPT', 'Options'); |
|
25 | +define('_MI_DEBUGBAR_UCONF_CAT_OPT_DESC', 'DebugBar Options'); |
|
26 | 26 | |
27 | -define('_MI_DEBUGBAR_UCONF_ENABLE_BAR','Display DebugBar'); |
|
28 | -define('_MI_DEBUGBAR_UCONF_ENABLE_SMARTY','Enable Smarty Debug'); |
|
27 | +define('_MI_DEBUGBAR_UCONF_ENABLE_BAR', 'Display DebugBar'); |
|
28 | +define('_MI_DEBUGBAR_UCONF_ENABLE_SMARTY', 'Enable Smarty Debug'); |
|
29 | 29 | |
30 | -define('_MI_DEBUGBAR_ADMENU1','Home'); |
|
31 | -define('_MI_DEBUGBAR_ADMENU2','About'); |
|
32 | -define('_MI_DEBUGBAR_ADMENU3','Permissions'); |
|
30 | +define('_MI_DEBUGBAR_ADMENU1', 'Home'); |
|
31 | +define('_MI_DEBUGBAR_ADMENU2', 'About'); |
|
32 | +define('_MI_DEBUGBAR_ADMENU3', 'Permissions'); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @author Richard Griffith <[email protected]> |
16 | 16 | */ |
17 | 17 | |
18 | -define('_MA_DEBUGBAR_PERMISSION_FORM','DebugBar Usage Permissions'); |
|
19 | -define('_MA_DEBUGBAR_PERMISSION_GROUPS','Select groups that may use the DebugBar'); |
|
20 | -define('_MA_DEBUGBAR_FORM_SUBMIT','Save'); |
|
21 | -define('_MA_DEBUGBAR_FORM_PROCESSED','Permissions updated.'); |
|
18 | +define('_MA_DEBUGBAR_PERMISSION_FORM', 'DebugBar Usage Permissions'); |
|
19 | +define('_MA_DEBUGBAR_PERMISSION_GROUPS', 'Select groups that may use the DebugBar'); |
|
20 | +define('_MA_DEBUGBAR_FORM_SUBMIT', 'Save'); |
|
21 | +define('_MA_DEBUGBAR_FORM_PROCESSED', 'Permissions updated.'); |
@@ -177,12 +177,12 @@ discard block |
||
177 | 177 | $excludes = array( |
178 | 178 | //'/vendor/font-awesome/', // font-awesome needs special process |
179 | 179 | //'/vendor/highlightjs/', // highlightjs has some negative side effects |
180 | - '/vendor/jquery/', // jquery is already available |
|
180 | + '/vendor/jquery/', // jquery is already available |
|
181 | 181 | ); |
182 | 182 | |
183 | 183 | $cssAssets = array_filter( |
184 | 184 | $cssAssets, |
185 | - function ($filename) use ($excludes) { |
|
185 | + function($filename) use ($excludes) { |
|
186 | 186 | foreach ($excludes as $exclude) { |
187 | 187 | if (false !== strpos($filename, $exclude)) { |
188 | 188 | return false; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | $jsAssets = array_filter( |
196 | 196 | $jsAssets, |
197 | - function ($filename) use ($excludes) { |
|
197 | + function($filename) use ($excludes) { |
|
198 | 198 | foreach ($excludes as $exclude) { |
199 | 199 | if (false !== strpos($filename, $exclude)) { |
200 | 200 | return false; |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | { |
391 | 391 | if ($this->activated) { |
392 | 392 | $this->debugbar->stackData(); |
393 | - $this->activated=false; |
|
393 | + $this->activated = false; |
|
394 | 394 | $this->renderingEnabled = false; |
395 | 395 | } |
396 | 396 | } |
@@ -431,9 +431,9 @@ discard block |
||
431 | 431 | $pattern = '<!--<xo-logger-output>-->'; |
432 | 432 | $pos = strpos($output, $pattern); |
433 | 433 | if ($pos !== false) { |
434 | - return substr($output, 0, $pos) . $log . substr($output, $pos + strlen($pattern)); |
|
434 | + return substr($output, 0, $pos).$log.substr($output, $pos + strlen($pattern)); |
|
435 | 435 | } else { |
436 | - return $output . $log; |
|
436 | + return $output.$log; |
|
437 | 437 | } |
438 | 438 | } |
439 | 439 | |
@@ -452,15 +452,15 @@ discard block |
||
452 | 452 | } |
453 | 453 | $this->addToTheme(); |
454 | 454 | $this->addExtra(_MD_DEBUGBAR_PHP_VERSION, PHP_VERSION); |
455 | - $this->addExtra(_MD_DEBUGBAR_INCLUDED_FILES, (string) count(get_included_files())); |
|
455 | + $this->addExtra(_MD_DEBUGBAR_INCLUDED_FILES, (string)count(get_included_files())); |
|
456 | 456 | $conn = \Xoops::getInstance()->db()->getWrappedConnection(); |
457 | 457 | if ($conn instanceof \PDO) { |
458 | 458 | $this->addExtra( |
459 | - $conn->getAttribute(\PDO::ATTR_DRIVER_NAME) . ' version', |
|
459 | + $conn->getAttribute(\PDO::ATTR_DRIVER_NAME).' version', |
|
460 | 460 | $conn->getAttribute(\PDO::ATTR_SERVER_VERSION) |
461 | 461 | ); |
462 | 462 | $this->addExtra( |
463 | - $conn->getAttribute(\PDO::ATTR_DRIVER_NAME) . ' stats', |
|
463 | + $conn->getAttribute(\PDO::ATTR_DRIVER_NAME).' stats', |
|
464 | 464 | $conn->getAttribute(\PDO::ATTR_SERVER_INFO) |
465 | 465 | ); |
466 | 466 | } |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | switch ($chan) { |
639 | 639 | case 'blocks': |
640 | 640 | $channel = 'Blocks'; |
641 | - $msg = $message . ': '; |
|
641 | + $msg = $message.': '; |
|
642 | 642 | if ($context['cached']) { |
643 | 643 | $msg .= sprintf(_MD_DEBUGBAR_CACHED, (int)($context['cachetime'])); |
644 | 644 | } else { |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | break; |
652 | 652 | case 'extra': |
653 | 653 | $channel = 'Extra'; |
654 | - $msg = $context['name'] . ': ' . $message; |
|
654 | + $msg = $context['name'].': '.$message; |
|
655 | 655 | break; |
656 | 656 | case 'queries': |
657 | 657 | $channel = 'Queries'; |
@@ -663,11 +663,11 @@ discard block |
||
663 | 663 | // \Xmf\Debug::dump($context); |
664 | 664 | //} |
665 | 665 | $msg .= ' -- Error number: ' |
666 | - . (is_scalar($context['errno']) ? $context['errno'] : '?') |
|
666 | + . (is_scalar($context['errno']) ? $context['errno'] : '?') |
|
667 | 667 | . ' Error message: ' |
668 | - . (is_scalar($context['error']) ? $context['error'] : '?'); |
|
668 | + . (is_scalar($context['error']) ? $context['error'] : '?'); |
|
669 | 669 | } |
670 | - $msg = $qt . $msg; |
|
670 | + $msg = $qt.$msg; |
|
671 | 671 | break; |
672 | 672 | } |
673 | 673 | } |