1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: if (!defined('XOOPS_ROOT_PATH')) exit();
12:
13: class Legacy_EventFunction
14: {
15: function imageManager()
16: {
17: require_once XOOPS_MODULE_PATH . "/legacy/class/ActionFrame.class.php";
18:
19: $root =& XCube_Root::getSingleton();
20: $root->mController->setupModuleContext('legacy');
21:
22: $moduleRunner =new Legacy_ActionFrame(false);
23:
24: $action = isset($_REQUEST['op']) ? ucfirst(xoops_getrequest('op')) : "List";
25: $moduleRunner->setMode(LEGACY_FRAME_MODE_IMAGE);
26: $moduleRunner->setActionName($action);
27:
28: $root->mController->mExecute->add(array(&$moduleRunner, 'execute'));
29:
30: $root->mController->execute();
31:
32: $root->mController->executeView();
33: }
34:
35: function backend()
36: {
37: require_once XOOPS_MODULE_PATH . "/legacy/class/ActionFrame.class.php";
38:
39: $root =& XCube_Root::getSingleton();
40: $root->mController->setupModuleContext('legacy');
41:
42: $moduleRunner =new Legacy_ActionFrame(false);
43: $moduleRunner->setActionName('Backend');
44:
45: $root->mController->mExecute->add(array(&$moduleRunner, 'execute'));
46:
47: $root->mController->execute();
48:
49: $root->mController->executeView();
50: }
51:
52: function search()
53: {
54: require_once XOOPS_MODULE_PATH . "/legacy/class/ActionFrame.class.php";
55:
56: $root =& XCube_Root::getSingleton();
57: $root->mController->setupModuleContext('legacy');
58:
59: $moduleRunner =new Legacy_ActionFrame(false);
60: $moduleRunner->setMode(LEGACY_FRAME_MODE_SEARCH);
61: $moduleRunner->setActionName(ucfirst(xoops_getrequest('action')));
62:
63: $root->mController->mExecute->add(array(&$moduleRunner, 'execute'));
64:
65: $root->mController->execute();
66:
67: $root->mController->executeView();
68:
69: }
70:
71: function misc()
72: {
73: require_once XOOPS_LEGACY_PATH . "/class/ActionFrame.class.php";
74:
75: $root =& XCube_Root::getSingleton();
76: $root->mController->setupModuleContext('legacy');
77:
78: $actionName = isset($_REQUEST['type']) ? ucfirst(xoops_getrequest('type')) : "Smilies";
79:
80: $moduleRunner = new Legacy_ActionFrame(false);
81: $moduleRunner->setMode(LEGACY_FRAME_MODE_MISC);
82: $moduleRunner->setActionName($actionName);
83:
84: $root->mController->mExecute->add(array(&$moduleRunner, 'execute'));
85:
86: $root->mController->setDialogMode(true);
87:
88: $root->mController->execute();
89:
90: $root->mController->executeView();
91: }
92:
93: function notifications()
94: {
95: require_once XOOPS_LEGACY_PATH . "/class/ActionFrame.class.php";
96:
97: $root =& XCube_Root::getSingleton();
98: $root->mController->setupModuleContext('legacy');
99:
100:
101:
102:
103: $actionName = isset($_REQUEST['op']) ? trim(xoops_getrequest('op')) : "List";
104: $deleteValue = $root->mContext->mRequest->getRequest('delete');
105: $cancelValue = $root->mContext->mRequest->getRequest('delete_cancel');
106: if (isset($deleteValue)) {
107: $actionName = "Delete";
108: }
109: if (isset($cancelValue)){
110: $actionName = "Cancel";
111: }
112:
113: $moduleRunner = new Legacy_ActionFrame(false);
114: $moduleRunner->setMode(LEGACY_FRAME_MODE_NOTIFY);
115: $moduleRunner->setActionName($actionName);
116:
117: $root->mController->mExecute->add(array(&$moduleRunner, 'execute'));
118:
119: $root->mController->execute();
120:
121: $root->mController->executeView();
122: }
123:
124: 125: 126: 127: 128:
129: function notifications_select(&$render)
130: {
131: require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
132: require_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
133:
134: $root =& XCube_Root::getSingleton();
135: $xoopsModule =& $root->mContext->mXoopsModule;
136: $moduleConfig =& $root->mContext->mModuleConfig;
137: $xoopsUser =& $root->mContext->mXoopsUser;
138:
139: $xoops_notification = array();
140: $xoops_notification['show'] = is_object($xoopsModule) && is_object($xoopsUser) && notificationEnabled('inline') ? 1 : 0;
141:
142: if ($xoops_notification['show']) {
143: $root->mLanguageManager->loadPageTypeMessageCatalog('notification');
144: $categories =& notificationSubscribableCategoryInfo();
145: $event_count = 0;
146: if (!empty($categories)) {
147: $notification_handler =& xoops_gethandler('notification');
148: foreach ($categories as $category) {
149: $section['name'] = $category['name'];
150: $section['title'] = $category['title'];
151: $section['description'] = $category['description'];
152: $section['itemid'] = $category['item_id'];
153: $section['events'] = array();
154: $subscribed_events =& $notification_handler->getSubscribedEvents($category['name'], $category['item_id'], $xoopsModule->get('mid'), $xoopsUser->get('uid'));
155: foreach (notificationEvents($category['name'], true) as $event) {
156: if (!empty($event['admin_only']) && !$xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
157: continue;
158: }
159: if (!empty($event['invisible'])) {
160: continue;
161: }
162: $subscribed = in_array($event['name'], $subscribed_events) ? 1 : 0;
163: $section['events'][$event['name']] = array ('name'=>$event['name'], 'title'=>$event['title'], 'caption'=>$event['caption'], 'description'=>$event['description'], 'subscribed'=>$subscribed);
164: $event_count ++;
165: }
166: $xoops_notification['categories'][$category['name']] = $section;
167: }
168: $xoops_notification['target_page'] = "notification_update.php";
169: $xoops_notification['redirect_script'] = xoops_getenv('PHP_SELF');
170:
171: $render->setAttribute('editprofile_url', XOOPS_URL . '/edituser.php?uid=' . $xoopsUser->getShow('uid'));
172:
173: switch ($xoopsUser->getVar('notify_method')) {
174: case XOOPS_NOTIFICATION_METHOD_DISABLE:
175: $render->setAttribute('user_method', _NOT_DISABLE);
176: break;
177: case XOOPS_NOTIFICATION_METHOD_PM:
178: $render->setAttribute('user_method', _NOT_PM);
179: break;
180: case XOOPS_NOTIFICATION_METHOD_EMAIL:
181: $render->setAttribute('user_method', _NOT_EMAIL);
182: break;
183: }
184: } else {
185: $xoops_notification['show'] = 0;
186: }
187: if ($event_count == 0) {
188: $xoops_notification['show'] = 0;
189: }
190: }
191:
192: $render->setAttribute('xoops_notification', $xoops_notification);
193: }
194:
195: 196: 197: 198: 199: 200:
201: function recountPost(&$posts, $xoopsUser)
202: {
203: $handler =& xoops_gethandler('comment');
204: $criteria =new Criteria('com_uid', $xoopsUser->get('uid'));
205: $posts += $handler->getCount($criteria);
206: }
207: }
208:
209: ?>
210: