17 public static function imageManager()
19 require_once XOOPS_MODULE_PATH .
'/legacy/class/ActionFrame.class.php';
21 $root =& XCube_Root::getSingleton();
22 $root->mController->setupModuleContext(
'legacy');
26 $action = isset($_REQUEST[
'op']) ? ucfirst(xoops_getrequest(
'op')) :
'List';
27 $moduleRunner->setMode(LEGACY_FRAME_MODE_IMAGE);
28 $moduleRunner->setActionName($action);
30 $root->mController->mExecute->add([&$moduleRunner,
'execute']);
32 $root->mController->execute();
34 $root->mController->executeView();
37 public static function backend()
39 require_once XOOPS_MODULE_PATH .
'/legacy/class/ActionFrame.class.php';
41 $root =& XCube_Root::getSingleton();
42 $root->mController->setupModuleContext(
'legacy');
45 $moduleRunner->setActionName(
'Backend');
47 $root->mController->mExecute->add([&$moduleRunner,
'execute']);
49 $root->mController->execute();
51 $root->mController->executeView();
54 public static function search()
56 require_once XOOPS_MODULE_PATH .
'/legacy/class/ActionFrame.class.php';
58 $root =& XCube_Root::getSingleton();
59 $root->mController->setupModuleContext(
'legacy');
62 $moduleRunner->setMode(LEGACY_FRAME_MODE_SEARCH);
63 $moduleRunner->setActionName(ucfirst(xoops_getrequest(
'action')));
65 $root->mController->mExecute->add([&$moduleRunner,
'execute']);
67 $root->mController->execute();
69 $root->mController->executeView();
72 public static function misc()
74 require_once XOOPS_LEGACY_PATH .
'/class/ActionFrame.class.php';
76 $root =& XCube_Root::getSingleton();
77 $root->mController->setupModuleContext(
'legacy');
79 $actionName = isset($_REQUEST[
'type']) ? ucfirst(xoops_getrequest(
'type')) :
'Smilies';
82 $moduleRunner->setMode(LEGACY_FRAME_MODE_MISC);
83 $moduleRunner->setActionName($actionName);
85 $root->mController->mExecute->add([&$moduleRunner,
'execute']);
87 $root->mController->setDialogMode(
true);
89 $root->mController->execute();
91 $root->mController->executeView();
94 public static function notifications()
96 require_once XOOPS_LEGACY_PATH .
'/class/ActionFrame.class.php';
98 $root =& XCube_Root::getSingleton();
99 $root->mController->setupModuleContext(
'legacy');
104 $actionName = isset($_REQUEST[
'op']) ? trim(xoops_getrequest(
'op')) :
'List';
105 $deleteValue = $root->mContext->mRequest->getRequest(
'delete');
106 $cancelValue = $root->mContext->mRequest->getRequest(
'delete_cancel');
107 if (isset($deleteValue)) {
108 $actionName =
'Delete';
110 if (isset($cancelValue)) {
111 $actionName =
'Cancel';
115 $moduleRunner->setMode(LEGACY_FRAME_MODE_NOTIFY);
116 $moduleRunner->setActionName($actionName);
118 $root->mController->mExecute->add([&$moduleRunner,
'execute']);
120 $root->mController->execute();
122 $root->mController->executeView();
132 require_once XOOPS_ROOT_PATH .
'/include/notification_constants.php';
133 require_once XOOPS_ROOT_PATH .
'/include/notification_functions.php';
135 $root =& XCube_Root::getSingleton();
136 $xoopsModule =& $root->mContext->mXoopsModule;
137 $moduleConfig =& $root->mContext->mModuleConfig;
138 $xoopsUser =& $root->mContext->mXoopsUser;
140 $xoops_notification = [];
141 $xoops_notification[
'show'] = is_object($xoopsModule) && is_object($xoopsUser) && notificationEnabled(
'inline') ? 1 : 0;
143 if ($xoops_notification[
'show']) {
144 $root->mLanguageManager->loadPageTypeMessageCatalog(
'notification');
145 $categories =& notificationSubscribableCategoryInfo();
147 if (!empty($categories)) {
148 $notification_handler =& xoops_gethandler(
'notification');
149 foreach ($categories as $category) {
150 $section[
'name'] = $category[
'name'];
151 $section[
'title'] = $category[
'title'];
152 $section[
'description'] = $category[
'description'];
153 $section[
'itemid'] = $category[
'item_id'];
154 $section[
'events'] = [];
155 $subscribed_events =& $notification_handler->getSubscribedEvents($category[
'name'], $category[
'item_id'], $xoopsModule->get(
'mid'), $xoopsUser->get(
'uid'));
156 foreach (notificationEvents($category[
'name'],
true) as $event) {
157 if (!empty($event[
'admin_only']) && !$xoopsUser->isAdmin($xoopsModule->getVar(
'mid'))) {
160 if (!empty($event[
'invisible'])) {
163 $subscribed = in_array ($event[
'name' ], $subscribed_events) ? 1 : 0;
164 $section[
'events'][$event[
'name']] = [
'name' => $event[
'name'],
'title' => $event[
'title'],
'caption' => $event[
'caption'],
'description' => $event[
'description'],
'subscribed' =>$subscribed];
167 $xoops_notification[
'categories'][$category[
'name']] = $section;
169 $xoops_notification[
'target_page'] =
'notification_update.php';
170 $xoops_notification[
'redirect_script'] = xoops_getenv(
'PHP_SELF');
172 $render->setAttribute(
'editprofile_url', XOOPS_URL .
'/edituser.php?uid=' . $xoopsUser->getShow(
'uid'));
174 switch ($xoopsUser->getVar(
'notify_method')) {
175 case XOOPS_NOTIFICATION_METHOD_DISABLE:
176 $render->setAttribute(
'user_method', _NOT_DISABLE);
178 case XOOPS_NOTIFICATION_METHOD_PM:
179 $render->setAttribute(
'user_method', _NOT_PM);
181 case XOOPS_NOTIFICATION_METHOD_EMAIL:
182 $render->setAttribute(
'user_method', _NOT_EMAIL);
186 $xoops_notification[
'show'] = 0;
188 if (0 == $event_count) {
189 $xoops_notification[
'show'] = 0;
193 $render->setAttribute(
'xoops_notification', $xoops_notification);
206 $handler =& xoops_gethandler(
'comment');
207 $criteria =
new Criteria(
'com_uid', $xoopsUser->get(
'uid'));
208 $posts += $handler->getCount($criteria);