1: <?php
2: 3: 4: 5: 6:
7:
8: if (!defined('XOOPS_ROOT_PATH')) exit();
9:
10: require_once XOOPS_MODULE_PATH.'/profile/class/FieldType.class.php';
11:
12: class Profile_AssetPreload extends XCube_ActionFilter
13: {
14: 15: 16:
17: function preBlockFilter()
18: {
19: if (!$this->mRoot->mContext->hasAttribute('module.profile.HasSetAssetManager')) {
20: $delegate =new XCube_Delegate();
21: $delegate->register('Module.profile.Event.GetAssetManager');
22: $delegate->add(array(&$this, 'getManager'));
23: $this->mRoot->mContext->setAttribute('module.profile.HasSetAssetManager', true);
24: }
25: $file = XOOPS_MODULE_PATH.'/profile/class/DelegateFunctions.class.php';
26: $this->mRoot->mDelegateManager->add('Legacy_Profile.SaveProfile', 'Profile_Delegate::saveProfile', $file);
27: $this->mRoot->mDelegateManager->add('Legacy_Profile.GetDefinition', 'Profile_Delegate::getDefinition', $file);
28: $this->mRoot->mDelegateManager->add('Legacy_Profile.GetProfile', 'Profile_Delegate::getProfile', $file);
29: $this->mRoot->mDelegateManager->add('Legacy_Profile.SetupActionForm', 'Profile_Delegate::setupActionForm', $file);
30: $this->mRoot->mDelegateManager->add('Legacy_Profile.LoadActionForm', 'Profile_Delegate::loadActionForm', $file);
31: $this->mRoot->mDelegateManager->add('Legacy.Event.UserDelete', 'Profile_AssetPreload::deleteProfile');
32: $this->mRoot->mDelegateManager->add('Legacy.Admin.Event.UserDelete', 'Profile_AssetPreload::deleteProfile');
33: }
34:
35: 36: 37:
38: function getManager(&$obj)
39: {
40: require_once XOOPS_MODULE_PATH . "/profile/class/AssetManager.class.php";
41: $obj = Profile_AssetManager::getSingleton();
42: }
43:
44: 45: 46:
47: function deleteProfile(&$user)
48: {
49: $handler = Legacy_Utils::getModuleHandler('data', 'profile');
50: $handler->deleteAll(new Criteria('uid', $user->get('uid')), true);
51: }
52: }
53:
54: ?>
55: